Parsing malformed/incomplete/invalid XML files?

You could try to use JSoup to parse the invalid XML. By definition XML should be well-formed, otherwise it's invalid and should not be used.

You could try to use JSoup to parse the invalid XML. By definition XML should be well-formed, otherwise it's invalid and should not be used. UPDATE - example: public static void main(String args) { for (Node node : Parser.

ParseFragment("" , new Element(Tag. ValueOf("p"), ""), "")) { print(node, 0); } } public static void print(Node node, int offset) { for (int I = 0; I Print(node.nodeName()); for (Attribute attribute: node.attributes()) { System.out. Print(", "); System.out.

Print(attribute.getKey() + "=" + attribute.getValue()); } System.out.println(); for (Node child : node.childNodes()) { print(child, offset + 4); } }.

Thanks - I think this is specific to HTML documents. I am not working with HTML. – ziggy Aug 8 at 12:32 @ziggy: Give parseFragment() a try!

See my update. – Vlad Aug 8 at 13:03 aha.. that is interesting. I will check it out.

Thanks – ziggy Aug 8 at 13:19 You can also do stuff like Parser. ParseBodyFragment(fragment, ""). GetElementsByTag("author") – Vlad Aug 8 at 13:22.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions