Subject: RE: [xsl] Need help OR'ing in XPATH. From: "Michael Kay" <mike@xxxxxxxxxxxx> Date: Wed, 22 Mar 2006 12:49:57 -0000 |
> not that it will happen to you but its a best practice to > refer a text value > of a node by text(). > > <xsl:a-t select="book[owner/text()='aaa' or > chapter/owner/text()='aaa']"/> > No, this is absolutely *not* recommended. If you use /text(), your code will be sensitive to the presence of comments within the text, and it's very unusual that you should want comments to make any difference. owner='aaa' compares the string value of the owner element against the string 'aaa'. If the owner element is <owner>aa<!--three stars-->a</owner> then owner='aaa' will succeed, but owner/text() will fail. Michael Kay http://www.saxonica.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Need help OR'ing in XPATH, Vasu Chakkera | Thread | Re: [xsl] Need help OR'ing in XPATH, David Carlisle |
RE: [Fwd: RE: [xsl] Need help OR'in, Michael Kay | Date | Re: [Fwd: RE: [xsl] Need help OR'in, David Carlisle |
Month |