xsl-list
[Top] [All Lists]

[xsl] Matching attributes with namespace

2006-08-03 11:08:30
Hi List,

Thanks in advance for the help. I have a very simple transformation
that I can't seem to get right. The following is a shortened example.

XML

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../../media/xslt_2.xsl"?>
<act xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="../../media/ActSchema.xsd"
index="96001_01">
 <title>This is the <insert>title</insert></title>
</act>


XSL

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

<xsl:template match="/">
        <xsl:apply-templates/>
</xsl:template>

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


<xsl:template match="insert"><xsl:apply-templates/></xsl:template>

</xsl:stylesheet>


So basically just stripping out the insert element. Everything else
should stay the same. However my attributes on <act> get jumbled to:

OUTPUT

<?xml version='1.0' ?>
<?xml-stylesheet type="text/xsl" href="../../media/xslt_2.xsl"?>
<act index="96001_01"
xsi:noNamespaceSchemaLocation="../../media/ActSchema.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
 <title>This is the title</title>
</act>

and for whatever reason this is messing up other things in our
work-flow. Anyone have any ideas on how to make the <act> attributes
come out exactly as they are in the source document?

Thanks,

Spencer

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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