On 07/12/2007 08:46 PM, Arjen P. de Vries wrote:
> I have two followup questions then:
> 
> 1.
> should
> <a><![CDATA[<[EMAIL PROTECTED]>]]></a>
> not leave the CDATA intact and not replace the < to &lt; ?
> 
> Disclaimer: I am not very sure what should be correct.
> http://www.w3.org/TR/2003/WD-xslt-xquery-serialization-20030502/
> states
>   Note:
>   This is phrased to permit an implementor to provide an option that
> attempts to preserve
>   CDATA sections present in the source document.

CDATA is CDATA, no matter the representation.  In both cases the content
of the <a> element is CDATA, it's just encoded differently.  I doubt
that there is a way for MonetDB/XQuery to find out which encoding was used.

> 2.
> Should
> xquery><![CDATA[<[EMAIL PROTECTED]>]]></a>
> more>MAPI  = [EMAIL PROTECTED]:50000
> QUERY = <![CDATA[<[EMAIL PROTECTED]>]]></a>
> ERROR = !parse error: syntax error, unexpected <![CDATA[ on line 1,
> column 9 (next token is `<![CDATA[')
>         !parse error: XQuery parsing failed
> 
> also have been allowed - a bit weird if it is allowed inside another element?

I don't know enough about XQuery, but my guess is: no.

When you look at the XQuery grammar
(http://www.w3.org/TR/xquery/#nt-bnf) you'll see that (after the
optional prologue stuff) the query consists of a list of comma-separated
ExprSingles, and that an ExprSingle is one of FLWORExpr, QuantifiedExpr,
TypeswitchExpr, IfExpr, OrExpr.  The only one (in a quick scan) that
doesn't have to start with a keyword is OrExpr in the guise of a
PathExpr.  And the only CDataSection (<![CDATA[...]]>) is inside a
<tag>...</tag> construct.

> Cheers.
> 
> Arjen
> 
> On 12/07/07, Sjoerd Mullender <[EMAIL PROTECTED]> wrote:
>> Arjen P. de Vries wrote:
>>> While
>>> <a />
>>> is accepted as a query,
>>> <![CDATA[<]]>
>>> is not.
>>> !parse error: syntax error, unexpected <![CDATA[ on line 1, column 9
>>> (next token is `<![CDATA[')
>>> !parse error: XQuery parsing failed
>>>
>>> Is that the expected behaviour?
>>>
>>> Context: I try to output email addresses as "test <[EMAIL PROTECTED]>" and 
>>> failing
>>>
>>> Arjen
>>>
>> This works:
>>
>> xquery><a><![CDATA[<[EMAIL PROTECTED]>]]></a>
>> more><>
>> <a>&lt;[EMAIL PROTECTED]&gt;</a>
>>
>>
>> --
>> Sjoerd Mullender
>>
>>
>>
> 
> 


-- 
Sjoerd Mullender

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-developers

Reply via email to