Here is a rough patch. I haven't tested it extensively. There is a bug in loading a document the standalone decl as can be seen in the output from running test.java:
Original xml: <hello/> Default: <?xml version="1.0" encoding="UTF-8"?> <hello/> set standalone=true: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <hello/> set standalone=false: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <hello/> remove standalone <?xml version="1.0" encoding="UTF-8"?> <hello/> Original xml: <?xml version='1.0' standalone='yes'?> <hello/> Default: <?xml version="1.0" encoding="UTF-8"?> <hello/> set standalone=true: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <hello/> set standalone=false: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <hello/> remove standalone <?xml version="1.0" encoding="UTF-8"?> <hello/> On Thu, May 12, 2011 at 5:12 AM, pgillen <paul.d.gil...@gmail.com> wrote: > I tried that without effect. Be interested to hear others experience. > -paul- > > --------- > Paul Gillen > ------------------------------ > *From: * Jacob Danner <jacob.dan...@gmail.com> > *Date: *Wed, 11 May 2011 18:24:34 -0700 > *To: *<user@xmlbeans.apache.org> > *ReplyTo: * user@xmlbeans.apache.org > *Subject: *Re: How to add standalone attribute > > Take a look at XmlDocumentProperties.setstandalone(...) > -jacobd > On May 10, 2011 11:47 AM, "Roman Kashitsyn" <romankashi...@gmail.com> > wrote: > > > > How can I add standalone="yes" attribute to "xml" processing instruction > when > > saving xmlbean? Suppose I had an xmlbean and I want to save it in the > > following way: > > > > > > XmlOptions xmlOptions = new XmlOptions(); > > xmlOptions.setSaveOuter(); > > xmlOptions.setSaveSyntheticDocumentElement(new QName(NAMESPACE_URI, > > TAG_NAME, PREFIX)); > > > > /* some magic happens here */ > > > > bean.save(anOutputStream, xmlOptions) > > > > > > Now I get the following result: > > > > <?xml version="1.0" encoding="utf-8"?> > > <!-- perfectly well xml file --> > > > > > > How can I get the following result: > > > > <?xml version="1.0" encoding="utf-8" standalone="yes"?> > > <!-- perfectly well xml file --> > > > > ??? > > -- > > View this message in context: > http://old.nabble.com/How-to-add-standalone-attribute-tp31586761p31586761.html > > Sent from the Xml Beans - User mailing list archive at Nabble.com. >
standalone.patch
Description: Binary data
test.java
Description: Binary data
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org