You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2002/06/07 14:26:35 UTC

Namespace attributes in XSL output

I'm having problems with empty namespace attributes 
being added into my output tags:

A tag which is generated via a call to a named template will 
insert xmlns="" into the tag; which causes that tag to be ignored.

For example, a call in a stylesheet with:

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:svg="http://www.w3.org/2000/svg"
  >

<xsl:call-template name="setSeriesMarker">
...

<xsl:template name="setSeriesMarker">
<svg:defs> ... </svg:defs>
...

Results in output of:

<svg:defs xmlns=""> ...  </svg:defs>

and as a consequence the elements defined in the "defs" are ignored...
if I manually strip away this extra attribute, its OK!

Has anyone an idea how to supress this - is it an XSL or Cocoon issue?

Thanks
Derek


PS The same thing happens when I import elements from an external
file:

<xsl:copy-of select="document(mydefs.xml')/svg/svg:defs"/>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Namespace attributes in XSL output

Posted by Stephan Michels <st...@vern.chem.tu-berlin.de>.

On Fri, 7 Jun 2002, Derek Hohls wrote:

> I'm having problems with empty namespace attributes
> being added into my output tags:
>
> A tag which is generated via a call to a named template will
> insert xmlns="" into the tag; which causes that tag to be ignored.
>
> For example, a call in a stylesheet with:
>
> <xsl:stylesheet version="1.0"
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>   xmlns:svg="http://www.w3.org/2000/svg"
>   >
>
> <xsl:call-template name="setSeriesMarker">
> ...
>
> <xsl:template name="setSeriesMarker">
> <svg:defs> ... </svg:defs>
> ...

Try this  ...

<xsl:template name="setSeriesMarker">
<defs xmlns="www.w3.org/...."> ... </defs>
 ...


>
> Results in output of:
>
> <svg:defs xmlns=""> ...  </svg:defs>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Namespace attributes in XSL output

Posted by Luca Morandini <lu...@tin.it>.
Derek,

not sure, but try adding:

exclude-result-prefixes="svg"

in your <xsl:stylehseet> (or <xsl:transform>) element.

Best regards,


--------------------------------------------- 
               Luca Morandini 
               GIS Consultant 
              lmorandini@ieee.org 
http://utenti.tripod.it/lmorandini/index.html 
---------------------------------------------
 

> -----Original Message-----
> From: Derek Hohls [mailto:DHohls@csir.co.za]
> Sent: Friday, June 07, 2002 2:27 PM
> To: cocoon-users@xml.apache.org
> Subject: Namespace attributes in XSL output
> 
> 
> I'm having problems with empty namespace attributes 
> being added into my output tags:
> 
> A tag which is generated via a call to a named template will 
> insert xmlns="" into the tag; which causes that tag to be ignored.
> 
> For example, a call in a stylesheet with:
> 
> <xsl:stylesheet version="1.0"
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>   xmlns:svg="http://www.w3.org/2000/svg"
>   >
> 
> <xsl:call-template name="setSeriesMarker">
> ...
> 
> <xsl:template name="setSeriesMarker">
> <svg:defs> ... </svg:defs>
> ...
> 
> Results in output of:
> 
> <svg:defs xmlns=""> ...  </svg:defs>
> 
> and as a consequence the elements defined in the "defs" are ignored...
> if I manually strip away this extra attribute, its OK!
> 
> Has anyone an idea how to supress this - is it an XSL or Cocoon issue?
> 
> Thanks
> Derek
> 
> 
> PS The same thing happens when I import elements from an external
> file:
> 
> <xsl:copy-of select="document(mydefs.xml')/svg/svg:defs"/>
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>