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

Re: [xml] libxml2, xpointer and incorrect ID names



On Mon, Sep 22, 2003 at 07:39:24PM +0400, Slava Kostin wrote:
> <!DOCTYPE MyMessage [ <!ATTLIST MyTag id ID #REQUIRED > ]>
> 
> <MyMessage>
>   <MyTag id="12345">
[...]
> <Reference URI="#12345">...</Reference>
> 
> In other words, I have an element indefinier containing only numeric
> symbols. I know that it is not allowed by standard. I think, that's
> why libxml2 generates an error:

  Right. This is defined as an ID but doesn't follow the Name production

> If I'm adding a first letter into attribute "id", libxml2 processes
> XML successfully (but, of course, digest in that case does not match). 
> Please, advice me, what can I do? How can I make libxml2 correctly
> processing such documents?

  You must fix your document. You're asking for a non conformant behaviour
and libxml2 will not provide this, sorry, that's the only alternative.
Or don't use #12345 but use an xpointer() scheme looking for attribute
called id //MyTag[ id='12345'] , but libxml2 will not work with #12345

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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