[xquery-talk] Query with subelements nested inside words

Martin Probst martin at x-hive.com
Wed Jun 1 13:27:29 PDT 2005


 > I would like to be able to extract the contents of <elemt> as a string
 > without the subelements and with the integrity of the words
 > unaffected.

according to the XQuery specification, the string-value of the root node 
ist exactly what you want - all characters below it concatenated, no 
You should be able to get your result using the fn:string() accessor, e.g.:
 > let $doc := <root>
 >   <elemt>Something is ro<lig>tt</lig>en in the state of
 > <emph>Den</emph>mark</elemt>
 > </root>
 > return string($doc)
 > Something is rotten in the state of Denmark

If your implementation inserts whitespaces in the string it's probably 
not conformant to the XQuery Data Model, at least how I understand it.


More information about the talk mailing list