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

Re: [XSL] id() in Ancestor Nodes?

Subject: Re: [XSL] id() in Ancestor Nodes?
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 04 Oct 2007 07:20:10 +0200
Re:  [XSL] id() in Ancestor Nodes?
At 2007-10-03 23:28 -0400, Alice Ju-Hsuan Wei wrote:
I am trying to use the id function in XSLT to extract the publication id information from the "attribute" and have the output display the name of the publisher itself as it is. The complete code is as follows:



I note there is no DTD declaration of the attribute that has the ID type ... therefore, if you are using XSLT 1.0 you will need:

<!DOCTYPE bookshelf
<!ATTLIST publication xml:id ID #IMPLIED>

If you are using XSLT 2.0, it is up to your XSLT processor to choose to implicitly support xml:id (ref: 3.11 note), and if it does not, the above is required.

I tried using the id function:

<xsl:template name="bookpublisher">
       <xsl:variable name="name" select="id('@publish')"/>

If the processor is not instructed which attributes of which elements have attributes of type ID (the name is irrelevant; the type is given in a DTD declaration) for a given document, then the id() table is empty for the document.

I hope this helps.

. . . . . . . . . . . . . Ken

-- Upcoming public training: UBL and code lists Oct 1/5; Madrid Spain World-wide corporate, govt. & user group XML, XSL and UBL training RSS feeds: publicly-available developer resources and training G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Jul'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread


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.
First Name
Last Name
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.