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

Element.toXMLString() does not escape < > #76

Open
jjaquinta opened this issue Apr 13, 2017 · 0 comments
Open

Element.toXMLString() does not escape < > #76

jjaquinta opened this issue Apr 13, 2017 · 0 comments

Comments

@jjaquinta
Copy link

This function does a very primitive converstion of text data:

        } else { // add value if any
            if (value != null) {
                s.append(">").append((""));
                final String stringValue = value.toString().replaceAll("&",
                        "&amp;");
                s.append(getIndentationSpacing(false, indent));
                s.append(stringValue).append((""));
            } else {

Basically, it only escapes &. This is a problem for me as I have < and > in the data I am retrieving.
Even doing a hack like:

                final String stringValue = value.toString().replaceAll("&",
                        "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");

would fix it for me.

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

1 participant