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

attempting a preceding-sibling test with different cod

Subject: attempting a preceding-sibling test with different code
From: "Carrie Kaufman" <ckaufman01@xxxxxxxxxxx>
Date: Wed, 09 Oct 2002 19:31:46 -0400
parks.xsl
I am using msxml v2 (not by choice), and not having any luck learning a scripting language on the fly. As a result, I am attempting to produce the following: (Note: xsl:key, preceding-sibling, content(), etc. are not available in msxml v2 otherwise this would be a lot simpler). My code, as shown below does not produce any results. Am I using the context() property incorrectly?

xml:
<parks>
 <name>Shea<name>
  <field>
    <type>Grass<type>
    <maint>yes<maint>
  </field>
 <name>Turner<name>
  <field>
    <type>Turf<type>
    <maint>no<maint>
  </field>
 <name>Wrigley<name>
  <field>
    <type>grass<type>
    <maint>yes<maint>
  </field>
 <name>Bankone<name>
  <field>
    <type><type>
    <maint>no<maint>
  </field>
</parks>

xsl:
<DIV>
<xsl:for-each select="context()[. != '']" order-by="type">
  <xsl:choose>
    <xsl:when  test="context()[type != '']">
      <xsl:if test="type[text() != context(-2)/text()]">
        <xsl:value-of select="type"/>
      </xsl:if>
    </xsl:when>
    <xsl:otherwise>Unknown Type</xsl:otherwise>
  </xsl:choose>
</xsl:for-each>
  <DIV CLASS="pe2">
     <xsl:for-each select="name[. != '']">
       <xsl:value-of/>
         <BR/>
     </xsl:for-each>
  </DIV>
</DIV>


Intended Result: Grass Shea Wrigley

Turf
  Turner

Unknown Type
  Bankone

TIA, I can really use the help!
Carrie Kaufman
GIS Analyst
ckaufman01@xxxxxxxxxxx


_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com


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



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.