Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

n00b q: Setting an ID in an XSL stylesheet

Status
Not open for further replies.

Vosper

Programmer
Dec 8, 2004
1
NZ
I'm sure this is an obvious question...

I have an XSL stylesheet, which looks like this:

<xs:element name="person">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="biography" type="xs:string"/>

I want to use the "name" element as also the ID for the "person" element, so that I can use .getElementByID in DOM. I have tried changing the "name" tag to:

<xs:element name="name" type="xs:ID"/>

but I get this error when validating an xml document that uses this stylesheet:

'John Smith' is not a valid value for 'NCName'.

I'm sure this is simple! Any help would be greatly appreciated :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top