xsl-list
[Top] [All Lists]

RE: [xsl] tags missing in output

2009-08-13 17:52:21

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(_at_)usa(_dot_)net] 
Sent: 13 August 2009 22:35
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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



--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>