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

Re: imbedding xsl stylesheet within xml doc ???

Subject: Re: imbedding xsl stylesheet within xml doc ???
From: "cking" <cking@xxxxxxxxxx>
Date: Fri, 3 Sep 2004 09:22:27 +0200
xpath id
Bovy, Stephen J wrote:
>
> What does the following note mean:
>
> NOTE:In order for such an attribute to be used with the XPath id
> function, it must actually be declared in the DTD as being an ID.
>

The DTD (Document Type Definition) defines the structure of an
XML document - it specifies what element names are used, where
the elements can occur, their attributes etc. An attribute can be
defined as being an ID. An example DTD file:

<!ELEMENT countries (country*) >
<!ELEMENT country   (name+) >
<!ATTLIST country 
          id        ID #REQUIRED >
<!ELEMENT name      (#PCDATA) >
<!ATTLIST name 
          lang      IDREF #REQUIRED >

The root element will be <countries>, which contains zero or more
<country> elements. A <country> element has one or more <name> 
children, and a required "id" attribute of type ID. The <name> element 
will hold a string (#PCDATA) and has one "lang" attribute of type IDREF.

So the 'lang' attribute in <name lang="nl"> can be used as a reference
to lookup a country element where <country id="nl">.

Other attribute types include CDATA (just some text) and option lists
like "(yes|no) 'yes'" which means the attribute must have a value of
either "yes" or "no" and the default is 'yes' (that's if the attribute
is not specified in the XML source doc).


So the note means, that you can use the XPath id() function 
only on these type 'ID' elements.

Cheers
Anton Triest

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.