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

Variables in XSLT

Subject: Variables in XSLT
From: "Paul Delange" <Paul.Delange@xxxxxxx>
Date: Fri, 27 Jan 2006 10:43:56 -0500
stylus studio 2006 crack
Hi All,

Sorry for a newbie question, I'm an very experienced programming taking my
first crack at an XSLT program.

Essentially I need to extract the www.this_is_the_desired_url.com data from
the XML below.


        <VNDR_LOC_SCROL class="R">
          <VENDOR_LOC class="R">
            <VNDR_LOC IsChanged="Y">1</VNDR_LOC>
            <VNDR_URL class="R">
              <EFFDT IsChanged="Y">2006-01-26</EFFDT>
              <LINE_NBR IsChanged="Y">1</LINE_NBR>
              <URL IsChanged="Y">www.this_is_the_desired_url.com</URL>
            </VNDR_URL>
            <VNDR_URL class="R">
              <EFFDT IsChanged="Y">2006-01-26</EFFDT>
              <LINE_NBR IsChanged="Y">2</LINE_NBR>
              <URL IsChanged="Y">www.this_is_an_unwanted_url.com</URL>
            </VNDR_URL>
          </VENDOR_LOC>
          <VENDOR_LOC class="R">
            <VNDR_LOC IsChanged="Y">1</VNDR_LOC>
            <VNDR_URL class="R">
              <EFFDT IsChanged="Y">1901-01-01</EFFDT>
              <LINE_NBR IsChanged="Y">1</LINE_NBR>
              <URL IsChanged="Y">www.this_is_another_unwanted_url.com</URL>
            </VNDR_URL>
          </VENDOR_LOC>
        </VNDR_LOC_SCROL>

The deciding factors in selecting that <URL> tag over the other's are;
- It has maximum effective date (<EFFDT> = 2006-01-26)
- It's effective date does not exceed the current date.
- It is the first url (<LINE_NBR> = 1) on that date. (This should be a
simple <xsl:if test="LINE_NBR" = '1'">)

With my conventional programming background, I want to define a $maxeffdt
variable BEFORE I call the template below and this do some kind of <xsl:if
test="EFFDT = $maxeffdt> but I'm not sure this is doable/appropriate in the
new XSLT world.

My current code looks like this;

<xsl:template match="VENDOR_LOC">
   <xsl:if test="VNDR_LOC = ../../DEFAULT_LOC">          <--Eliminates
non-default locations not shown above
      <C3><xsl:value-of select="VNDR_LOC" /></C3>
      <HOMEPAGE><xsl:value-of select="VNDR_URL/URL" /></HOMEPAGE>
   </xsl:if>
</xsl:template>

Can someone point me in the right direction with appropriateness/syntax?
FYI, I am using a PeopleSoft Application Engine program to transform my
data.

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.