[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl variable/param question

Subject: xsl variable/param question
From: Arian <armyofda12mnkeys@xxxxxxxxx>
Date: Tue, 25 May 2010 10:25:57 -0400
 xsl variable/param question
So i have an xml file exported from Excel with this structure:
<Row>
  <Cell><Data>John Doe Elementary School</Data></Cell>
  <Cell><Data>321-123-1234</Data></Cell>
  <Cell><Data>123 Cool Rd.</Data></Cell>
  <Cell><Data>Suite 101</Data></Cell>
  <Cell><Data>Mesa</Data></Cell>
  <Cell><Data>AZ</Data></Cell>
  <Cell><Data>85203</Data></Cell>
</Row>

and when I loop each Row... I'd like to output via xsl:message the
state IF its different than the previous one... I was going to use
this output to make sure my html drop down I was creating to unhide
and show the location divs I'm creating for each Row was updated, but
create the drop down manually now since Im not sure how to save and
compare the state value for each loop.

My basic xsl looks like following

  <xsl:template match="/">
    <html><body>
      <xsl:apply-templates select="//Row"/>
    </body></html>
  </xsl:template>

  <xsl:template match="Row">

    <xsl:message><xsl:value-of select="Cell[6]/Data"/></xsl:message>
    <div>
      <xsl:attribute name="class">location <xsl:value-of
select="Cell[6]/Data"/></xsl:attribute>
      <b><xsl:value-of select="Cell[1]/Data"/></b><br/>
      <xsl:value-of select="Cell[2]/Data"/><br/>
      <xsl:value-of select="Cell[3]/Data"/><xsl:if
test="normalize-space(Cell[4]/Data) != ''">, <xsl:value-of
select="Cell[4]/Data"/></xsl:if><br/>
      <xsl:value-of select="Cell[5]/Data"/>, <xsl:value-of
select="Cell[6]/Data"/>, <xsl:value-of select="Cell[7]/Data"/><br/>
    </div>
  </xsl:template>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.