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

How to navigate in an expression (sort of)

Subject: How to navigate in an expression (sort of)
From: Jay Walters <jwalters@xxxxxxxxxxxxx>
Date: Thu, 8 Feb 2001 09:50:55 -0500
jay walters
I am generating Java code from XMI files using XSLT.  For the lucky out
there, XMI is a standard DTD for representing UML models very verbosely;-).
I'm using Xalan 1.2 to do my processing.

I often find myself in the position of needing to find a node which points
to the current node using a cross reference (ID/IDREF).  An example I've
shown below is looking for all the association ends which refer to the
specific class I'm processing.  I haven't yet figured out a better way of
expressing this operation than something like

<xsl:template match="Foundation.Core.Class">

    <xsl:variable name="id">
      <xsl:value-of select="@xmi.id"/>
    </xsl:variable>

    <xsl:apply-templates
select="//Foundation.Core.Association/Foundation.Core.Association.connection
/Foundation.Core.AssociationEnd[Foundation.Core.AssociationEnd.type/Foundati
on.Core.Classifier/@xmi.idref=$id]"/>
....

What is the XSL idiom for getting this task done?  What I have works, but
does not feel elegant in the least.

Cheers
Jay Walters

 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.