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

Re: Referencing content in XML and then processing in

Subject: Re: Referencing content in XML and then processing in XSLT 2.0
From: Jacobus Reyneke <jacobusreyneke@xxxxxxxxx>
Date: Tue, 23 Mar 2010 10:39:52 +0200
Re:  Referencing content in XML and then processing in
> Define companies using a company element with an id:
>
> <company id="comp1" name="Some Company">
>  ..more details about the company
> </company>
>
> then refer to that company with a company ref element:
>
> <company-ref ref-id="comp1"/>
>
> then in your XSLT, have a template that matches "company-ref" that
> gets the "company" element's @name:
>
> <xsl:template match="description/company-ref">
>  <xsl:apply-templates select="key('company-by-id', @ref-id)/@name"/>
> ..
>
>
> cheers
> --
> Andrew Welch

Thanks Andrew,

It's a

Is there any way I can use my own "id" name for this, e.g.
"domain-id", or does XSLT expect refs to always point to "id". I am
trying to steer clear of the reserved "id" attribute since I may one
day need to include and preserve external data id's as well as my own.

Also, is there any way to make your solution work if the referencing
content is inside an attribute of an element
e.g. <company product="The editor &lt;producttype-ref
ref-id=&quot;manual1&quot;/&gt;">

Apologies, I know it looks like a weird requirement, but it makes
sense in the solution I'm working on.

Kind regards,
Jacobus

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.