ASP Error: 70
Description: Permission denied
Source: Microsoft VBScript runtime error

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

RE: how to get info from nodes surrounding current nod

Subject: RE: how to get info from nodes surrounding current node?
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 30 Sep 2002 21:03:38 +0100
xsl get index
You want <xsl:value-of select="parent::TABLE/@name"/> or simply
"../@name". 

Writing <xsl:value-of select="TABLE[@name]" means "output the
string-value of the first child TABLE of the context node that has an
@name attribute". Of course your context node, IDX, has no child TABLE
elements, and you don't want the contents of the TABLE element, you want
the contents of its @name attribute.

Similarly for the columns you want @col_id to output the attribute
contents.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of john liao
> Sent: 30 September 2002 18:23
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  how to get info from nodes surrounding 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
> 


 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.