Hi,
I'm trying to conditionally output CDATA, but don't seem to be finding the right syntax for it.
This works:
declare option output:cdata-section-elements "div";
<div><![CDATA['<div/>']]></div>
But this doesn't:
declare option output:cdata-section-elements "div";
<div>{ if (1 = 2) then '' else <![CDATA['<div/>']]> }</div>
Any hints on how to do this?
Thanks! Kevin
Answering my own question... :-)
declare option output:cdata-section-elements "div";
<div>{ if (1 = 2) then '' else '<div/>' }</div>
I was misinterpreting what cdata-section-elements means... it puts everything in that element in CDATA for you (so it will supply the <![CDATA[ ]]>).
Interesting, this works okay in the lastest BaseX editor, but in OxygenXML (using the BaseX data source) this doesn't work. Does the XQJ connection not allow the declaring of options?
Thanks, Kevin
On Mon, Oct 24, 2011 at 3:28 PM, Kevin S. Clarke ksclarke@gmail.com wrote:
Hi,
I'm trying to conditionally output CDATA, but don't seem to be finding the right syntax for it.
This works:
declare option output:cdata-section-elements "div";
<div><![CDATA['<div/>']]></div>
But this doesn't:
declare option output:cdata-section-elements "div";
<div>{ if (1 = 2) then '' else <![CDATA['<div/>']]> }</div>
Any hints on how to do this?
Thanks! Kevin
Hi Kevin,
Interesting, this works okay in the lastest BaseX editor, but in OxygenXML (using the BaseX data source) this doesn't work. Does the XQJ connection not allow the declaring of options?
Yes, I could reproduce this behavior; I guess that the result is reinterpreted by the editor. Might be interesting to direct this to the oXygen mailing list as well..
Christian
basex-talk@mailman.uni-konstanz.de