[xquery-talk] Sequence from String-Literal

Michael Kay mike at saxonica.com
Fri May 11 11:22:01 PDT 2007

Do you mean, the string literal contains XML markup, and you want to parse
it to turn it into nodes (an instance of the XDM data model)? 

That operation is called XML parsing... There's no standard way of doing it
from within XQuery. Saxon has an extension function saxon:parse(). 


Some products may support the "data:" URI scheme, where the data is wrapped
into a URI that can then be passed to the doc() function.

Michael Kay

> -----Original Message-----
> From: talk-bounces at x-query.com 
> [mailto:talk-bounces at x-query.com] On Behalf Of 
> florianwendland at freenet.de
> Sent: 11 May 2007 09:09
> To: TalkXQuery
> Subject: [xquery-talk] Sequence from String-Literal
> Hallo all,
> thanks for the answer before. Now I have an other problem. I 
> want to pass a string lietral <a><b>Hello</b></a> to a xquery 
> variable, and during the process, I want to convert the 
> literal into a sequence, so that for-Expression can iterate over it.
> I tried with
> 	document{ $literal }
> but that doesn't work. (Don't ask, I thought, that I read 
> this somewhere in a xquery book).
> Backgrounf for this approach is passing a string to a eXIst 
> XQueryService. There, it is not possible to pass a whole 
> DOM-Object or something else. SO I want to fill the variable 
> with a string (in xml
> strcuture) and than convert it into a sequence.
> Is that possible?
> Thx
> mfw
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk

More information about the talk mailing list