Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Where are these pesky and superfluous xmlns="" coming from?

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 8/6/2008 1:21:00 PM

Siegfried Heintze wrote:

> Here is a fragment of my xsl file:
>   <xsl:template match="key">
>      <Rectangle RadiusX="3" RadiusY="3" Stroke="#FFFF0000" 
> StrokeMiterLimit="4" Canvas.Left="{outline/@x}" Canvas.Top="{outline/@y}" 
> Width="{outline/@width}" Height="{outline/@height}"  StrokeThickness="1" 
> ToolTip="row:{@row} position:{@position} id:{@id} scan:{@scan}" />
>   </xsl:template>

That template creates an 'Rectangle' element in no namespace.

> Here is a fragment of the output:
> <Rectangle RadiusX="3" RadiusY="3" Stroke="#FFFF0000" StrokeMiterLimit="4" 
> Canvas.Left="249.9690" Canvas.Top="419.7360" Width="34.2310" 
> Height="34.2180" StrokeThickness="1" ToolTip="row:1 position:1 id:esc 
> scan:110" xmlns="" />
> 
> Where is this 'xmlns=""' coming from! 


You seem to insert that 'Rectangle' element into a parent element in a 
namespace and to ensure it has no namespace the serializer adds the 
xmlns="".

> How do I surpress it? 


You probably want
   <xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     version="1.0"
     xmlns="putNamespaceURIHere">
where you put the proper namespace URI you want for (all) your result 
elements in there.

Or you need to use

   <xsl:template match="key">
      <Rectangle xmlns="putNamespaceURIHere" RadiusX="3" RadiusY="3" 
Stroke="#FFFF0000"
StrokeMiterLimit="4" Canvas.Left="{outline/@x}" Canvas.Top="{outline/@y}"
Width="{outline/@width}" Height="{outline/@height}"  StrokeThickness="1"
ToolTip="row:{@row} position:{@position} id:{@id} scan:{@scan}" />
   </xsl:template>


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent