Subject: Re: [xsl] Re: XPath to select node according to xml:lang attribute From: "Christopher R. Maden" <crism@xxxxxxxxx> Date: Fri, 15 Apr 2011 14:00:55 -0400 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 04/15/2011 01:53 PM, Philipp Kursawe wrote: > Well I do have a question to that still: > > <root> > <text id="color" xml:lang="en">colour</text> > <text id="color" xml:lang="en-us">color</text> > </root> > > using //text[@id='color' and (lang('en-us') or lang('en')]/text() will > always return "colour" although I am expecting "color". I know > attributes are not ordered, but can you not have the perfect match be > in the selected result first? These are filters, not ordered operations. If you want an ordered selection, youbll need to be more explicit; in XSLT 1.0, that means using multiple variables instead of a single XPath. ~Chris - -- Chris Maden, text nerd <URL: http://crism.maden.org/ > bThose in power write the history, while those who suffer write the songs.b b Frank Harte GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2oh9cACgkQGfhmdwB3wxkG6gCeJTuxrm5iVT+b/vAGEX3LI3jX EQ4AoKviDdtIiHwlwPSYL1XeSbhqTVsf =wBGc -----END PGP SIGNATURE-----
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: XPath to select node acco, Philipp Kursawe | Thread | Re: [xsl] Re: XPath to select node , Philipp Kursawe |
[xsl] Re: XPath to select node acco, Philipp Kursawe | Date | Re: [xsl] Re: XPath to select node , Philipp Kursawe |
Month |