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

XMLHelper string2Doc ignores parameter #33

Open
vstange opened this issue Feb 18, 2019 · 1 comment
Open

XMLHelper string2Doc ignores parameter #33

vstange opened this issue Feb 18, 2019 · 1 comment

Comments

@vstange
Copy link
Member

vstange commented Feb 18, 2019

The string2Doc in XMLHelper ignores the namespaceAwareness parameter.

 /**
     * Helper program: Transforms a String to a XML Document.
     *
     * @param inputXMLString     the input xml string
     * @param namespaceAwareness the namespace awareness
     * @return parsed document
     */
    public static Document string2Doc(String inputXMLString, boolean namespaceAwareness) {
        try {
            return XmlDocumentReader.parse(inputXMLString, false);
        } catch (IOException | SAXException e) {
            log.error("Cannot parse XML string.", e);
            return null;
        }
//        try {
//            DocumentBuilder builder = getDocumentBuilder(namespaceAwareness);
//            InputSource is = new InputSource(new StringReader(inputXMLString));
//            is.setEncoding("UTF-8");
//            return builder.parse(is);
//        } catch (SAXException | ParserConfigurationException | IOException e) {
//            log.error("cannot parse following content\n\n" + inputXMLString);
//            e.printStackTrace();
//            return null;
//        }
    }
@vstange
Copy link
Member Author

vstange commented Feb 18, 2019

@physikerwelt Do you know if that was a conscious decision?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant