Why are XPath operators case sensitive?

I am sure there is a reason for this, but: Why are XPath operators case sensitive?

This is not about solving the XPath problem (we are already working on it) - I just wanted to know why I should be worried!

+6
xpath
source share
3 answers

I think most modern languages ​​are case sensitive. Clearly, XPath makes sense to follow XML. One of the reasons XML is case sensitive is that random folding can be quite tricky when you go beyond the English alphabet: for example, uppercase ß is SS, but lowercase SS is ss. So do Straße and Strasse have the same element name?

+8
source share

XPath is case sensitive because XML is case sensitive .

Consequently,

/AAA 

- this is not the same as:

 /AAA 

As for operators, in XPath 1.0 most operators consist solely of non-alphabet characters.

Finally , the or , and and div operators and Xpath 2.0 operators consisting of letters - for example, union , intersect , except , The reason for case sensitivity is the same as for most modern programming languages ​​(excluding VB and SQL).

+2
source share

Well, XML is case sensitive (that is, "foo", "FOO", "Foo" are all different names in XML), so any language designed to select nodes in an XML document should distinguish between at least least for those parts of the language that are related to the choice of node by name.

If you are really asking about operators such as the logical and and or operators, for example, I think that just XML consistency is case sensitive, and so some parts of XPath are necessarily case sensitive. But I think I don’t know the details about the XPath development process. http://www.w3.org/TR/xpath/ lists the editors' email addresses, and there may even be publicly accessible W3C email list archives documenting the design process you could follow.

+1
source share

All Articles