I can't think of any way that setting a different serialization method
should cause a syntax error to be reported in your query where there was
none before. "Unmatched quote in expression" almost certainly means what it
says...
So I'm going to have to ask you to put together a reproducible example that
demonstrates the problem.
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: saxon-help-bounces@...
> [mailto:saxon-help-bounces@...] On Behalf
> Of The King's
> Sent: 12 May 2007 13:05
> To: saxon-help@...
> Subject: [saxon] Appending CR LF to XQuery Return Statement
>
> This is an elementary question but I am going to need some
> help with it. I would like to append a carriage-return,
> line-feed at the end of the Return statement. My primary
> objective is to get a comma delimited data file with each row
> being delimited by the carriage-return, line-feed.
> Here is the return of the XQuery:
>
> return
> string(concat($date,",",$payee,",",$memo,",",$amount,",",$account,
> "

"))
>
> here is most of the servlet:
> ...
> FileOutputStream out = new FileOutputStream(filename); try {
> final Configuration config = new Configuration(); final
> StaticQueryContext sqc = new StaticQueryContext(config);
> final XQueryExpression exp = sqc.compileQuery(XQuery); final
> DynamicQueryContext dynamicContext = new
> DynamicQueryContext(config);
> dynamicContext.setContextItem(sqc.buildDocument(new
> StreamSource(filePath)));
>
> final Properties props = new Properties();
> props.setProperty(OutputKeys.METHOD, "text");
>
> exp.run(dynamicContext, new StreamResult(out), props); } ...
> I am using the "text" method on the setProperty (the xquery
> works if I use the "html" method). In any event, the error I get is:
> net.sf.saxon.trans.StaticError: XQuery syntax
> error in #...mo,",",$amount,",",$account, "#: Unmatched quote
> in expression Maybe if I understood what is different about
> the "text" method in contrast to the "html" method.
>
> Any help would be appreciated.
>
> Jeff
>
>
> --------------------------------------------------------------
> -----------
> 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/
> _______________________________________________
> saxon-help mailing list
> saxon-help@...
> https://lists.sourceforge.net/lists/listinfo/saxon-help
|