jaxb-ri icon indicating copy to clipboard operation
jaxb-ri copied to clipboard

FAQ answer on CDATA uses deprecated solution

Open Tomas-Kraus opened this issue 15 years ago • 5 comments

https://jaxb.dev.java.net/faq/index.html#marshalling_cdata suggests using Apache Xerces-J XMLSerializer, which is deprecated as of version 2.9.

Is there another method of achieving the same results that isn't deprecated?

Environment

Operating System: All Platform: All

Affected Versions

[2.1.12]

Tomas-Kraus avatar Aug 25 '09 13:08 Tomas-Kraus

  • Issue Imported From: https://github.com/javaee/jaxb-v2/issues/682
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: @glassfishrobot

Tomas-Kraus avatar Sep 21 '18 15:09 Tomas-Kraus

@glassfishrobot Commented Reported by jpleed3

Tomas-Kraus avatar Aug 25 '09 13:08 Tomas-Kraus

@glassfishrobot Commented tjstavenger said: Xerces-J offers the following replacements for the classes in the org.apache.xml.serialize package: http://xerces.apache.org/xerces2-j/faq-general.html#faq-6

However, from what I can tell, neither the LSSerializer nor the Transformer classes fit well into the JAXB API. In particular, neither implement the ContentHandler interface to change the text elements to CDATA while marshalling.

This leaves an implementation with two options:

1. Use the Sun internal implementation at com.sun.org.apache.xml.internal.serialize

2. Use the deprecated Xerces-J implementation

Neither of which are good solutions long-term.

Tomas-Kraus avatar Nov 05 '09 12:11 Tomas-Kraus

@glassfishrobot Commented Was assigned to snajper

Tomas-Kraus avatar Aug 25 '09 13:08 Tomas-Kraus

@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-682

Tomas-Kraus avatar Apr 24 '17 12:04 Tomas-Kraus