Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2006, 09:18 AM
Authorized User
 
Join Date: Dec 2005
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default Reading every element from the specified node

hai,
I have the XML like this:
<root>
  <artfront>
     <rauthor>
     <rtitle>
  </artfront>
  <art>
  <head>
  <artbody>
      <section>
        ......
        ......
         <subsection>
           .............
           .............
              <subsection>
                .......
                <qanda>
                  <quest>...........</quest>
                  <answer>...........</answer>
                  <quest>...........</quest>
                  <answer>...........</answer>
                </qanda>
        <artback>
          .........
          .........
        </artback>
</root>


here is our XSL:
  <xsl:template match="artbody">
  <xsl:for-each select="//*">
  <xsl:message><xsl:value-of select="name()"/></xsl:message>
  </xsl:for-each>
  </xsl:template>

It is reading from the root.but i want to read the elements from the artbody.
 i tried like this also
 <xsl:template match="artbody">
  <xsl:for-each select="artbody/*">
  <xsl:message><xsl:value-of select="name()"/></xsl:message>
  </xsl:for-each>
  </xsl:template>
but it is not work.

please give the solution
             Thank you







__________________
Thanks,
Rocxy.
 
Old January 3rd, 2006, 09:25 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

//* selects all elements in the document

.//* selects all elements that are descendants of the current element. Alternatively, use descendant::*.



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning node value to a href element!!!!!!!!! rakesh XSLT 4 July 25th, 2008 03:17 PM
search value of XML element/node in general deean XML 1 June 14th, 2008 03:17 AM
How Retrieve data of a node or from an element chandu.mca007 XML 1 December 16th, 2006 03:11 PM
How to delete an element and parent node. crossedge XSLT 1 March 14th, 2006 05:10 AM
How can I get the element node of an attribute cdias XSLT 2 March 15th, 2004 10:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.