[xquery-talk] Query with subelements nested inside words
eah at faust.ab.ca
eah at faust.ab.ca
Wed Jun 1 12:53:26 PDT 2005
Thanks to those who replied, both on- and off-list. My XQuery
implementation was indeed buggy and didn't handle the query properly. I
have since updated it to a more recent version and all is well.
best,
Eric
> Hi,
>
> > 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
> elements/attributes/PIs/etc.
> 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)
> returns:
> > 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.
>
> Regards,
> Martin
>
More information about the talk
mailing list