Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve all internal comments #419

Conversation

ArkaprabhaChakraborty
Copy link
Contributor

@ArkaprabhaChakraborty ArkaprabhaChakraborty commented Mar 11, 2023

While the external comments outside the root element tag cannot be preserved due to how the XML Tree is built by the TreeBuilder, the internal comments can be saved and this PR aims at that task

Related #395

Signed-off-by: ArkaprabhaChakraborty <chakrabortyarkaprabha998@gmail.com>
@llxia
Copy link
Contributor

llxia commented Mar 20, 2023

@karianna
Copy link
Contributor

@ArkaprabhaChakraborty Are you able to update the PR?

@ArkaprabhaChakraborty
Copy link
Contributor Author

ArkaprabhaChakraborty commented Mar 30, 2023

Yep, previously if comments were within the root element's body they were not preserved. So if we consider the following input:

<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../TKG/playlist.xsd">
     <!--Test playlist for the OpenJ9 project.-->
          <test>
		<testCaseName>jcstress_BooleanFencedTest</testCaseName>
		<command>$(JAVA_COMMAND) $(JVM_OPTIONS) -jar $(Q)$(LIB_DIR)$(D)jcstress-tests-all-20220908.jar$(Q) $(APPLICATION_OPTIONS) -t BooleanFencedTest; \
			$(TEST_STATUS)</command>
		<levels>

We would have lost the following tag:

 <!--Test playlist for the OpenJ9 project.-->

But now it will preserve all the comments under the root element. So the output now will be the same as the above input

@karianna karianna requested a review from llxia March 31, 2023 01:21
@llxia llxia merged commit ef484e0 into adoptium:master Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants