[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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: 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 |
|
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
|