sputnick-dev / saxon-lint

XPath3/XQuery 3.0/XSLT 2.0 cross-platform command line tool
38 stars 2 forks source link

single quotes in xpath expression throw an error #3

Open sputnick-dev opened 8 years ago

sputnick-dev commented 8 years ago

Ex:

$ saxon-lint --verbose --xpath "/a//b[contains(., '3')]/text()" examples/XPath/001.xml
::1+java -cp /home/sputnick/github/saxon-lint/lib/saxon9he.jar net.sf.saxon.Query '!encoding=utf-8' '!indent=no' -quit:on '!item-separator=
' -s:examples/XPath/001.xml '-qs:/a//b[contains(., 3)]/text()'
Error on line 1 
  XPTY0004: Required item type of second argument of contains() is xs:string; supplied value
  has item type xs:integer
Static error(s) in query

If I invert shell quotes, this will works.

Nested quotes is a pain at this level. If anyone knows, feel free to tell me where to search.

My best bet (I hope) is to rewrite some code using perl's Java_Inline