This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

why doesn't this do what i think it should?


Hi,

Why doesn't this do what I think it should?  Why is the result not
enclosed in <newaaa></newaaa>?  I am using TestXSLT from Xalan 1.0.

Thanks for your help.

Mike Case

XML:

<aaa>
  <bbb>
    <ccc>
    </ccc>
    <ccc>
    </ccc>
    <ccc>
    </ccc>
  </bbb>
  <bbb>
    <ccc>
    </ccc>
  </bbb>
  <bbb>
    <ccc>
    </ccc>
  </bbb>
  <lots-of-other-tags>
  </lots-of-other-tags>
</aaa>

XSLT:

<xsl:stylesheet
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns="http://www.w3.org/TR/xhtml1/strict" version="1.0">
<!-- 
It copies out the bbb's
-->
<newaaa>
<xsl:strip-space elements="*"/> 
<xsl:output method = "xml"/> 
<xsl:template match="los-of-other-tags"></xsl:template>
<xsl:template match="bbb">
<xsl:copy-of select="self::*"/>
<xsl:apply-templates/>
</xsl:template>
</newaaa>
</xsl:stylesheet>

What I get:

<?xml version="1.0" encoding="UTF-8"?>
  <bbb>
    <ccc>
    </ccc>
    <ccc>
    </ccc>
    <ccc>
    </ccc>
  </bbb>
  <bbb>
    <ccc>
    </ccc>
  </bbb>
  <bbb>
    <ccc>
    </ccc>
  </bbb>

-- 
Michael E. Case
UC Davis
case@ucdhep.ucdavis.edu
(530) 754-7226

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]