Skip to content

Commit 97f1b81

Browse files
committed
[feature] Serialize preserved XML Declaration by default from Java Admin Client
1 parent d614204 commit 97f1b81

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

exist-core/src/main/java/org/exist/client/InteractiveClient.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
import se.softhouse.jargo.ArgumentException;
9090

9191
import static java.nio.charset.StandardCharsets.UTF_8;
92+
import static javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION;
93+
import static org.exist.storage.serializers.EXistOutputKeys.OMIT_ORIGINAL_XML_DECLARATION;
9294
import static org.exist.storage.serializers.EXistOutputKeys.OUTPUT_DOCTYPE;
9395
import static org.xmldb.api.base.ResourceType.XML_RESOURCE;
9496

@@ -143,6 +145,8 @@ public class InteractiveClient {
143145
DEFAULT_PROPERTIES.setProperty(USER, USER_DEFAULT);
144146
DEFAULT_PROPERTIES.setProperty(EDITOR, EDIT_CMD);
145147
DEFAULT_PROPERTIES.setProperty(INDENT, "true");
148+
DEFAULT_PROPERTIES.setProperty(OMIT_XML_DECLARATION, "no");
149+
DEFAULT_PROPERTIES.setProperty(OMIT_ORIGINAL_XML_DECLARATION, "no");
146150
DEFAULT_PROPERTIES.setProperty(OUTPUT_DOCTYPE, "true");
147151
DEFAULT_PROPERTIES.setProperty(ENCODING, ENCODING_DEFAULT.name());
148152
DEFAULT_PROPERTIES.setProperty(COLORS, "false");

exist-distribution/src/main/config/client.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,7 @@ highlight-matches=none
5151

5252
## output the doctype of documents
5353
output-doctype=yes
54+
55+
## output the XML Declaration of documents, and then preferably the persisted XML Declaration
56+
omit-xml-declaration=no
57+
omit-original-xml-declaration=no

0 commit comments

Comments
 (0)