Re: [xml] make XPointer( id(XX) ) and C14n work without DTD
- From: Andrew Fan <Andrew Fan Sun Com>
- To: veillard redhat com
- Cc: xml gnome org
- Subject: Re: [xml] make XPointer( id(XX) ) and C14n work without DTD
- Date: Wed, 25 Feb 2004 18:00:13 +0800
Hi Daniel,
I have make it work with a XPath, "<XPath>/test/content</XPath>". But I
worried about the performance if the file is big enough, such as 20M. I
think XPointer( id() ) have a good performance anyway. Would you please
give me some suggestion about how to improve performance of XPath?
Thanks & Regards,
Andrew
Daniel Veillard wrote:
On Tue, Feb 24, 2004 at 11:28:46AM +0800, Andrew Fan wrote:
Daniel Veillard wrote:
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>
</test>
-------------
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().
Which XPointer expression can I used to express the above URI? Thanks.
something like
/test/content[ Id='target']
or //content[ Id='target']
or //*[ Id='target']
depending on your language target which I have no idea for. You can
find XPath tutorials all over the web,
Daniel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]