[Phoenix] Implementing support for XML documents with unprefixed
default namespaces
Thomas Comiotto
comiotto at rcfmedia.ch
Fri Sep 22 19:42:10 CEST 2006
Hi Andi
Am 22.09.2006 um 19:00 schrieb Thomas Comiotto:
> Hi
>>
>> The only drawback to this approach is that the XPath toolbar will
>> display location paths with strange prefixes (i.e, our generated
>> prefixes). The user might get confused by those because he can't see
>> them in the actual source.
>>
>>
I think there's one more thing to consider: the stylepatcher copies
nodeValue selectors that later make for location paths segments! This
means that location paths will contain prefixes as defined by the
stylesheet.
Besides that documentDOM is unaware of these prefixes (and therfore
xpath querys will fail) the stylesheet must resolve all default
namespaces to corresponding prefixes. So I think a cleaner approach
would be to copy over prefix resolvers from the stylesheet to the root
element of documentDOM (and to remove this data before sync'ing the
model) and in turn to pass these prefixes to the sourcetagger.
The sourcetagger would have to be extended to support default namespace
switching (inserting multiple prefixes to multiple default namespaces).
Currently it only supports one default namespace.
A.
<foo xmlns="foo.org">
<bar xmlns="bar.org"/>
</foo>
B.
<xsl:stylesheet xmlns:foo="foo.org" xmlns:bar="bar.org">
..
</xsl:stylesheet>
C.
<foo xmlns="foo.org* xmlns:foo="foo.org" xmlns:bar="bar.org">
<bar xmlns="bar.org"/>
</foo>
You see, there's a hell lot to consider - maybe we just should
implement ns unaware mode first. This will cover 99.9% of all documents
while keeping the code simple and clean :)
WDYT?
Thomas
--
Bests
Thomas
More information about the Phoenix
mailing list