Results 1 to 2 of 2
Mar 7, 2013, 05:50 #1
Correct XML Path to a specific node?
I have been poring over the following for ages now and just can't find out what is going wrong.
Thus, another set of XML-savvy eyes would be greatly appreciated!
This is a relevant snippet of the XML that I want to transform via XSLT:
<key>synopses</key> <array> <dict> <key>plainText</key> <string>The text I'm trying to select.</string> <key>source</key> <string>Your Description</string> </dict> </array> ....
but only in <dict>'s where the string following key='source' is "Your description".
I've set the XSL up like this:
<!-- data is contained in an array: applies to synopses --> <xsl:when test="$dataname='synopses'"> <!-- only import own synopses --> <xsl:if test="following-sibling::array/dict/key['source']/following-sibling::string/text()='Your Description'"> <xsl:value-of select="following-sibling::array/dict/key['plainText']/following-sibling::string"/> </xsl:if> </xsl:when>
<synopsis>The text I'm trying to select. Your Description</synopsis>
It is as if the last string is being ignored??
Thanks for any pointers here,