[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: copy-of problem in child node, unable to get parent in output
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Tue, 21 Oct 2003 21:18:11 +0200
> The purpose is to output only those ObjType and Attrribute elements
> where the ReleaseChanged tag = 7 or ReleaseIntroduced=7

This is done very easily by using the identity rule and overriding it with
empty rules only for "ObjType" and "Attrribute" elements, for which the
condition

         @ReleaseChanged = 7 or @ReleaseIntroduced = 7

is not true:


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

 <xsl:output omit-xml-declaration="yes"/>

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

  <xsl:template
    match="*[self::objType or self::Attribute]
                  [not(@ReleaseChanged = 7
                      or
                       @ReleaseIntroduced = 7
                       )
                   ] "/>
</xsl:stylesheet>


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL




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


Current Thread
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member