[xquery-talk] XML prologue

Frank Cohen fcohen at rainingdata.com
Mon Jul 25 16:54:49 PDT 2005


Both make sense to me. Thank you Michael. I'm wondering if there is a  
built-in function that would strip the xml prologue from a String so  
I could use something like this:

let $b := '<?xml version="1.0"?><name>frank</name>'
return doc-strip-prologue($b)/name

-Frank



On Jul 25, 2005, at 3:14 PM, Michael Dyck wrote:

> Frank Cohen wrote:
>
>>
>> let $b :=<?xml version="1.0"?><frank/>
>>
>> $b fails with a lexxing error.
>>
>> I read the XQuery 4/2005 spec and don't see that this is not allowed
>> but the 3 different XQuery processors I ran this on all have a
>> problem with it.
>>
>
> There are a couple of things that they might be complaining about.
>
> (1)
> To the XQuery grammar, <?xml version="1.0"?> looks like a
> DirPIConstructor (direct processing-instruction constructor); however,
> 'xml' is not allowed as a PITarget.
>
> (2)
> If the parser is being lax about PITargets, or is delaying that  
> check to
> a later phase, then it's probably complaining that you have a
> (top-level) DirPIConstructor followed by a DirElemConstructor,  
> which is
> a syntax error. (ExprSingle derives PrimaryExpr derives  
> Constructor, not
> Constructor+.) It's syntactically on par with
>     let $b := 1 2
> or
>     let $b := "hello" "world"
>
> -Michael Dyck
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk
>
>




More information about the talk mailing list