[XSL-LIST Mailing List Archive Home]
Re: [xsl] [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:
<!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: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