Re: Novice question: selecting an element based on an
On Thursday 21 March 2002 00:46, Michael Kay wrote: > > Anyway, the transformation is: > > 1. Look for elements in the source with the attribute > > "field" and use that as an element in the target. Hence, you see that > > > > <String field="_str1" myId="28"><![CDATA[a test of > > referencing.]]></String> > > > > becomes > > > > <_str1><![CDATA[a test of string referencing.]]></_str1> > > So what are the criteria that turn the value "a test of referencing" into > "a test of string referencing"? I still don't understand. > > Michael Kay <_str1> is a tag with a value and id "28". <_str3> is a tag that references the value of the tag with id "28" via refid="28". So since the value of <String field="_str1"> was "<![CDATA[a test of string referencing.]]>" (ignoring the fact that the CDATA won't be copied), <_str3> also gets a copy of this value because it references _str1. I believe his input document is output from the JSX project -- Java Serialization to XML (but I could be wrong). As you probably know, in serialization each object is only written once, and future references to the same object use a reference id, to prevent both wasted space and infinitely recursive graphs. So that would be where he's getting the refid="28" and why he want's a copy of the value (since they started out as the same object/value). -- Peter Davis By rule #1, 5.005 should always allow localization of lexical @_ . . . -- Larry Wall in <199710011704.KAA21395@xxxxxxxx> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format