[Phoenix] Constraints on XML documents to work with Yulup (elaborated)

Thomas Comiotto comiotto at rcfmedia.ch
Sat Sep 23 00:14:14 CEST 2006


Hi Andi,

>
> This means that a document
>
> <foo xmlns="foo.org">
>   <bar/>
> </foo>
>
> is ruled out, and instead must look like
>
> <f:foo xmlns:f="foo.org">
>   <f:bar>
> </f:foo>
>

Nope,

<f:foo xmlns="foo.org" xmlns:f="foo.org">
   <bar/>
</foo>

is just fine and the most common case BTW (defining one default 
namespace and providing a prefix for it).
It's what we use @unizh and is supported by the current yulup 
implementation.

To recap: The xpath tripping began when you had a document that 
provided no prefix for the default namespace, and yulup can easily be 
fixed to provide support for *one* unprefixed default namespace 
(without even having to fall back to ns unaware mode).

But the solution you sketched out earlier (avoiding prefixes 
altogether) might solve it all. So go for it! Or at least give it a 
try....


>> The only problem one can run into with this approach is in situations
>> where the xpath expression becomes ambiguous when ignoring ns
>> information, i.e. a document that has
>> foo:table/foo:tr/xhtml:td/text()
>> xhtml:table/xhtml:tr/foo:td/text()
>> Never came across this, but it can't be ruled out either of course;)
>


Still, I do think we could live with those problems.

--
Bests
Thomas




More information about the Phoenix mailing list