Re: [xml] contains() argument treated like XPath expression

On Thu, Jul 24, 2003 at 04:59:44PM -0400, Larry Siden wrote:
I looked in the code for the "contains(string)" function the other day 
and noticed that its argument is handed off to another routine that 
parses it as if it were an XPath expression.  Since contains() is used 
for string searches, wouldn't it be better to parse its argument as a 
regular expression? 

  the function is defined there:
 and its definition does not relates to regexp.

I haven't taken the time to research it, but I'll 
bet there's a number of open source regular-expression libraries that 
can parse and search for the expression.  At the very least, I would 
expect the argument to be treated as a literal string with special 
character sequences, like '\n', recognized so that it is possible to 
search for an end-of-line, for example.  If anyone is interested in 
this, and Daniel V. grants his blessing, I will volunteer to look into 
doing it, because this feature might have helped me on one of my projects.

  If the purpose is to extend the function as to make it non conformant
to the defintion, then I disagree. If you want regexp support implement
some EXSLT based functions, but do not break the conformance of the 
existing XPath implementation. Concerning regexp, there is some support
in libxml2 and I do not agree to use an external library for regexp support
for portability reasons.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]