The forum will be down for scheduled maintenance on Saturday, March 4 beginning at 10am EST. Actual downtime is unknown but may be several hours.

I'd like to select several elements from a XML document and tried to combine several simple XPath queries with the pipe operator as logical OR, such as

'//GivenName | //SurName'

It seems that SQL Anywhere does not support that but raises error -892: "XPath parser error: syntax error at or before character '|'".

This is similar to that (still unanswered) FAQ on position tests in XPath queries.

Just to clarify this one: Am I right that ORing XPath expressions is not (yet) supported?

If so, are there better workarounds than

  • use a more general XPath query and filter the result set with a usual SQL WHERE clause or
  • use two openxml() calls with each single XPath query and UNION ALL both result sets?

asked 21 Jan '13, 12:01

Volker%20Barth's gravatar image

Volker Barth
accept rate: 32%

edited 23 May '13, 17:02

Any more hints are still appreciated, say, by Jeff:)

(23 May '13, 11:45) Volker Barth

syntax error at or before character '|'

Checking the XML parser code, yes, I can confirm that '|' is not currently supported in the XPath query for OPENXML.

Any more hints are still appreciated, say, by Jeff:)

I have now made an enhancement request to look at further potential support for XPath queries in OPENXML (set operations, and boolean/comparison/set expressions) in CR #740332 for a future version of SQL Anywhere. I hope that's a more helpful hint. ;)

permanent link

answered 23 May '13, 14:52

Jeff%20Albion's gravatar image

Jeff Albion
accept rate: 24%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 21 Jan '13, 12:01

question was seen: 3,562 times

last updated: 23 May '13, 17:02