RE: [xsl] tags missing in output

Subject: RE: [xsl] tags missing in output
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Thu, 13 Aug 2009 22:51:46 +0100
Your template rule

<xsl:template match="*" mode="step1">
<xsl:copy-of select="*" />
</xsl:template>

says "copy the children, but don't copy this". Perhaps you wanted
<xsl:copy-of select="." />

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 
 

> -----Original Message-----
> From: Dick Penny [mailto:d_penny@xxxxxxx] 
> Sent: 13 August 2009 22:35
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] tags missing in output
> 
> My input
> ====================
> <dsQueryResponse>
>   <Rows>
>     <Row GroupAssigned="CRA" Source="Other" Status="TBD" 
> FW="14" FM="JUL"
> FQ="2" FY="10" />
>     <Row GroupAssigned="HR" Source="Other" Status="Accept" 
> FW="14" FM="JUL"
> FQ="2" FY="10" />
>     <Row GroupAssigned="CRA" Source="EC_MailBox" 
> Status="Accept" FW="9"
> FM="JUN" FQ="1" FY="10" />
>     <Row GroupAssigned="CRA" Source="EC_MailBox" Status="TBD" 
> FW="9" FM="JUN"
> FQ="1" FY="10" />
>     <Row GroupAssigned="HR" Source="EC_MailBox" Status="Accept" FW="9"
> FM="JUN" FQ="1" FY="10" />
>     <Row GroupAssigned="CRA" Source="Other" 
> Status="VettedOut" FW="9" FM="JUN"
> FQ="1" FY="10" />
>     <Row GroupAssigned="CRA" Source="EC_MailBox" 
> Status="Accept" FW="12"
> FM="JUN" FQ="1" FY="10" />
>     <Row GroupAssigned="HR" Source="Other" Status="Accept" 
> FW="9" FM="JUN"
> FQ="1" FY="10" />
>     <Row GroupAssigned="CRA" Source="Other" Status="Accept" 
> FW="9" FM="JUN"
> FQ="1" FY="10" />
>     <Row GroupAssigned="CRA" Source="EC_MailBox" 
> Status="VettedOut" FW="9"
> FM="JUN" FQ="1" FY="10" />
>     <Row GroupAssigned="CRA" Source="AltertLine" 
> Status="Accept" FW="9"
> FM="JUN" FQ="1" FY="10" />
>     <Row GroupAssigned="HR" Source="AltertLine" 
> Status="VettedOut" FW="9"
> FM="JUN" FQ="1" FY="10" />
>     <Row GroupAssigned="Legal" Source="EC_MailBox" 
> Status="VettedOut" FW="9"
> FM="JUN" FQ="1" FY="10" />
>     <Row GroupAssigned="Legal" Source="Other" Status="Accept" 
> FW="9" FM="JUN"
> FQ="1" FY="10" />
>   </Rows>
> </dsQueryResponse>
> =====================
> 
> My XSLT
> =================================
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>                        
> xmlns:msxsl="urn:schemas-microsoft-com:xslt" > <xsl:output 
> method="xml" version="1.0" encoding="UTF-8" indent="yes" />
> 
> <xsl:template match="/">
> <xsl:variable name="step1out" >
> <xsl:apply-templates select="*" mode="step1" /> 
> </xsl:variable> <xsl:apply-templates 
> select="msxsl:node-set($step1out)" mode="show-all" /> </xsl:template>
> 
> <xsl:template match="*" mode="step1">
> <xsl:copy-of select="*" />
> </xsl:template>
> 
> <xsl:template match="*" mode="show-all"> <xmp><xsl:copy-of 
> select="*" /></xmp> </xsl:template> </xsl:stylesheet> 
> =====================================
> 
> My output by running above in XML NotePad 2007 
> ===========================================
> <Row GroupAssigned="CRA" Source="Other" Status="TBD" FW="14" 
> FM="JUL" FQ="2"
> FY="10" />
>   <Row GroupAssigned="HR" Source="Other" Status="Accept" 
> FW="14" FM="JUL"
> FQ="2" FY="10" />
>   <Row GroupAssigned="CRA" Source="EC_MailBox" 
> Status="Accept" FW="9" FM="JUN"
> FQ="1" FY="10" />
>   <Row GroupAssigned="CRA" Source="EC_MailBox" Status="TBD" 
> FW="9" FM="JUN"
> FQ="1" FY="10" />
>   <Row GroupAssigned="HR" Source="EC_MailBox" Status="Accept" 
> FW="9" FM="JUN"
> FQ="1" FY="10" />
>   <Row GroupAssigned="CRA" Source="Other" Status="VettedOut" 
> FW="9" FM="JUN"
> FQ="1" FY="10" />
>   <Row GroupAssigned="CRA" Source="EC_MailBox" Status="Accept" FW="12"
> FM="JUN" FQ="1" FY="10" />
>   <Row GroupAssigned="HR" Source="Other" Status="Accept" 
> FW="9" FM="JUN"
> FQ="1" FY="10" />
>   <Row GroupAssigned="CRA" Source="Other" Status="Accept" 
> FW="9" FM="JUN"
> FQ="1" FY="10" />
>   <Row GroupAssigned="CRA" Source="EC_MailBox" 
> Status="VettedOut" FW="9"
> FM="JUN" FQ="1" FY="10" />
>   <Row GroupAssigned="CRA" Source="AltertLine" 
> Status="Accept" FW="9" FM="JUN"
> FQ="1" FY="10" />
>   <Row GroupAssigned="HR" Source="AltertLine" 
> Status="VettedOut" FW="9"
> FM="JUN" FQ="1" FY="10" />
>   <Row GroupAssigned="Legal" Source="EC_MailBox" 
> Status="VettedOut" FW="9"
> FM="JUN" FQ="1" FY="10" />
>   <Row GroupAssigned="Legal" Source="Other" Status="Accept" 
> FW="9" FM="JUN"
> FQ="1" FY="10" />
> ================================
> 
> My question
> ==================
> I am trying to learn "step-wise" transformations, thus my 
> first example is to do nothing.
> What happened to the two missing element levels <dsQueryResponse>
>   <Rows>
> I am expecting to see them.
> ===================
> 
> Dick Penny

Current Thread