You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2019/11/09 11:00:11 UTC

svn commit: r1869599 - /xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java

Author: fanningpj
Date: Sat Nov  9 11:00:10 2019
New Revision: 1869599

URL: http://svn.apache.org/viewvc?rev=1869599&view=rev
Log:
[XMLBEANS-548] support adding standalone flag to xml declaration

Modified:
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java?rev=1869599&r1=1869598&r2=1869599&view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java Sat Nov  9 11:00:10 2019
@@ -911,9 +911,16 @@ abstract class Saver {
                 if (version == null)
                     version = "1.0";
 
+                Boolean standalone = null;
+                if (props != null && props.get(XmlDocumentProperties.STANDALONE) != null)
+                    standalone = Boolean.valueOf("yes".equals(props.get(XmlDocumentProperties.STANDALONE)));
+
                 emit("<?xml version=\"");
                 emit(version);
-                emit("\" encoding=\"" + encoding + "\"?>" + _newLine);
+                emit( "\" encoding=\"" + encoding + "\"");
+                if (standalone != null)
+                    emit( " standalone=\"" + (standalone.booleanValue() ? "yes" : "no") + "\"");
+                emit( "?>" + _newLine );
             }
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org