DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14531>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14531 XML Serialization: standalone attribute should not be suppressed when no public/system id Summary: XML Serialization: standalone attribute should not be suppressed when no public/system id Product: Xerces2-J Version: 2.2.0 Platform: All OS/Version: All Status: NEW Severity: Normal Priority: Other Component: Serialization AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Currently, the XMLSerializer class outputs the "standalone" attribute of the <?xml ...?> prolog if-and-only-if the public and system identifiers being output in the DOCTYPE tag are null. It seems to me to be perfectly valid to have standalone="yes" AND public/system IDs. The relevant section of the xml spec is: http://www.w3.org/TR/REC-xml#sec-rmd No mention is made here of forbidding standalone=yes when a DTD ID is given in the DOCTYPE tag. If a document has DTDs specified via public or system ID: standalone="yes" --> the DTD must be read if-and-only-if validation is enabled. (ie DTD can be ignored if validation disabled, a good optimisation!) standalone="no" --> the DTD must always be read, even if validation is disabled, because there are default values for attributes, etc. which must be applied even though the document validity is not being checked. Suggested changes: XMLSerializer line 1414: remove check for doctype attributes OutputFormat: change javadoc for setStandalone method In addition, it would be nice to have an omitStandaloneDeclaration attribute on the OutputFormat (defaulting to true), which would suppress "standalone='no'" output, but not suppress "standalone='yes'". This would allow the caller to decide whether they want the explicit (but technically redundant) standalone='no' specifier to be output or not. This is somewhat inconsistent with the way omitXMLDeclaration and omitDoctypeDeclaration are currently used (but see my other bug entry re XMLSerializer and OutputFormat usage, which suggests a fix for this). --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]