Prefix mappings for default namespaces
Elliotte Rusty Harold <[email protected]>
| Newsgroups | gmane.text.xml.sax.devel |
|---|---|
| Message-ID | <p04330104b9e57e89c921@[192.168.254.4]> |
As near as I can tell, the SAX documentation does not address the
question of whether the default namespace mapping is reported through
startPrefixMapping and endPrefixMapping. I've seen different behavior
from different processors and even different behavior within the same
processor. I think this needs to be spelled out. I am not sure what
is more commonly done by current processors (report the empty prefix
mapping or not, and report the prefix as an empty string or null).
Normally, this doesn't matter. Knowing the default namespace for the
element is sufficient. HOwever, I've run across one case where it
does matter; specifically, when the default namespace is remapped to
nothing on a prefixed element; for example:
<root xmlns="http://www.example.com">
<pre:foo xmlns:pre="http://www.example.org/" xmlns="">
more content...
</pre:foo>
</root>
To allow this case to be properly handled I think the default
namespace mapping does need to be reported through
startPrefixMapping/endPrefixMapping. Although this is a little weird,
it is necessary to fully support XSLT, and probably other use cases.
--
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | [email protected] | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| XML in a Nutshell, 2nd Edition (O'Reilly, 2002) |
| http://www.cafeconleche.org/books/xian2/ |
| http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
List: sax-devel, [email protected]
See: http://www.saxproject.org/
https://lists.sourceforge.net/lists/listinfo/sax-devel