| Summary: | CDATAs in TopicXML are converted to <foo> when you export the XML | ||
|---|---|---|---|
| Product: | [Community] PressGang CCMS | Reporter: | sgilda |
| Component: | Web-UI | Assignee: | sgilda |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | urgent | Docs Contact: | |
| Priority: | urgent | ||
| Version: | 1.x | CC: | topic-tool-list |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-10-19 23:08:28 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
Many of my topics contain xml snippets. I am not able to edit those topics without messing up all the CDATAs until this bug is fixed. The topic displays fine, but it would be a maintenance nightmare to try to maintain the source code with < instead of CDATAs. Is there an option on the XML API to prevent converting CDATAs? Fixed in 20110901-0957
Turns out this code:
final DOMImplementationLS impl = (DOMImplementationLS)DOMImplementationRegistry.newInstance().getDOMImplementation("LS");
final LSParser builder = impl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
final LSInput xmlFile = impl.createLSInput();
xmlFile.setByteStream(new ByteArrayInputStream(xml.getBytes(encoding)));
final Document document = builder.parse(xmlFile);
will coalesce CDATA elements. I couldn't find any way to disable it. Changed to this code:
final DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
final DocumentBuilder builder = builderFactory.newDocumentBuilder();
final Document document = builder.parse(new ByteArrayInputStream(xml.getBytes(encoding)));
works as expected. |
Description of problem: I enter and save topic XML containing the following: <programlisting language="XML"> <![CDATA[<servlet-mapping> <servlet-name>javax.ws.rs.core.Application</servlet-name> <url-pattern>/hello/*</url-pattern> </servlet-mapping>]]> </programlisting> When I export the TopicXML for that topic, it exports like this: <programlisting language="XML"> <servlet-mapping> <servlet-name>javax.ws.rs.core.Application</servlet-name> <url-pattern>/hello/*</url-pattern> </servlet-mapping> </programlisting> Version-Release number of selected component (if applicable): How reproducible: Add the topicXML data as described above. Save the topic. Then export that topicXML. Steps to Reproduce: 1. Add the topicXML data as described above. 2. Then export that topicXML. 3. Actual results: Expected results: Additional info: