[xml] XML Base

Date view Thread view Subject view Author view

From: TOM (ptittom@free.fr)
Date: Tue Oct 24 2000 - 08:19:37 EDT


Hi,
While coding the document() XSLT function I thought about XML Base. So I
wonder how to implement it.
 - xml:base is just one attribute between others. But when we want the
base URI of an element, we must go through all of it's parents and for
each of them go through their attributes (and the through their names into
xmlStrEqual()).
 - add an xmlBase element to xmlNode. While parsing the file, if we find
an xml:base attribute, we add the attribute, as before, and we make
node->xmlBase point to the value of the attribute (no need to xmlStrdup()
this value). If the element parsed has no xml:base attribute, make
node->xmlBase NULL. If we want to retrieve the base URI of an element, we go
through all its parents until xmlBase!=NULL but we don't need to search for
the xml:base attribute.

With the first method (that's what we must do for now) we gain memory
but we loose time, with the second it's the contrary.
What would be the best ?

For now we don't really need to change anything since document() isn't
much used in XSLT (I guess) and there isn't yet XLink implementation in
libxml. But when we'll have XLink perhaps it'll be better to save time than
space in memory.

We can have an xmlNodeGetBase() or xmlNodeGetBaseURI() function that
we'll change implementation when we decide to add something to the xmlNode
struct. There will be nothing to change then in parts that use XML Base
and this function.

Any remark ?

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Oct 24 2000 - 13:43:37 EDT