Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6106429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:04:42+00:00 2026-05-23T14:04:42+00:00

I need some help with an issue I can’t figure out. I have the

  • 0

I need some help with an issue I can’t figure out.

I have the following xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="prueba.xsl"?>
<ficha>
<titulo></titulo>
<bloque>
    <texto></texto>
    <pregunta id="1" tipo="checkSN">
        <texto>Acredita curso bienestar animal minimo 20 h</texto>
    </pregunta>
    <pregunta id="2" tipo="texto">
        <texto>Sistemática inspección</texto>
    </pregunta>
    <grupo> 
        <texto>trato adecuado enfermos</texto>          
        <pregunta id="3" tipo="desplegableSNP">
            <texto>Recetas correspondientes</texto>
        </pregunta>
        <pregunta id="4" tipo="multiple">
            <texto>Disponen de comida y bebida</texto>
        </pregunta> 
    </grupo>
    <grupo>
        <texto>
            Heridos/Enfermos
        </texto>
        <pregunta id="5" tipo="multiple">
            <texto>Se aprecian heridos o enfermos momento inspeccion</texto>            
        </pregunta>
        <pregunta id="6" tipo="multiple">
            <texto>Separados del resto</texto>          
        </pregunta>
        <pregunta id="7" tipo="multiple">
            <texto>Disponen de comida y bebida</texto>          
        </pregunta>
        <pregunta id="8" tipo="multiple">
            <texto>Disponen de comida y bebida</texto>          
        </pregunta> 
    </grupo>        
</bloque>
<bloque>
    <texto>Condiciones específicas de alojamiento y manejo</texto>  
</bloque>
</ficha>

And The folliwng XSL sheet:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
 <html>
    <head>
      <link rel="stylesheet" type="text/css" href="prueba.css" />
    </head>
    <body>  
  <h2><xsl:value-of select="/ficha/titulo"/></h2>

  <h3>1: <xsl:value-of select="//pregunta[1]/@id"/></h3>
  <h3>2: <xsl:value-of select="//pregunta[2]/@id"/></h3>
  <h3>3: <xsl:value-of select="//pregunta[3]/@id"/></h3>
  <h3>4: <xsl:value-of select="//pregunta[4]/@id"/></h3>
  <h3>5: <xsl:value-of select="//pregunta[5]/@id"/></h3>
  <h3>6: <xsl:value-of select="//pregunta[6]/@id"/></h3>
  <h3>7: <xsl:value-of select="//pregunta[7]/@id"/></h3>
  <h3>8: <xsl:value-of select="//pregunta[8]/@id"/></h3>
  <h3>c: <xsl:value-of select="count(//pregunta)"/></h3>

     </body>
  </html>
</xsl:template>
</xsl:stylesheet>

When I load them I got this result:

1: 1
2: 2
3: 7
4: 8
5:
6:
7:
8:
c: 8

I don’t understand why it’s ignoring some nodes . If I include new nodes or move them, it always shows 4 results, from node at position 5 to 8 it never shows anything. I need to use this type of selecting because it’s from a Java application, the stylesheet is just for testing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:04:42+00:00Added an answer on May 23, 2026 at 2:04 pm

    Put //pregunta in parenthesis. Change your XPath expressions to (//pregunta)[1]/@id, (//pregunta)[2]/@id …

    Without parenthesis e.g. //pregunta[4] evaluates to all pregunta elements which are at the fourth position of their parent element.

    However (//pregunta)[4] first calculates the sequence of all pregunta elements and then takes the fourth element of that sequence.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help sorting out a CSS issue with my website, I have
I'm a n00b and I need some help figuring out this issue, I would
I need some help and hope someone can help me with this issue: hturl
Need some help with a #jQuery issue. Can someone look at this and tell
I have a query I need some help with, have been checking out a
I'm new to MySQL so I really need some help with an issue I'm
Need some help gathering thoughts on this issue. Our team is moving ahead with
I need some help in resolving an issue I'm facing an with communication of
Need some help about with Memcache. I have created a class and want to
Need some help, please. I have a line of horizontal thumbnails loaded as ONE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.