Updated WWXML to support configuration of OutputKeys to format XML#23
Open
rougeSE wants to merge 1 commit intoNASAWorldWind:masterfrom
Open
Updated WWXML to support configuration of OutputKeys to format XML#23rougeSE wants to merge 1 commit intoNASAWorldWind:masterfrom
rougeSE wants to merge 1 commit intoNASAWorldWind:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"/>