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

Re: How can i convert the variable value into xpath

Subject: Re: How can i convert the variable value into xpath
From: Mike Ferrando <mikeferrando@xxxxxxxxx>
Date: Mon, 11 Mar 2002 12:20:51 -0800 (PST)
can ferrando
Mike B.,
Thanks alot! that is exactly what I needed. I decided that using
documents was alot better than using prefixed tags (below). I have
created these bogus examples to see how I can write just this one
function and get it to work. I will add the other filters later.


Much in debt,
Mike F.

XSL:
<xsl:template match="/">
  <XC1011>
    <xsl:apply-templates select="//C1011"/>
  </XC1011>
</xsl:template>

<xsl:template match="C1011">
  <xsl:variable name="array" select="document('LLP.xml')//myitem"/>
    <xsl:for-each select=".">
      <xsl:variable name="getit" select="."/>
        <xsl:for-each select="$array">
          <xsl:variable name="item" select="node()"/>
            <xsl:if test="$getit = $item">
              <xsl:copy-of
select="document('UUL.xml')//var[@name=current()/@LINK]/node()"/>
            </xsl:if>
          </xsl:for-each>
        </xsl:for-each>
</xsl:template>

LLP.xml:
<LLP>
<myitem LINK="r1">[Letter] included in We're staying here *in* I
Remember Mama *root* RODGERS1</myitem>
<myitem LINK="r2">[Lyric sheets and lyric sketches for Me and Juliet]
*in* Me and Juliet *root* RODGERS1</myitem>
<myitem LINK="r3">[Lyric sheets for I Remember Mama] *in* I Remember
Mama *root* RODGERS1</myitem>
</LLP>


UUL.xml:
<UUL>
<var name="r1"><B>[Letter...r1]</B> </var>
<var name="r2"><U>[Lyric sheets...r2]</U></var>
<var name="r3"><S>[Lyric sheets for...r3]</S></var>
</UUL>


XML (source):
<UL>
  <C1011>[Letter] included in We're staying here *in* I Remember Mama
*root* RODGERS1</C1011>
  <C1011>[Lyric sheets and lyric sketches for Me and Juliet] *in* Me
and Juliet *root* RODGERS1</C1011>
  <C1011>[Lyric sheets for I Remember Mama] *in* I Remember Mama
*root* RODGERS1</C1011>
</UL>

OUTPUT:
<XC1011>
   <B>[Letter...r1]</B> 
   <U>[Lyric sheets...r2]</U>
   <S>[Lyric sheets for...r3]</S>
</XC1011>


__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.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.