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

Re: Selecting and "id"

Subject: Re: Selecting and "id"
From: Janning Vygen <vygen@xxxxxxxxxxxx>
Date: Tue, 5 Jun 2001 19:07:48 +0200
type id all elements with
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


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.