Thanks for the response.  <br><br>1. Is there a particular XSL list you refer to?<br><br>2. In our application, we process hundreds of thousands of SVG images. Individual teams are responsible for providing an stylesheet that produces a &#39;cleaned&#39; SVG; this is for space savings (we&#39;re talking on the order of 100 GB here, so a 50% reduction is a big deal).  To know that their stylesheets have not &#39;broken&#39; the SVG, the publishing process has an in-bult check for well-formedness, and validates against the SVG spec; those attributes do not prevent rendering, but they do prevent validation.  Which means we can not check that other errors are not present.<br>
<br>3. We use Saxon-EE, as that is what oXygen uses, and we wanted to deploy with the same.  So we&#39;ve licensed Saxon.<br><br>4. Ya, I originally had the SVG as an element, but that caused me some other grief I can&#39;t remember.<br>
<br>5. I&#39;m not an XSLT programmer, so this is not surprising, even though it is unfortunate.  All I can do is try something, see if it has a positive result (makes my output more like I want it), and go from there.  I&#39;ll study your changes, and try to incorporate them.<br>
<br>Thanks!<br><br><div class="gmail_quote">On Thu, Jun 23, 2011 at 2:16 PM, Syd Bauman <span dir="ltr">&lt;<a href="mailto:Syd_Bauman@brown.edu">Syd_Bauman@brown.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
1) This is probably more appropriate for the XSL-list than here. You<br>
   would likely find that if you followed the (stringent) posting<br>
   guidelines for that list, you&#39;d have your answer before you post.<br>
   At least, I usually do :-)<br>
<br>
2) Out of curiosity, why do you care? There is really no harm done<br>
   having extra namespace declarations on the SVG root element, is<br>
   there? (I agree it is ugly as sin, and often run the output of my<br>
   transforms through an editing step to strip &#39;em off:<br>
   $ saxon style.xslt in.xml | perl -pe &#39;s, xmlns:duck=&quot;<a href="http://www.example.org/ns/" target="_blank">http://www.example.org/ns/</a>&quot;,,;&#39; &gt; out.xml<br>
<br>
3) What processor are you using?<br>
<br>
4) I can take a crack at reducing the namespace declarations on the<br>
   output &lt;svg&gt; node by making it an explicit literal result element<br>
   instead of using &lt;copy&gt;. The i prefix is still there, though. (I<br>
   presume because it&#39;s tested for in the code). See below.<br>
<br>
5) This strikes me as very non-XSLT-like code, and very inefficient.<br>
   (You are testing every attribute, comment, or processing<br>
   instruction to see if it is in the sequence of every metadata,<br>
   switch, etc.)<br>
<br>
Here is a rewrite that takes care of all but 1 extra namespace, and I<br>
think does the same job in a clearer and more efficient manner:<br>
<br>
---------<br>
<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
<div class="im">&lt;xsl:stylesheet xmlns:xsl=&quot;<a href="http://www.w3.org/1999/XSL/Transform" target="_blank">http://www.w3.org/1999/XSL/Transform</a>&quot;<br>
  xmlns:xs=&quot;<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>&quot;<br>
  xmlns:xd=&quot;<a href="http://www.oxygenxml.com/ns/doc/xsl" target="_blank">http://www.oxygenxml.com/ns/doc/xsl</a>&quot;<br>
  xmlns:i=&quot;<a href="http://ns.adobe.com/AdobeIllustrator/10.0/" target="_blank">http://ns.adobe.com/AdobeIllustrator/10.0/</a>&quot;<br>
  xmlns:a=&quot;<a href="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" target="_blank">http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/</a>&quot;<br>
  xmlns:graph=&quot;<a href="http://ns.adobe.com/Graphs/1.0/" target="_blank">http://ns.adobe.com/Graphs/1.0/</a>&quot;<br>
  xmlns:x=&quot;<a href="http://ns.adobe.com/Extensibility/1.0/" target="_blank">http://ns.adobe.com/Extensibility/1.0/</a>&quot;<br>
  exclude-result-prefixes=&quot;xs xd a x graph&quot;<br>
  xpath-default-namespace=&quot;<a href="http://www.w3.org/2000/svg" target="_blank">http://www.w3.org/2000/svg</a>&quot;<br>
  version=&quot;2.0&quot;&gt;<br>
<br>
</div>  &lt;xsl:template match=&quot;/&quot;&gt;<br>
<div class="im">    &lt;svg xmlns=&quot;<a href="http://www.w3.org/2000/svg" target="_blank">http://www.w3.org/2000/svg</a>&quot;&gt;<br>
</div>      &lt;xsl:apply-templates select=&quot;svg/*&quot;/&gt;<br>
    &lt;/svg&gt;<br>
  &lt;/xsl:template&gt;<br>
<br>
  &lt;xsl:template match=&quot;*&quot;&gt;<br>
<div class="im">    &lt;xsl:copy&gt;<br>
      &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;<br>
    &lt;/xsl:copy&gt;<br>
</div>  &lt;/xsl:template&gt;<br>
  &lt;xsl:template match=&quot;comment()|processing-instruction()|text()&quot;&gt;<br>
    &lt;xsl:copy/&gt;<br>
  &lt;/xsl:template&gt;<br>
  &lt;xsl:template match=&quot;@*&quot;&gt;<br>
    &lt;xsl:if test=&quot;namespace-uri() ne<br>
    &#39;<a href="http://ns.adobe.com/AdobeIllustrator/10.0/" target="_blank">http://ns.adobe.com/AdobeIllustrator/10.0/</a>&#39;&quot;&gt;<br>
      &lt;xsl:copy/&gt;<br>
    &lt;/xsl:if&gt;<br>
  &lt;/xsl:template&gt;<br>
<br>
  &lt;xsl:template match=&quot;i:pgf | metadata | foreignObject&quot;/&gt;<br>
<br>
  &lt;xsl:template match=&quot;switch&quot;&gt;<br>
<div class="im">    &lt;xsl:apply-templates select=&quot;node()&quot;/&gt;<br>
</div>  &lt;/xsl:template&gt;<br>
<br>
&lt;/xsl:stylesheet&gt;<br>
---------<br>
<br>
HTH.<br>
<div><div></div><div class="h5"><br>
&gt; I&#39;m applying a transform to SVG documents, to make them validate<br>
&gt; against the SVG RNG schema. I have everything working EXCEPT the<br>
&gt; name spaces on the SVG element itself. These SVG documents where<br>
&gt; edited in Adobe Illistrator, and the original SVG element is:<br>
&gt;<br>
&gt; &lt;svg xmlns=&quot;<a href="http://www.w3.org/2000/svg" target="_blank">http://www.w3.org/2000/svg</a>&quot; xmlns:a=&quot;<br>
&gt; <a href="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" target="_blank">http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/</a>&quot; xmlns:graph=&quot;<br>
&gt; <a href="http://ns.adobe.com/Graphs/1.0/" target="_blank">http://ns.adobe.com/Graphs/1.0/</a>&quot; xmlns:i=&quot;<br>
&gt; <a href="http://ns.adobe.com/AdobeIllustrator/10.0/" target="_blank">http://ns.adobe.com/AdobeIllustrator/10.0/</a>&quot; xmlns:x=&quot;<br>
&gt; <a href="http://ns.adobe.com/Extensibility/1.0/" target="_blank">http://ns.adobe.com/Extensibility/1.0/</a>&quot; xmlns:xlink=&quot;<br>
&gt; <a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot;&gt;<br>
&gt;<br>
&gt; and what I want is:<br>
&gt;<br>
&gt; &lt;svg xmlns=&quot;<a href="http://www.w3.org/2000/svg" target="_blank">http://www.w3.org/2000/svg</a>&quot; xmlns:xlink=&quot;<br>
&gt; <a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>&quot;&gt;<br>
&gt;<br>
&gt; The stylesheet starts:<br>
&gt; &lt;xsl:stylesheet xmlns:xsl=&quot;<a href="http://www.w3.org/1999/XSL/Transform" target="_blank">http://www.w3.org/1999/XSL/Transform</a>&quot;<br>
&gt;     xmlns:xs=&quot;<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>&quot;<br>
&gt;     xmlns:xd=&quot;<a href="http://www.oxygenxml.com/ns/doc/xsl" target="_blank">http://www.oxygenxml.com/ns/doc/xsl</a>&quot;<br>
&gt;     xmlns:i=&quot;<a href="http://ns.adobe.com/AdobeIllustrator/10.0/" target="_blank">http://ns.adobe.com/AdobeIllustrator/10.0/</a>&quot;<br>
&gt;     xmlns:a=&quot;<a href="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" target="_blank">http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/</a>&quot;<br>
&gt;     xmlns:graph=&quot;<a href="http://ns.adobe.com/Graphs/1.0/" target="_blank">http://ns.adobe.com/Graphs/1.0/</a>&quot;<br>
&gt;     xmlns:x=&quot;<a href="http://ns.adobe.com/Extensibility/1.0/" target="_blank">http://ns.adobe.com/Extensibility/1.0/</a>&quot;<br>
&gt;     exclude-result-prefixes=&quot;xs xd a x graph&quot;<br>
&gt;     xpath-default-namespace=&quot;<a href="http://www.w3.org/2000/svg" target="_blank">http://www.w3.org/2000/svg</a>&quot;<br>
&gt;     version=&quot;2.0&quot;&gt;<br>
&gt;<br>
&gt; My understanding is that &#39;exclude-result-prefixes=&quot;xs xd a x<br>
&gt; graph&quot;&#39; should not copy over the namespaces identified, but a, x,<br>
&gt; and graph are still there in the output. My main template is below,<br>
&gt; and it keeps the namespace &amp; extensions off of the child elements<br>
&gt; of SVG, just not the SVG node itself.<br>
&gt;<br>
&gt;    &lt;xsl:template match=&quot;@*|node()&quot;&gt;<br>
&gt;       &lt;xsl:choose&gt;<br>
&gt;          &lt;xsl:when test=&quot;. = //i:pgf&quot;/&gt; &lt;!-- This is the BLOB --&gt;<br>
&gt;          &lt;xsl:when test=&quot;. = //@i:*&quot; /&gt; &lt;!-- These three are all of the<br>
&gt; Adobe extensions --&gt;<br>
&gt;          &lt;xsl:when test=&quot;. = //metadata&quot;/&gt;<br>
&gt;          &lt;xsl:when test=&quot;. = //foreignObject&quot;/&gt;<br>
&gt;          &lt;xsl:when test=&quot;. = //switch&quot;&gt; &lt;!-- We do not want the switch<br>
&gt; elements, just their text nodes. --&gt;<br>
&gt;             &lt;xsl:apply-templates select=&quot;node()&quot;/&gt;<br>
&gt;          &lt;/xsl:when&gt;<br>
&gt;          &lt;xsl:otherwise&gt;<br>
&gt;             &lt;xsl:copy&gt;<br>
&gt;                &lt;xsl:apply-templates select=&quot;@*|node()&quot;/&gt;<br>
&gt;             &lt;/xsl:copy&gt;<br>
&gt;          &lt;/xsl:otherwise&gt;<br>
&gt;       &lt;/xsl:choose&gt;<br>
&gt;    &lt;/xsl:template&gt;<br>
&gt;<br>
&gt; Any ideas?<br>
</div></div>_______________________________________________<br>
oXygen-user mailing list<br>
<a href="mailto:oXygen-user@oxygenxml.com">oXygen-user@oxygenxml.com</a><br>
<a href="http://www.oxygenxml.com/mailman/listinfo/oxygen-user" target="_blank">http://www.oxygenxml.com/mailman/listinfo/oxygen-user</a><br>
</blockquote></div><br>