[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: imbedding xsl stylesheet within xml doc ???
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|