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

how to get info from nodes surrounding current node?

Subject: how to get info from nodes surrounding current node?
From: john liao <jliao2k@xxxxxxxxx>
Date: Mon, 30 Sep 2002 10:23:03 -0700 (PDT)
xslt get current node
I am a newbie, and I just looked at the FAQ and search
turned up too many irrelevant things. I want to
display the value of name in data item when I'm
matching another element:

<TABLE name="table1">
  <ITEM id="105" name="col1"/>
  <ITEM id="106" name="col2"/>
  <IDX NAME="IDX1">
    <D_ID col_id="105"/>
    <D_ID col_id="106"/>
  </IDX>
</TABLE>

I want to print plaintext output in SQL so it looks
like:

CREATE UNIQUE INDEX IDX1 on table1 (col1, col2);

My XSL is something like:


<xsl:template-match select="IDX">
CREATE UNIQUE INDEX <xsl:value-of select="@NAME"/> on
<xsl:value-of select="TABLE[@name]"/>
(<xsl:apply-templates select="D_ID"/>
</xsl:template>

<xsl:template-match select="D_ID">
<xsl:value-of select="col_id"/>);
</xsl:template>

This last template can only print 105, 106); so my
output looks like: CREATE UNIQUE INDEX IDX1 on table1
(105, 106);

while I was really looking to print:

CREATE UNIQUE INDEX IDX1 on table1 (col1, col2);

How do I print the 'name' in ITEM rather than the
'col_id' in the "D_ID" template?

Thanks for your time.


=====


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.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.