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

Re: [xml] make XPointer( id(XX) ) and C14n work without DTD



On Mon, Feb 23, 2004 at 06:29:23PM +0800, Andrew Fan wrote:
> Hi,
> 
> I have a xml file like,
> ---------
> <test>
> <content Id="target">
>    Hello, World!
> </content>
> ...............
> <Reference URI="#target">
> </Reference>
> </signtest>
> -------------
> 
> And I parsed it as DOM tree and want to use XPointer( id( "target" ) ) 
> to get the content. Because of the absence of DTD, I have to hack the 
> DOM with "xmlAddID", which make the XPointer work.  And then, I want to 
> make a C14n transform over the DOM, I can not get the correct result. 
> What alse must I do in order to get the correct C14n?

  XPointer id() is actually XPath id() and only works if you can assert
IDness of an attribute, and that requires a DTD per the spec. Trying to
make what you suggest would simply make the library not conformant to the
specifications. Sorry that's not possible. Use a different XPointer
expression not based on id().

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]