Re: [xml] Adding pre-defined namespaces



On Mon, Oct 03, 2005 at 12:45:33AM -0700, Eric Seidel wrote:
Are there any ways when using an xml SAX2 push parser, to push a  
couple "predefined" namespaces on the namespace lookup stack before  
beginning the parse?

  I don't think it is possible with public APIs, but the parser
structures are open...

For example, some SVGs incorrectly use the xlink prefix w/o first  
defining it.  We would (unfortunately) like to support those SVGs.   

  They are well formed XML-1.0 documents. But you will get namespace
errors. I can't be sympathetic to supporting broken document, sorry...

Another example is when parsing document fragments for things such as  
setInnerHTML in an xhtml context...  There we need to build up a  
"namespace stack" representing the current document context before  
doing the actual parse.

  I don't understand, either it's XHTML in which case it is XML
and an XML parser should work or it's not. Trying to parse XML island
in non well-formed XML'like HTML opens the door to so many error case
that loosing the namespace sounds just liek a small side effect.

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]