Re: [xml] setting URL for xmlRelaxNGParserCtxt?



On Wed, Jan 26, 2005 at 12:07:50AM +0100, Martijn Faassen wrote:
Daniel Veillard wrote:
 no the base has to be set in the document. Since that part is just
described by '...' in your mail there is little more indications I can
provide.

Interesting. This is how a doc typically get parsed now:

pctxt = xmlNewParserCtxt()
.. (share dictionaries)
result = xmlCtxtReadFile(pctxt, filename,
                                   NULL, _getParseOptions())

   Okay, looks good.
One note though, I'm using dictionnaries more and more intensively those
days, so keeping a single dictionnary for everything, while it clearly
speed-up processing may grow quite a bit for example as you process random
documents. It might be a good idea to "sometimes" reset the dictionnary
to avoid explosion, for example for all the ID strings ever processed 
by the program.

the other approach is to create a doc with xmlNewDoc().

  Okay then use xmlNodeSetBase() there if you need to make URI-References
from them.

Thinking it through, it's quite possible that I often have a node being 
passed from a doc that's parsed into a doc that's created with 
xmlNewDoc(). I will investigate whether that happens here, and whether I 
can pass along the URL somehow when it happens.

  Doesn't sound trivial...

Good, good. I have an idea of what to do to fix the issue. Thanks for 
the hints and my apologies for the misunderstanding.

  No problem :-)

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://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]