Subject: Re: [xsl] banging my head against the wall (key, actually) From: "G. Ken Holman g.ken.holman@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 24 Apr 2015 02:26:10 -0000 |
I fully expected method 1 and method 2 in the following stylesheet (which reads itself as input) to produce the same result.
Method 1 is to access nodes from a key all at once by handing key() a single sequence of four key-values.
Method 2 is to access nodes from a key one at a time by handing key() a single key-value four times.
Obviously I'm missing something, but I'll be darned if I can figure out what. I have, of course, tried a bunch of variations (like using "(string())" instead of "string(.)" as the 2nd arg to 2nd key()), but to no avail. Any thoughts?
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" exclude-result-prefixes="xs xd" version="2.0">
<xd:doc scope="stylesheet"> <xd:desc> <xd:p n="1">one</xd:p> <xd:p n="2">two dos</xd:p> <xd:p n="3">three tres III</xd:p> <xd:p n="4">f o u r</xd:p> </xd:desc> </xd:doc>
<xsl:output method="text"/> <xsl:key name="tst" match="xd:desc/xd:p" use="."/> <xsl:variable name="home" select="/"/>
T:\>xslt2 syd.xsl syd.xsl debug1: 1 debug1: 2 debug1: 3 debug1: 4 debug2: 1 debug2: 2 debug2: 3 debug2: 4
-- 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. http://www.avast.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] banging my head against the w, Syd Bauman s.bauman@ | Thread | Re: [xsl] banging my head against t, G. Ken Holman g.ken. |
[xsl] banging my head against the w, Syd Bauman s.bauman@ | Date | Re: [xsl] banging my head against t, G. Ken Holman g.ken. |
Month |