Re: XMLlib -- > Xpath
Re: XMLlib -- > Xpath
- Subject: Re: XMLlib -- > Xpath
- From: Alexis Gottlieb <email@hidden>
- Date: Thu, 22 Nov 2007 08:49:09 +0100
Le 22 nov. 07 à 02:06, Christopher Nebel a écrit : On Nov 20, 2007, at 5:03 AM, Wayne Melrose wrote:
Is there a way to ignore case sensitivity when using xpath in XMLlib?
That depends on which comparisons you're talking about. If you're talking about the node names, then no, because XML is case-sensitive and ignoring that would be wrong. If you're talking about testing the values of attributes in a predicate, then you could use something like "translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = .", though obviously that only works for US English. (You'd think there'd be a better way, but I can't find one.)
Hi,
In the latest version of XMLLib.osax, XMLXpath conforms to XPath1.0 and adds the XPath2.0 functions compare, upper-case, lower-case, ends-with and base-uri in the namespace "http://www.w3.org/2005/xpath-functions". Here is an example using the lower-case function with this namespace:
set x to XMLOpen "<table><tr/><tr align='center'/><tr align='CENTER'/><tr/></table>"
Regards, Alexis |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden