You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by FERRERO Olivier <ol...@koedia.com> on 2006/08/05 00:23:00 UTC

How i can keep the CDATA elements

Hi,

I have some problems with CDATA elements.
When I parse a document with some CDATA, xmlbeans transform the characters
to remove CDATA.
In the same manner I don't know if there is a way to generate CDATA
elements.

Thanks for your help. 

Olivier.


RE: How i can keep the CDATA elements

Posted by FERRERO Olivier <ol...@koedia.com>.
 

Many Thanks for your help !

 

Olivier.

 

  _____  

From: Cezar Andrei [mailto:cezar@bea.com] 
Sent: samedi 5 août 2006 17:20
To: user@xmlbeans.apache.org
Subject: RE: How i can keep the CDATA elements

 

The SVN says it’s there:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbean
s/XmlOptions.java?r1=405903&r2=425480&diff_format=h

 

Did you sync to the latest version in SVN?

 

Cezar

 

 

  _____  

From: FERRERO Olivier [mailto:olivier.ferrero@koedia.com] 
Sent: Saturday, August 05, 2006 2:40 AM
To: user@xmlbeans.apache.org
Subject: RE: How i can keep the CDATA elements

 

Thank you for your reply,

In emails below Cezar said that we can find: 

XmlOptions setSaveCDataLengthThreshold() and
setSaveCDataEntityCountThreshold().

in the latest sources from SVN but I have downloaded them and I didn’t find
this option can you confirm that or/and where I can find these options ?.

 

Many Thanks,

 

Olivier.

 

  _____  

From: Wing Yew Poon [mailto:wpoon@bea.com] 
Sent: samedi 5 août 2006 03:53
To: user@xmlbeans.apache.org
Subject: RE: How i can keep the CDATA elements

 

XMLBeans does not preserve CDATA sections.

This has been addressed most recently on this mailing list by the following
posts:

 

----

From: Lewis, David [mailto:dlewis@pfc.cfs.nrcan.gc.ca] 
Sent: July 20, 2006 3:19 PM
To: user@xmlbeans.apache.org
Cc: Murphy, Eric
Subject: How to preserve CDATA sections?

Using XMLBeans 2.2.0, if I parse an XML document that contains CDATA
sections to escape blocks of text, when I save the document to a file system
– the CDATA sections are no longer preserved and literals that may be
interpreted as markup (such as an ampersand) are written out in their
escaped form. 

 

For example, it the source document contains:

<element><![CDATA[fred&ethyl]]></element>

… it is saved as:

<element>fred&amp;ethyl</element>

Any ideas how to preserve the CDATA sections?

 

Thanks!

~ David

----

and a reply 

 

----

From: Cezar Andrei [mailto:cezar@bea.com] 
Sent: July 26, 2006 12:29 PM
To: user@xmlbeans.apache.org; dev@xmlbeans.apache.org
Subject: RE: How to preserve CDATA sections?

Hi David,

 

This is an issue that was requested before, and we didn’t have a good answer
for it for quite a while. 

Since the CDATA is not part of the xml info set, the regular text and CDATA
are both stored as text in the xml in-memory store, so saving will not
preserve the CDATA blocks.

But, I checked in yesterday two new options that will allow one to control
when CDATA is used when saving to text: XmlOptions
setSaveCDataLengthThreshold() and setSaveCDataEntityCountThreshold().

So, get the latest sources from SVN and give it a try.

 

Cezar 

  _____  

From: FERRERO Olivier [mailto:olivier.ferrero@koedia.com] 
Sent: Friday, August 04, 2006 3:23 PM
To: user@xmlbeans.apache.org
Subject: How i can keep the CDATA elements

Hi,

I have some problems with CDATA elements.

When I parse a document with some CDATA, xmlbeans transform the characters
to remove CDATA.

In the same manner I don’t know if there is a way to generate CDATA
elements.

Thanks for your help. 

Olivier.

_______________________________________________________________________

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.

RE: How i can keep the CDATA elements

Posted by Cezar Andrei <ce...@bea.com>.
The SVN says it's there: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlOptions.java?r1=405903&r2=425480&diff_format=h

 

Did you sync to the latest version in SVN?

 

Cezar

 

 

________________________________

From: FERRERO Olivier [mailto:olivier.ferrero@koedia.com] 
Sent: Saturday, August 05, 2006 2:40 AM
To: user@xmlbeans.apache.org
Subject: RE: How i can keep the CDATA elements

 

Thank you for your reply,

In emails below Cezar said that we can find: 

XmlOptions setSaveCDataLengthThreshold() and setSaveCDataEntityCountThreshold().

in the latest sources from SVN but I have downloaded them and I didn't find this option can you confirm that or/and where I can find these options ?.

 

Many Thanks,

 

Olivier.

 

________________________________

From: Wing Yew Poon [mailto:wpoon@bea.com] 
Sent: samedi 5 août 2006 03:53
To: user@xmlbeans.apache.org
Subject: RE: How i can keep the CDATA elements

 

XMLBeans does not preserve CDATA sections.

This has been addressed most recently on this mailing list by the following posts:

 

----

From: Lewis, David [mailto:dlewis@pfc.cfs.nrcan.gc.ca] 
Sent: July 20, 2006 3:19 PM
To: user@xmlbeans.apache.org
Cc: Murphy, Eric
Subject: How to preserve CDATA sections?

Using XMLBeans 2.2.0, if I parse an XML document that contains CDATA sections to escape blocks of text, when I save the document to a file system - the CDATA sections are no longer preserved and literals that may be interpreted as markup (such as an ampersand) are written out in their escaped form. 

 

For example, it the source document contains:

<element><![CDATA[fred&ethyl]]></element>

... it is saved as:

<element>fred&amp;ethyl</element>

Any ideas how to preserve the CDATA sections?

 

Thanks!

~ David

----

and a reply 

 

----

From: Cezar Andrei [mailto:cezar@bea.com] 
Sent: July 26, 2006 12:29 PM
To: user@xmlbeans.apache.org; dev@xmlbeans.apache.org
Subject: RE: How to preserve CDATA sections?

Hi David,

 

This is an issue that was requested before, and we didn't have a good answer for it for quite a while. 

Since the CDATA is not part of the xml info set, the regular text and CDATA are both stored as text in the xml in-memory store, so saving will not preserve the CDATA blocks.

But, I checked in yesterday two new options that will allow one to control when CDATA is used when saving to text: XmlOptions setSaveCDataLengthThreshold() and setSaveCDataEntityCountThreshold().

So, get the latest sources from SVN and give it a try.

 

Cezar 

________________________________

From: FERRERO Olivier [mailto:olivier.ferrero@koedia.com] 
Sent: Friday, August 04, 2006 3:23 PM
To: user@xmlbeans.apache.org
Subject: How i can keep the CDATA elements

Hi,

I have some problems with CDATA elements.

When I parse a document with some CDATA, xmlbeans transform the characters to remove CDATA.

In the same manner I don't know if there is a way to generate CDATA elements.

Thanks for your help. 

Olivier.

_______________________________________________________________________
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.

RE: How i can keep the CDATA elements

Posted by FERRERO Olivier <ol...@koedia.com>.
Thank you for your reply,

In emails below Cezar said that we can find: 

XmlOptions setSaveCDataLengthThreshold() and
setSaveCDataEntityCountThreshold().

in the latest sources from SVN but I have downloaded them and I didn’t find
this option can you confirm that or/and where I can find these options ?.

 

Many Thanks,

 

Olivier.

 

  _____  

From: Wing Yew Poon [mailto:wpoon@bea.com] 
Sent: samedi 5 août 2006 03:53
To: user@xmlbeans.apache.org
Subject: RE: How i can keep the CDATA elements

 

XMLBeans does not preserve CDATA sections.

This has been addressed most recently on this mailing list by the following
posts:

 

----

From: Lewis, David [mailto:dlewis@pfc.cfs.nrcan.gc.ca] 
Sent: July 20, 2006 3:19 PM
To: user@xmlbeans.apache.org
Cc: Murphy, Eric
Subject: How to preserve CDATA sections?

Using XMLBeans 2.2.0, if I parse an XML document that contains CDATA
sections to escape blocks of text, when I save the document to a file system
– the CDATA sections are no longer preserved and literals that may be
interpreted as markup (such as an ampersand) are written out in their
escaped form. 

 

For example, it the source document contains:

<element><![CDATA[fred&ethyl]]></element>

… it is saved as:

<element>fred&amp;ethyl</element>

Any ideas how to preserve the CDATA sections?

 

Thanks!

~ David

----

and a reply 

 

----

From: Cezar Andrei [mailto:cezar@bea.com] 
Sent: July 26, 2006 12:29 PM
To: user@xmlbeans.apache.org; dev@xmlbeans.apache.org
Subject: RE: How to preserve CDATA sections?

Hi David,

 

This is an issue that was requested before, and we didn’t have a good answer
for it for quite a while. 

Since the CDATA is not part of the xml info set, the regular text and CDATA
are both stored as text in the xml in-memory store, so saving will not
preserve the CDATA blocks.

But, I checked in yesterday two new options that will allow one to control
when CDATA is used when saving to text: XmlOptions
setSaveCDataLengthThreshold() and setSaveCDataEntityCountThreshold().

So, get the latest sources from SVN and give it a try.

 

Cezar 

  _____  

From: FERRERO Olivier [mailto:olivier.ferrero@koedia.com] 
Sent: Friday, August 04, 2006 3:23 PM
To: user@xmlbeans.apache.org
Subject: How i can keep the CDATA elements

Hi,

I have some problems with CDATA elements.

When I parse a document with some CDATA, xmlbeans transform the characters
to remove CDATA.

In the same manner I don’t know if there is a way to generate CDATA
elements.

Thanks for your help. 

Olivier.

_______________________________________________________________________

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.

RE: How i can keep the CDATA elements

Posted by Wing Yew Poon <wp...@bea.com>.
XMLBeans does not preserve CDATA sections.
This has been addressed most recently on this mailing list by the
following posts:
 
----
From: Lewis, David [mailto:dlewis@pfc.cfs.nrcan.gc.ca] 
Sent: July 20, 2006 3:19 PM
To: user@xmlbeans.apache.org
Cc: Murphy, Eric
Subject: How to preserve CDATA sections? 

Using XMLBeans 2.2.0, if I parse an XML document that contains CDATA
sections to escape blocks of text, when I save the document to a file
system - the CDATA sections are no longer preserved and literals that
may be interpreted as markup (such as an ampersand) are written out in
their escaped form. 

For example, it the source document contains:

<element><![CDATA[fred&ethyl]]></element>

... it is saved as:

<element>fred&amp;ethyl</element> 

Any ideas how to preserve the CDATA sections?

Thanks! 

~ David 

----

and a reply 
 
----
From: Cezar Andrei [mailto:cezar@bea.com] 
Sent: July 26, 2006 12:29 PM
To: user@xmlbeans.apache.org; dev@xmlbeans.apache.org
Subject: RE: How to preserve CDATA sections? 

Hi David,

This is an issue that was requested before, and we didn't have a good
answer for it for quite a while. 

Since the CDATA is not part of the xml info set, the regular text and
CDATA are both stored as text in the xml in-memory store, so saving will
not preserve the CDATA blocks.

But, I checked in yesterday two new options that will allow one to
control when CDATA is used when saving to text: XmlOptions
setSaveCDataLengthThreshold() and setSaveCDataEntityCountThreshold(). 

So, get the latest sources from SVN and give it a try.

Cezar 

________________________________

From: FERRERO Olivier [mailto:olivier.ferrero@koedia.com] 
Sent: Friday, August 04, 2006 3:23 PM
To: user@xmlbeans.apache.org
Subject: How i can keep the CDATA elements



Hi,

I have some problems with CDATA elements.

When I parse a document with some CDATA, xmlbeans transform the
characters to remove CDATA.

In the same manner I don't know if there is a way to generate CDATA
elements.

Thanks for your help. 

Olivier.

_______________________________________________________________________
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.