WorldWindJava
WorldWindJava copied to clipboard
Updated WWXML to support configuration of OutputKeys to format XML
Change WWXML to allow for configuring the OutputKeys that control the output of the XML created from a Transformer. This is primarily to allow for pretty printing XML docs. Also updated RestorableSupport to allow configuring the XML produced by this class independantly from WWXML. This allows for the XML created to be embedded into other XML documents by disabling the xml-declaration. Updated other classes that was directly creating Transformers and use the WWXML.createTransformer() to allow for global configuration of XML generation.
To test:
-
Verified backwards compatibility Ran the PersistantSessionState example, verifying that the XML state files created where still a single line of XML and that the state was restored on subsequent restarts.
-
Tested configurablity of WWXML. Add the following entries to the worldwind.xml file, and then verified that the PersistantSessionState files were now saved pretty printed. Verified that state was restored properly from pretty printed files.
<Property name="gov.nasa.worldwind.util.WWXML.outputkey.1" value="indent,yes"/> <Property name="gov.nasa.worldwind.util.WWXML.outputkey.2" value="{http://xml.apache.org/xslt}indent-amount,4"/> -
Test configurablity of RestorableSupport. Add the following entry while keeping settings from test case 2, and verified that the restorable state files where pretty printed and no longer contained the <?xml ...> declaration.
<Property name="gov.nasa.worldwind.util.RestorableSupport.outputkey.1" value="omit-xml-declaration,yes"/>