Subject: Re: [xsl] removing namespaces From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Wed, 02 Apr 2008 01:35:01 +0200 |
I should have written "tiding up namespaces" instead of "removing" as I don't want to loose them. I just want to clean them up.
Maybe I am wrong but I thought that if the "method" element has the namespace "http://new.element", all child elements will belong to this namespace too. So there's no need to write the namespaces of the child elements to the output.
The namespaces are as you proposed defined in the stylesheet element on top of the stylesheet:
<xsl:stylesheet version="2.0" xmlns:srcml="http://srcml.de" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:srcml-new="http://new.element" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:meta="http://srcml.de/meta">
...
I don't really understand why the namespaces show up in the elements although they are declared on top of the stylesheet.
And I am wondering where the xmlns="" comes from. It would just look nicer if I could get rid of the namespaces in the elements. If I use the Syntax srcml-new:modifiers in the template instead of just "modifiers" there is still the complete srcml-new namespace definition in the output.It seems to me that the redeclaration of the default namespace to an empty namespace (the default of XML + NS) is not necessary in your case, but I haven't seen enough of your code to justify that statement. The reason that a serializer will redeclare the default namespace to the empty namespace can be one of ambiguity, or because you ask him to. Again, removing all the extra namespaces in your code (xsl:element and xsl:attribute) will make your code cleaner and probably removes this redundant declaration too.
Cheers, -- Abel Braaksma
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] removing namespaces, Garvin Riensche | Thread | Re: [xsl] removing namespaces, Garvin Riensche |
Re: [xsl] Counting occurences of a , Christian Roth | Date | Re: [xsl] Counting occurences of a , Dimitre Novatchev |
Month |