This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

XSL Copy


Hi,

I have the following XML

<?xml version="1.0" ?>
<results>
  <timeSeriesDetail>
  <timeSeries>
  	<timeSeriesType>Equity</timeSeriesType>
  	<timeSeriesKey>DAX</timeSeriesKey>
  </timeSeries>
  <obs>
  <date>19990817</date>
  <level>5324.02</level>
  <return>0</return>
  </obs>
  <timeSeriesDetail>
  <timeSeriesDetail>
  <timeSeries>
  	<timeSeriesType>Equity</timeSeriesType>
  	<timeSeriesKey>CAC40</timeSeriesKey>
  </timeSeries>
  <obs>
  <date>19990817</date>
  <level>124.02</level>
  <return>2</return>
  </obs>
  <timeSeriesDetail>
<results>

I want to be able to get the timeSeriesDetail node for DAX. I am using the
following XSL

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
  <xsl:param name="tsType" select="Equity"/>
  <xsl:param name="tsName" select="DAX"/>

  <xsl:template match="//timeSeriesDetail/timeSeries[timeSeriesType=$tsType
and timeSeriesKey=$tsName]">
      <xsl:copy>
       	<xsl:apply-templates select="*|@*|text()"/>
      </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

However, when I run this the tag names are stripped off from the output and
I only get the node contents. What am I doing wrong?

Thx,

Carlos Sanchez
RiskMetrics


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]