[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Selecting and "id"
Am Dienstag, 5. Juni 2001 18:31 schrieb Jeffrey Langdon: > Can someone please tell me why I cannot get the following to work. I am > trying to select the id number for specific element. > > <!-- XML --> > > <AAA> > <BBB id = "11" >B1 </BBB> > <BBB id = "22" >B2 </BBB> > <BBB id = "33" >B3 </BBB> > </AAA> Two problems. first: the value of an ID attribute cant be a number. It has to be an "XML Name" and XML Names must start with only with letters, ideograms or underscore. so try _33 instead of 33 second: you have to use a DTD to define what attribute are of type ID!! the id() function doesnt select all Attributes named 'id' but selects all elements with attribute of TYPE ID!!!!! add to your XML at the beginning lines like this: <!DOCTYPE AAA [ <!ATTLIST BBB id ID #IMPLIED> ]> this defines attribute id as an ID attribute, so you could also say <!ATTLIST BBB myident ID #IMPLIED> and still the id() function knows what to look for. janning -- Planwerk 6 /websolutions Herzogstraße 86 40215 Düsseldorf fon 0211-6015919 fax 0211-6015917 http://www.planwerk6.de XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|