Bryce Fosdick
Mon, 19 May 2008 14:27:12 -0700
Ok so I downloaded the 2.4 source, and updated everything needed to get it
working but I am still having problems using the CDATA.
If I create a Key xmlobject, the setUseCDataBookmarks seems to be working
correctly because if I print the xmlText it displays <Key><!
[CDATA[ABCDE12345]]></Key>
The problem is I am trying use node.setKey(xml), where xml is the string <!
[CDATA[ABCDE12345]]>
Everything I have tried results in:
<![CDATA[ABCDE12345]]>
Any suggestions?
Thanks for your help in advance.
On Friday 16 May 2008 14:50:07 Radu Preotiuc-Pietro wrote:
> In regards to CDATA handling, in XMLBeans < 2.3 there is no way to
> influence the algorithm that XMLBeans uses to decide when to put a CDATA
> in the output document and when not to (please note, that from the XML
> Infoset point of view, use of CDATA section is not relevant as far as
> the content of the document, so <Key><![CDATA[ABCDE12345]]></Key> is
> equivalent to <Key>ABCDE12345</Key>).
>
> In XMLBeans 2.3 there are some limited ways to influence when CDATA
> sections get used, the relevant XmlOptions are
> "setSaveCDataLengthThreshold" and "setSaveCDataEntityCountThreshold".
> These XmlOptions must be used when saving the document
> (node.xmlText(options)).
>
> In XMLBeans > 2.3 there is a better way to control CDATA sections usage,
> if you have access to the SVN source, see XmlOptions
> "setUseCDataBookmarks" (this option must be used on newInstance, like
> you suspected).
>
> Hope this helps,
> Radu
>
> > -----Original Message-----
> > From: Bryce Fosdick [EMAIL PROTECTED]
> > Sent: Thursday, May 15, 2008 11:49 AM
> > To: user@xmlbeans.apache.org
> > Subject: CDATA Example
> >
> > I am needing to create a CDATA element, but I am having no
> > luck and I can't find a good example.
> >
> > The contents will always be 10 characters, padded with right
> > spaces if needed.
> >
> > Here is an example of what needs to be created:
> > <Key><![CDATA[ABCDE12345]]></Key>
> >
> > Here is the path I was heading down:
> > XmlOptions options = new XmlOptions();
> > ... (I'm not sure what these should be)
> > XmlString xml = XmlString.Factory.newInstance(options);
> > xml.setStringValue("ABCDE12345");
> > node.setKey(xml.getStringValue());
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> Notice: This email message, together with any attachments, may contain
> information of BEA Systems, Inc., its subsidiaries and affiliated
> entities, that may be confidential, proprietary, copyrighted and/or
> legally privileged, and is intended solely for the use of the individual or
> entity named in this message. If you are not the intended recipient, and
> have received this message in error, please immediately return this by
> email and then delete it.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]