[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Recursing on top-level elements

Subject: Re: Recursing on top-level elements
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 30 Mar 2000 09:14:22 GMT
jan thunqvist function
         <xsl:when test="/test/foo/@id=@id">

is the test you wanted, but

Example XML:

<test>
   <foo id=1/>
   <foo id=3/>
   <bar>
      <baz id=1/>
      <baz id=2/>
      <baz id=3/>
      <baz id=4/>
   </bar>
</test>

There should of course be quotes around the attribute values: id="1" etc 
otherwise it isn't well formed XML.

I would also change the name of the attribute from id.
attributes called id are normally reserved for attributes that are
declared to be of type ID in a DTD (ie the attributes that work with the
XSL id() function). If you used the above with such a DTD then you would
get parse errors because XML ids have to use valid XML names (ie they
can not start with a number. And the same id can not appear on more than
one element you can not have foo and baz both with id 1.

David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.