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

Re: Question about isolating records

Subject: Re: Question about isolating records
From: "G. Ken Holman g.ken.holman@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 6 Sep 2015 12:44:31 -0000
Re:  Question about isolating records
At 2015-09-06 03:48 +0000, Mark Wilson pubs@xxxxxxxxxxxx wrote:
I got to work with one small change to your suggested code:

<xsl:attribute name="pdf-number" select="substring-before(key('pdf-key', ., doc('test-xml.xml')), 'Crawford')"/>

I think a better solution would be:


 <xsl:attribute name="pdf-number"
                select="key('pdf-key',.,doc('test-xml.xml))/PDF"/>

... because you want the value of the <PDF> child of the <Item> element being returned by the key() function. I worry you approach XSLT, like many of my incoming students did, as dealing with XML as a bunch of strings to be manipulated. I had to teach the students to understand XSLT treats XML as a bunch of nodes, not strings. Whereas you approached the solution above by substringing the <Item> element string value, I suggest you simply address the PDF child of the Item element node and you have everything you need without using substrings.

My major misunderstanding was of the <xsl:key/> statement, not realizing that is was not a 'variable to be loaded when called' and that the key() function later would parse the data in FILE2.

Good ... I was trying to get across to you that, yes, the key declaration is in effect for all input files.


Also, thanks for reopening the book for me.

You are most welcome. Other registered purchasers are welcome to ask for access to the latest edition (14th, dated 2011-02-11).


. . . . . . Ken

--
Check our site for free XML, XSLT, XSL-FO and UBL developer resources |
Free 5-hour lecture:  http://www.CraneSoftwrights.com/links/video.htm |
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                    mailto:gkholman@xxxxxxxxxxxxxxxxxxxx |
Google+ profile:       http://plus.google.com/+GKenHolman-Crane/about |
Legal business disclaimers:     http://www.CraneSoftwrights.com/legal |


--- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

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.