Create('filename') overload instead of passing in String Reader to avoid having to load the body of xml into memory first, otherwise your not gaining much over convenience of Xml Document, if any...though i'm only on my first cup o coffee so take that with a grain of salt!:) Yes, there is some overhead, but you should be performing sanity checks like this anyway.After spending 3 hours of my life trying to resolve the following error message: The element cannot contain white space.Content model is empty I decided to share my solution in hope that this will help somebody else.You may update this document type using the File Info panel (from the "File" menu).
I've added a print statement to tell me when a file is successfully loaded but only "/XML/Items/Armor/Sword.xml" ever successfully finishes.
Design your Java objects holding your data first and then either use JAXB or XStream to write them as a XML file or read them from a XML file into an object.
With this you can avoid all this parsing code and all problems around that.
Or you can also modify the source XML by using DOM concept from host code like . Or the other way is to treat XML as string and use string manipulation technique.
I get simple xml content from a request after a certain ID.