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-unsubscr...@poi.apache.org
For additional commands, e-mail: commits-h...@poi.apache.org

Reply via email to