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

RE: Novice question: selecting an element based on an

Subject: RE: Novice question: selecting an element based on an attribute id
From: "Brinkman, Theodore" <Theodore.Brinkman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 20 Mar 2002 13:39:21 -0500
brinkman element
It looks like he's trying to use the myIdRef="28" in the second String tag
to reference the contents of the first string tag which has a myId="28"
attribute value.  (i.e.: turning a reference in the input xml into the
contents of the reference in the output xml)

I'd think a template that took in the myIdRef attribute's value as a
parameter and selected the String tag with the same value in the myId
attribute and returned the contents would do the trick.

Unfortunately, I'm enough of a newbie myself, that attempting to provide an
example would just serve to embarass me.

	- Theo

-----Original Message-----
From: Michael Kay [mailto:michael.h.kay@xxxxxxxxxxxx]
Sent: Wednesday, March 20, 2002 1:25 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Novice question: selecting an element based on an
attribute id


>   I'm an novice user of XSLT but was tasked to transform an
> incoming XML file into another format. So far so good but I
> ran into a perplexing problem. Here's the short example of an
> incoming XML file:
>
>     <object>
>         <class  name="TestF">
>             <field name="_str1" type="java.lang.String"/>
>             <field name="_str3" type="java.lang.String"/>
>         </class>
>         <String field="_str1" myId="28"><![CDATA[a test of
> referencing.]]></String>
>         <String field="_str3" myIdRef="28"/>
>     </object>
>
>   This needs to be transformed simply to
>
>   </object>
>         <_str1><![CDATA[a test of string referencing.]]></_str1>
>         <_str3><![CDATA[a test of string referencing.]]></_str3>
>     </object>
>
>   As you can see,

I may be blind, but I can't see. Could you explain more clearly the
relationship of your output to your input?

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx


 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.