Re: [xsl] How to strip off all <xsd:annotation> ...</xsd.annotation> tags

Subject: Re: [xsl] How to strip off all <xsd:annotation> ...</xsd.annotation> tags
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Wed, 12 Aug 2009 14:25:15 +0200
Ben Stover schrieb:

Error on line 10 of stripannotationtags.xsl:
  XTDE0410: An attribute node (targetNamespace) cannot be created
  after the children of the containing element at xsl:apply-templates
  (file:/D:/xslt/Saxon/strip%20annotation%20tags/stripannotationtags.xsl#11)
     processing /xsd:schema/@targetNamespace
  in built-in template rule
Transformation failed: Run-time errors were reported

  <xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
     xmlns:xsd="http://www.w3.org/2001/XMLSchema";
     version="1.0">

<xsl:template match="xsd:annotation"/>

     <xsl:template match="@* | node()">
       <xsl:copy>
         <xsl:apply-templates select="@* | node()"/>
       </xsl:copy>
     </xsl:template>

</xsl:stylesheet>

Ben,


Martin's stylesheet module looks fool-proof to me. (By which I'm not
trying to imply that you're a a fool, of course.) Retry this on the
command line, it should just work:

java -jar saxon9.jar input.xsd stripannotationtags.xsl

And if it does, the error is in how you invoke your transformation.

--
Michael Ludwig

Current Thread