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

RE: in-document references

Subject: RE: in-document references
From: "Robert Koberg" <rob@xxxxxxxxxx>
Date: Mon, 6 Jan 2003 17:14:25 -0800
RE:  in-document references
Hi again,

You example should work.  Does it work if you do:

> >>    <xsl:template match="ref">

<xsl:variable name="current_name" select="@name"/>

> >>      <li>Ref:
> >>        <b><xsl:value-of select="@name"/></b>
> >>        <ul>
<xsl:apply-templates
  select="//define[@name=$current_name]"
  mode="def"/>
> >>        </ul>
> >>      </li>
> >>    </xsl:template>

but this is very inefficient if you have a large schema with many define's.

<snip/>

> > To select just
> > descendants of the context node, do:
> >
> > <xsl:apply-templates select=".//define[@name=current()/@name]"
> > mode="def"/>

This is wrong. An RNG 'define' will not be in the context node.

>
> The problem is that the "context" of the context node includes the
> ancestor elements and so on, which I wish to access from <xsl:template
> match="define">. Does that make sense?

not understanding... ancestors are not in the context node.

>
> > (This doesn't address optimization of course--this search pattern can
> > be
> > quite expensive.)
>
> I can live with that, I'm using AxKit and static data.

You don't want to live with that :). I believe what you want is what I provided.
Let me know (offlist if you want) what did not make sense. I copied the examples
out of context with your examples so i can see how they might be confusing.

best,
-Rob

>
> simon
>
> ---
> www.simonwoodside.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.