W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2003

Problem using getElementById with XML Schema

From: David Miller <test2david@hotmail.com>
Date: Fri, 9 May 2003 13:39:41 +0100
To: <xmlschema-dev@w3.org>
Message-ID: <280020E49E4610419DE2D58CE30AC76F040526@mgs1.mighter-gissing.com>

I've recently changed an XML document from using a DTD for validation to
using a Schema.

I specify 'ID' attributes for some of the elements, so that I can locate
them using getElementById, but I can only get this to work when I use a
DTD, not when I use a schema.

My DTD attribute definition is:
    <!ATTLIST SystemManager id ID #REQUIRED>

My Schema attribute definition is:
    <xs:attribute name="id" type="xs:ID" use="required" />

where the xs namespace is declared by:
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified">

I am using Xerces 2.1.0 from C++, but I've also tried using MSXML from
C# without any success.

Any help or suggestions would be much appreciated.

Thanks,

David
-- 
David Miller
Received on Friday, 9 May 2003 10:29:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:37 GMT