Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special character in mehtod toXMLString not getting escaped. #90

Closed
rest17 opened this issue May 11, 2020 · 1 comment
Closed

Special character in mehtod toXMLString not getting escaped. #90

rest17 opened this issue May 11, 2020 · 1 comment

Comments

@rest17
Copy link

rest17 commented May 11, 2020

String xml = "<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"\n"
+ " message-id="3">\n"
+ " <edit-config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">\n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " QAZxswedcvgfyjuegrthnyjmkergthyjuerghtyjuerghtyc@#$%^&()(&^%$#@~QWERTYUIOPLKJHGFDSAZXCVBNM<>\n"
+ " example.com\n"
+ " 2001:db8:3000:3000::42\n"
+ " \n"
+ "

2001:db8:2000:2000::33\n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ "";
XMLParser parser=new XMLParser();
com.tailf.jnc.Element parse2=parser.parse( String xml);
com.tailf.jnc.Element config=parse2.getChild("?").getChild("");
System.out.println("Children Parser "+ config.getChildren().toXMLString());

parse2.parse(""+config.getChildren().toXMLString()+ "") // this will fail since after parsing the xml once and then using toXMlString() to create the DOM object again with unescape character is causing it to fail.

@martin-volf
Copy link
Contributor

Duplicate of #76

@martin-volf martin-volf marked this as a duplicate of #76 Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants