how to get number from <docpage number="28"/> using xsl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ravindra5a3
    New Member
    • Aug 2012
    • 2

    how to get number from <docpage number="28"/> using xsl

    xml file:-

    <?docpage number="28"?>
    <info><title id="titleid" aid:pstyle="CT" >Atomic structure</title>


    i want to get docpage number from that xml file using xsl.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    see http://stackoverflow.com/questions/1...lement-in-xslt

    Comment

    • ravindra5a3
      New Member
      • Aug 2012
      • 2

      #3
      i am new to xslt can you please explain in detail how to get that 28 number from <?docpage number="28"?>

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        Sorry, but reading and understanding resources is a skill, you have to develop. if you’re not willing to do so, programming is not for you.

        I’d start with an example as close as possible to the given one.

        Comment

        • kamlesh21630
          New Member
          • Nov 2013
          • 16

          #5
          I think it would be help full

          Code:
          <xsl:template match="docpage">
          <p><xsl:value-of select="@number"/>
          <xsl:apply-templates/></p>
          </xsl:template>
          Last edited by Rabbit; Nov 2 '13, 04:27 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.

          Comment

          • kamlesh21630
            New Member
            • Nov 2013
            • 16

            #6
            Thanks i will use in further communication. :)

            Comment

            • Dormilich
              Recognized Expert Expert
              • Aug 2008
              • 8694

              #7
              @kamlesh: note that docpage is a Processing Instruction, not an Element.

              Comment

              • kamlesh21630
                New Member
                • Nov 2013
                • 16

                #8
                Hi @Dormilich i just go through to you given link and it was helpfull for me also. tanks for your valuable feedback.

                Comment

                • kamlesh21630
                  New Member
                  • Nov 2013
                  • 16

                  #9
                  Code:
                  <xsl:template match="processing-instruction('docpage')">
                    <docpage><xsl:value-of select="."/></docpage>
                  </xsl:template>

                  Comment

                  • kamlesh21630
                    New Member
                    • Nov 2013
                    • 16

                    #10
                    Hi @dormilich i just need your help.

                    I have a DTD and i want to make a parser to valdate my xml document through, could you help me to creat a parse?\

                    It would be very helpfull.

                    Comment

                    Working...