Substring Functions and &

We apparently need to learn more about the inner workings of substring functions like contains in conjunction with, e.g., ($i/text( ), “foo”). With a tagged field like “cat & dog”, the message produced is as follows:



It complains about the ampersand (& or &) . If substituted in the data by something else, e.g., ‘and’, the complaints go away. We’ve even tried to define anew value=“&” in the XML, but with unsatisfactory results.

Clarifying observations or pointers would be appreciated. Thus far, we haven’t seen as many substring examples as we would have wished. Surely this is something basic.

Thanks,
j. conrad

Note the system has suppressed the amp; part of some of those ampersand symbols in our last message … which may very well relate to our problem … --j.c.

Hard to see exactly what’s wrong since the system has messed up your input, but both in XML and in XQuery, any ampersand character must be written as & a m p ; without the spaces.

Michael Kay