XML-Validation</strong></p>
The actual parsing of Nifty-XML files is still using a XPP3 based parser and does not require a XML-Schema Definition. The nifty.xsd was only added to validate Nifty XML-Files ... as well as for special support of the jMonkeyEngine3 SDK but that will be explained somewhere else :) XML-Validation is now build into Nifty but is still an optional step you can use to ensure your Nifty XML is well formed and valid. To perform the actual validation two new methods have been added to the Nifty class: To successfully validate the nifty xml file, your xml file should start with the two following lines:public void validateXml(final String filename) throws Exception
public void validateXml(final InputStream stream) throws Exception</pre>
Both methods will simply return or will throw an Exception when any errors have been detected.</p>
This way the XML-File is using the correct Nifty Namespace. If you would omit these declarations your XML-File can still be parsed but it will probably not validate against the XSD.</p>