[xml] DTD/Schema -> ID = Name or NCName



Daniel,

I am somewhat desperate about a problem with the latest LibXML (2.5.8).
I have XIncludes and use, for some reason(!) and some time, ID's of the
form "class:specifier", e.g. 

<section id="section:1-00-3435"/>

Moreover, I use the DocBook DTD to validate my XML against. For that, as
you certainly know, ID is defined as "NameChar", allowing, as far as I
understood, colons in ID values. [http://www.w3.org/TR/REC-xml#NT-Name]

I found that the XPath implementation in xpath.c checks the ID with
"xmlValidateNCName()", obviously making Xinclude's with colon's in ID's
fail.

I know that in XML Schema, an ID must be of type "NCName", but as far as
I understood, colons are really allowed for DTD based XML. I remember,
though, that with older versions (presumably LibXML2 2.4.1), the ID's of
the form I mentioned, ought to work. That and my research on ID values
basically led to the decision to use that form for ID values.

Would it be possible to add some distinction in "xpath.c" that handles
ID's differently, based on the condition that LIBXML_SCHEMAS_ENABLED is
defined or not, or even by setting some condition at runtime, based on
the fact that a document validates against a schema or a DTD, if this
fits your coding style?

Please, correct me if I am wrong with my assumptions about DTD's and
ID's. 

Best regards & thanks a lot for any comment,
Johann Richard

PS: I will eventually change the way we assign ID values, but since
LibXML2, 2.4.1, quite a few documents had been produced ... :S
-- 

********************************************
Johann Richard
IC & DSP Design Engineer  
Dspfactory SA
Champs-Montants 12a 
2074 Marin-Epagnier
Switzerland

Tel: +41 32 755 7462 
Fax: +41 32 755 7401 
e-mail: mailto:johann richard dspfactory ch

http://www.dspfactory.com
********************************************
 <>< Re: deemed!



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]