xsl-list
[Top] [All Lists]

Re: removing xml child element

2003-03-07 14:50:01
Miguel,

create a identity template then add a template to match 'Shear' that does nothing.

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

<xsl:output method="xml"/>

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

  <xsl:template match="Shear">
    <!-- do nothing -->
  </xsl:template>

</xsl:stylesheet>

At 03:54 PM 3/7/03 -0500, you wrote:


I now this might seem simple but this is my first attempt in xslt
and I having problems finding an example in deleting a child element

here is my xml example:

<MTSScene Version="311" >
<MTSSceneParms RenderMode="LightTexture" BlendShadow="1" EdgeBias="1" />
        <MTSCamera OrbitDist="4" >
                <Rotate x="20.62647"  y="-16.04278"  z="0" />
                <ViewLocation x="0"  y="0"  z="4" />
        </MTSCamera>
        <MTSInstance Name="Simple_0" >
                <Transform>
                        <Scale x="0.64708"  y="0.74812"  z="0.93365" />
                        <Shear xy="0"  yz="-0"  xz="-0" />
                        <Rotate x="-2.25967"  y="-2.21257"  z="64.06983" />
                        <Position x="0"  y="-0.38"  z="0" />
                </Transform>
<MTSGeometry Name="MTSSimple_0" MultiUV="0" Type="MTSBox" />
        </MTSInstance>
</MTSScene>


I would like remove the child element <shear> and all its attribute

thanks
Miguel

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus


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

Rick Taylor
XML Developer
PPDM Association


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



<Prev in Thread] Current Thread [Next in Thread>