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



  the function is defined there:
   
http://www.w3.org/TR/xpath#function-contains
 and its definition does not relates to regexp.

Thank you for your comments, Daniel; I've already read the definition:Daniel Veillard wrote:

Function: boolean contains(string,string)

The contains function returns true if the first argument string contains the second argument string, and otherwise returns false.

Daniel Veillard wrote:

  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.

The function's definition makes it clear that contains(string)is about finding one string within another.  Therefore, I do not understand your last comment, which implies that there is some hidden requirement that the implementation of contains(string)  be coupled to XPath.  XPath evaluates a special syntax of expressions that specify a search through XML parse trees.  What does that have to do with searching for a substring within another string?

Regular expressions aren't of that much concern to me, right now.  It's of more concern to me that contains(string) satisfy its primary definition: to find an occurance of a substring within another string.   For example, my own goal was to be able to match all occurences of the newline character ('\n') in a block of text.  To accomplish that, contains(string) must be capable of recognizing "\n" (by convention) as a line feed character in it's argument.  By extension, contains(string) should recognize all the other customary di-graphs for non-printable characters, as well as character codes such as "&#Xnnnn" for Unicode characters, any of which might be found in a text node. T
(It's probably a better idea, anyway, to define a different function for that purpose, say, 

I hope this is now clearer.

Respectfully,
-Larry Siden


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