commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jeevitesh (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CONFIGURATION-594) Adding CData to xml property
Date Wed, 07 Jan 2015 05:55:34 GMT
jeevitesh created CONFIGURATION-594:
---------------------------------------

             Summary: Adding CData to xml property
                 Key: CONFIGURATION-594
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-594
             Project: Commons Configuration
          Issue Type: Bug
          Components: Type conversion
    Affects Versions: 2.0-alpha1
            Reporter: jeevitesh
            Priority: Critical


Need to add CDATA into XML Property element, but special character are getting added. Here
is my code. Please give your thoughts on the same.
Here is the code.
String cDataTagStart="\\<![CDATA[";
String cDataTagEnd="]]\\>";
credentialsURL =cDataTagStart+credentialsURL+cDataTagEnd;
xmlContentOfMetaData = CredentialProvider.getInstance();
xmlContentOfMetaData.addProperty("Resource(-1).ResourceName", resourceName);
xmlContentOfMetaData.addProperty("Resource.ResourceURL", credentialsURL);
 
But Special characters are getting added
ResourceName>TESTRESOURCENAME</ResourceName>
<ResourceURL>\&lt;![CDATA[TESTCredentialsURLS2]]\&gt;</ResourceURL>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message