Re: special char at pos 0 problem
Brought to you by:
bs_php,
nigelswinson
From: Peter R. <php...@pe...> - 2002-05-23 09:39:57
|
what context/baseXPath does this new feature of being able to use an XPathquery in say getData use? Does it always use the evaluate default, i.e. the root node? If so, you should be able to check on presence of / or [ If present, then it's a query, if not, it's a nodename. (er, I think, or am I getting confused? :-) I think we need to move away from the concept of locale/charset. If you're using ucs, a file, or for that matter node, can contain characters from any number of different languages/locales, and has nothing to do with what locale the machine/operating system works under. On Tuesday 21 May 2002 11:06 pm, Nigel Swinson wrote: > > There is no such limitation. In that line we are purely trying to work out > if the $nodeTest is JUST a node name, or whether it is an XPath Expression. > > My suggestion is that we change to: > > elseif (preg_match('/^[\w\-]+$/', $nodeTest)) { > > The PHP manual says \w is a word character where a word character is > defined as: > > ============= > A "word" character is any letter or digit or the underscore character, that > is, any character which can be part of a Perl "word". The definition of > letters and digits is controlled by PCRE's character tables, and may vary > if locale-specific matching is taking place (see "Locale support" above). > For example, in the "fr" (French) locale, some char- acter codes greater > than 128 are used for accented letters, and these are matched by \w. |