Saxon 9.3 failed for process wild character *
Added by Anonymous over 13 years ago
Legacy ID: #10614383 Legacy Poster: Jianming Xu (xujianming)
fail.xq: for $item in doc("items.xml")//items//item where $item//description="Red*" return $item//itemno Result: C:\saxonhe>java -cp saxon9he.jar net.sf.saxon.Query -t -s:items.xml -q:fail.xq Saxon-HE 9.3.0.4J from Saxonica Java version 1.6.0-rc Analyzing query from fail.xq Analysis time: 172 milliseconds Processing file:/C:/saxonhe/items.xml Source document ignored - query does not access the context item URIResolver.resolve href="items.xml" base="file:/C:/saxonhe/fail.xq" Using parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser Building tree for file:/C:/saxonhe/items.xml using class net.sf.saxon.tree.tiny. TinyBuilder Tree built in 15 milliseconds Tree size: 28 nodes, 59 characters, 0 attributes Execution time: 78ms Memory used: 4403992
Replies (2)
RE: Saxon 9.3 failed for process wild character * - Added by Anonymous over 13 years ago
Legacy ID: #10614384 Legacy Poster: Jianming Xu (xujianming)
items.xml: 1001 Red Bicycle 400 1002 Red Car 5000
RE: Saxon 9.3 failed for process wild character * - Added by Anonymous over 13 years ago
Legacy ID: #10614899 Legacy Poster: Michael Kay (mhkay)
Firstly, Saxon does not support the XQuery Full-Text Option. Secondly, even if it did, your syntax is wrong: wildcards are not recognized unless you have enabled this option, and the wildcard must be written "." rather than "". You can achieve what you are trying to do here using regular expressions code [/code] or by using the starts-with function code)[/code]. Of course, unlike Full Text, these operate naively on the characters in the source document, rather than doing any intelligent linguistic stemming.
Please register to reply