Skip to content

Updated WWXML to support configuration of OutputKeys to format XML#23

Open
rougeSE wants to merge 1 commit intoNASAWorldWind:masterfrom
rougeSE:config-xml-transformer
Open

Updated WWXML to support configuration of OutputKeys to format XML#23
rougeSE wants to merge 1 commit intoNASAWorldWind:masterfrom
rougeSE:config-xml-transformer

Conversation

@rougeSE
Copy link
Copy Markdown

@rougeSE rougeSE commented Oct 20, 2016

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:

  1. 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.

  2. 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"/>

  3. 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"/>

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants