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

Re: Question about xpath

Subject: Re: Question about xpath
From: Zvi Avraham <zvia@xxxxxxxxxxxxxxx>
Date: Mon, 11 Oct 1999 18:48:01 +0200
zvi avraham

Lung wrote:

> Hi all
>
> I want to edit a portfolio page with mulitple views.
> My views definition is stored in an xml file:
>
> <view>
>     <name>my view</name>
>     <column>stock/name</column>
>     <column>quantity</column>
>     <column>price</column>
> </view>
> <view>
>     <name>another view</name>
>     .....
> </view>
>
> where the "<columns>" define which column I want to select.
> and my portfolio xml looks like:
>
> <portfolio>
>      <contract>
>         <stock>
>             <name>Red Pat</name>
>                ...
>         </stock>
>         <quantity>1000</quantity>
>         <price>20</price>
>     </contract>
>     <contract>
>         ....
>     </contract>
> </portfolio>
>
> The question is : Can I use xsl to apply the views? If so, how?
> I have considered something like
>
> <xsl:template match="portfolio">
>    <xsl:variable name="view"
> select="document('views.xml')/view[@name='my view']"/>

try name instead of @name ...
it's element not attribute

>
>    <xsl:for-each select="contract">
>          <xsl:variable name="current-contract" select="self::node()"/>
>         <xsl:for-each select="$view/column">
>             <xsl:value-of select="$current-contract/text()"/>
>         </xsl:for-each>
>    </xsl:for-each>
> </xsl:template>
>
> and of course it doesn't work.:<
>
> Thx a lot
> Daniel
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

--
-------------------------------------------------
Zvi Avraham, Senior Software Engineer
NetManage Inc., Visual Connectivity Division
http://www.netmanage.com/products/visual_conn.asp

begin:vcard 
n:Avraham;Zvi
tel;cell:+972-52-837908
tel;fax:+972-3-5788752
tel;home:+972-4-8551158
tel;work:+972-3-5788753
x-mozilla-html:FALSE
url:http://www2.netmanage.co.il/~zvia
org:NetManage, Inc.;Visual Connectivity Division<BR><A HREF="http://www.netmanage.com"><IMG SRC="http://www.netmanage.com/images/newhead-l.gif" WIDTH="129" HEIGHT="63" ALT="NetManage" BORDER="0"></A><A HREF='http://www.netmanage.com/products/visual_conn.asp'><IMG SRC='http://www.netmanage.com/images/vc_middle.gif' WIDTH=227 HEIGHT=63 ALT='NetManage Visual Connectivity Group' border=0></A>
adr:;;;;;;
version:2.1
email;internet:zvia@xxxxxxxxxxxxxxx
title:Senior Software Engineer
note:I beleive I can fly !
fn:Zvi Avraham
end:vcard
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.