OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Unwanted xmlns="" inserted by xsl-ns customization layer


On Monday, November 04, 2013 06:35:06 PM Jon Leech wrote:
> On 11/04/2013 05:49 PM, Jon Leech wrote:
> >      This does output the <script> tags when put through xsltproc (and
> >      also
> > 
> > echoes part of the generated document to stdout for reasons I'm unclear
> > on,
> > but that's a separate weird thing). The problem is that it also adds an
> 
> > unwanted xmlns="" attribute in the output elements:
>      Partly answering my own question: after some semi-guesswork
> pattern-matching I discovered that if I add
>       xmlns="http://www.w3.org/1999/xhtml";
> to the <script> elements in my test.xsl, the generated <script>
> elements have no namespace. I even sort of understand
> why this happens now.
>      Still no idea why xsltproc is echoing part of my generated
> .xhtml file to stdout, though. I assume something in the stylesheet
> is actually responsible for this.

Not exactly. The namespaces in XML are identified by URI, not by prefix. In 
other words, the same prefix (an empty prefix in your case) can refer to 
different URIs in different XML documents.

Thus, the stylesheet you're customizing declares empty (default) namespace 
prefix to point to http://www.w3.org/1999/xhtml URI. When you add a 
customization layer, you didn't specify the prefix for the default namespace, 
so XSLT processor assumed the <script/> element belongs to a namespace with no 
URI. As its parent element had default namespace pointing to a different URI, 
it redeclared the default namespace for <script/> to an empty string.

You can add the xmlns="http://www.w3.org/1999/xhtml"; declaration to the 
<xsl:stylesheet/> element in your customization layer to avoid declaring it on 
each element.

Regards,
Alexey.

>      Jon Leech
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]