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

Re: Other transformations

Subject: Re: Other transformations
From: James Clark <jjc@xxxxxxxxxx>
Date: Wed, 16 Dec 1998 16:56:56 +0700
james roberge
This is a much more interesting problem.  If isbn was an ID attribute,
then you could just use select="id(@isbn)".  See

  http://www.w3.org/TandS/QL/QL98/pp/microsoft-extensions.html

for some possible ways of extending XSL to cover this.

James Roberge wrote:
> 
> Alternating row tags seems to have sparked a fair amount of discussion. I
> suspect that bigger problem is presented by the apparent inability to pair
> items in different subtrees. To give a contrived example, suppose that I'm
> using XML to transmit data about bookstore.
> 
> <store id="1">
>      <book isbn="123"/>
>      <book isbn="234"/>
>      <book isbn="345"/>
>      ...
> </store>
> ... more stores ...
> <bookRef isbn="123'>
>    <title>...</title>
>   <author>...</author>
> </bookRef>
> ... more book refs ...
> 
> Ignoring for the moment the fact that this is a hideous use of attributes,
> suppose that when I'm processing a store's books, I'd like to display the
> titles for each book. To get the title, I need to be able to associate a
> <book> element with the associated <bookRef> element based on their isbn
> attribute -- something akin to
> 
>     <xsl:value-of  select="bookRef/[@id=this/@id]"/>
> 
> using the MS XSL style syntax where the "this" reference has its C++
> meaning.  I don't see how this type of reference can be done with the WD XSL
> or with MS XSL pattern-matching syntax.
> 
> Alternatively, I could instantiate all the <book> elements prior to serving
> the XML, but that means I need to construct an  XML representation based on
> presentation to a user rather than the natural content structure -- equally
> important, I cannot construct this instantiated XML representation using XSL
> but must use the DOM.. Just as a point of reference, I've come across the
> need for this type of reference several times in the past few months as
> we've started using XSL to create XML and HTML representations of data
> coming from a variety of data sources.
> 
> Am I incorrect in assuming that this style of reference cannot be done? Are
> there plans afoot to provide the ability to reference the current element's
> attributes (and members) within select/match patterns?
> 
> - Jim Roberge'
> 
>  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.