RE: More checked into CVS

> To use the namespaces in my XPath, I use (not regarding any namespace
> policy):
> <xsl:stylesheet... xmlns:moki="http://moki.mobi/2007/
> v0.1" ...xmlns="http://moki.mobi/2007/v0.1">
> to use XPath like:
> /moki:moki//moki:docContent
> 

But if you say xmlns="http://moki.mobi/2007/v0.1" in you stylesheet, you don't need to use the prefix when selecting moki elements, providing there is a similar namespace declaration at the root of the moki doc, or am I missing the point?

(<moki xmlns="http://moki.mobi/2007/v0.1" ...)

> But is there an issue with the _real_ document namespaces?
> In this example, the document has an empty namespace:
> <docContent>
>    <html xmlns="">
>    ...
> What if the document uses different/other namespaces?
> 

Oops, it should say <html xmlns="http://www.w3.org/1999/xhtml"> I just noticed that the example moki doc from before has <html xmlns=""> which is wrong.

So providing the html is namespaced properly and the stylesheet says something like

<xsl:stylesheet... xmlns="http://moki.mobi/2007/v0.1" xmlns:html="http://www.w3.org/1999/xhtml">


then the XPath expression //primaryDoc//html:html should select the content of the primary document ...

... with regard to the following:
 
> Should we always use 'namespace-safe' XPath (//*[local-name() =
> 'html'])?
> Should namespaces be removed by the 'moki doc generator' inside the
> docContent?
> 
No, I don't think so, [though I often do this :-)], because in theory at least, your document might contain content with an html element from another namespace ... more important of course if you are looking at an element like head which is used in lots of namespaces.

Jo

> -----Original Message-----
> From: Roland Gülle [mailto:roland@7val.com]
> Sent: 15 May 2007 10:53
> To: Jo Rabin
> Cc: public-mobileok-checker@w3.org
> Subject: Re: More checked into CVS
> 
> >> <xsl:stylesheet version="1.0"
> >>                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >>
> >> 	xmlns:xmlns="http://moki.mobi/2007/v0.1">
> >
> > Shouldn't we actually be setting the default namespace by
> >
> > xmlns="http://moki.mobi/2007/v0.1" rather than by
> > xmlns:xmlns="http://moki.mobi/2007/v0.1"?
> OK, to generate this as output namespace works, but using this in my
> XPath will not work.
> 
> To use the namespaces in my XPath, I use (not regarding any namespace
> policy):
> <xsl:stylesheet... xmlns:moki="http://moki.mobi/2007/
> v0.1" ...xmlns="http://moki.mobi/2007/v0.1">
> to use XPath like:
> /moki:moki//moki:docContent
> 
> But is there an issue with the _real_ document namespaces?
> In this example, the document has an empty namespace:
> <docContent>
>    <html xmlns="">
>    ...
> What if the document uses different/other namespaces?
> 
> Should we always use 'namespace-safe' XPath (//*[local-name() =
> 'html'])?
> Should namespaces be removed by the 'moki doc generator' inside the
> docContent?
> 
>   roland

Received on Tuesday, 15 May 2007 10:33:29 UTC