[xquery-talk] Getting a bare & and > into HTML for Javascript - Success !!!

David Lee dlee at calldei.com
Wed Jul 20 09:33:36 PDT 2011


Thanks to help from multiple lists (fyi this is on a MarkLogic server)
I was able to set

declare option xdmp:output "method = html" ;

and all of a sudden it works !!!

	" if( sel.length > 0 && sel[0] != undefined ){"

Turns properly into

	if( sel.length > 0  && sel[0] != undefined ){

And my Google Chart is working again :) 




----------------------------------------
David A. Lee
dlee at calldei.com
http://www.xmlsh.org


-----Original Message-----
From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf
Of David Carlisle
Sent: Wednesday, July 20, 2011 12:25 PM
To: David Lee
Cc: talk at x-query.com
Subject: Re: [xquery-talk] Getting a bare & and > into HTML for Javascript


On 20/07/2011 17:01, David Lee wrote:
> I am using html tag but in the xhtml namespace ...

If you serve the file with an xml or xhtml mime type then the & is 
what you need (otherwise the file is not well formed and will be 
rejected as such by the browser).


If your xquery processor has an html serialisation and you serialsed as 
html then it would come out as && not && (and <br/> would come 
out as <br>) and then serving as text/html will do the right thing.

If you generate xml and serve it as html, then it's all basically a 
syntax error and you are relying on the browser to correct things, 
sometimes it will work, but in this case it won't:-)

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________
_______________________________________________
talk at x-query.com
http://x-query.com/mailman/listinfo/talk



More information about the talk mailing list