--- old/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java 2015-10-16 12:57:38.000000000 +0200 +++ new/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/marshaller/XMLWriter.java 2015-10-16 12:57:38.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -91,11 +91,11 @@ * *

The resulting document will look like this:

* - *
- * <?xml version="1.0" standalone="yes"?>
+ * 
{@code
+ * 
  *
- * <greeting>Hello, world!</greeting>
- * 
+ * Hello, world! + * }
* *

In fact, there is an even simpler convenience method, * dataElement, designed for writing elements that @@ -125,9 +125,9 @@ * *

you will end up with

* - *
- * <item>1</item><item>3</item><item>3</item>
- * 
+ *
{@code
+ * 133
+ * }
* *

You need to invoke one of the characters methods * explicitly to add newlines or indentation. Alternatively, you @@ -154,11 +154,11 @@ * *

The resulting document will look like this:

* - *
- * <?xml version="1.0" standalone="yes"?>
+ * 
{@code
+ * 
  *
- * <_NS1:foo xmlns:_NS1="http://www.foo.com/ns/"/>
- * 
+ * <_NS1:foo xmlns:_NS1="http://www.foo.com/ns/"/> + * }
* *

In many cases, document authors will prefer to choose their * own prefixes rather than using the (ugly) default names. The @@ -175,11 +175,11 @@ * *

The resulting document will look like this:

* - *
- * <?xml version="1.0" standalone="yes"?>
+ * 
{@code
+ * 
  *
- * <foo:foo xmlns:foo="http://www.foo.com/ns/"/>
- * 
+ * + * }
* *

The default Namespace simply uses an empty string as the prefix:

* @@ -192,28 +192,28 @@ * *

The resulting document will look like this:

* - *
- * <?xml version="1.0" standalone="yes"?>
+ * 
{@code
+ * 
  *
- * <foo xmlns="http://www.foo.com/ns/"/>
- * 
+ * + * }
* *

By default, the XML writer will not declare a Namespace until * it is actually used. Sometimes, this approach will create * a large number of Namespace declarations, as in the following * example:

* - *
- * <xml version="1.0" standalone="yes"?>
+ * 
{@code
+ * 
  *
- * <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- *  <rdf:Description about="http://www.foo.com/ids/books/12345">
- *   <dc:title xmlns:dc="http://www.purl.org/dc/">A Dark Night</dc:title>
- *   <dc:creator xmlns:dc="http://www.purl.org/dc/">Jane Smith</dc:title>
- *   <dc:date xmlns:dc="http://www.purl.org/dc/">2000-09-09</dc:title>
- *  </rdf:Description>
- * </rdf:RDF>
- * 
+ * + * + * A Dark Night + * Jane Smith + * 2000-09-09 + * + * + * }
* *

The "rdf" prefix is declared only once, because the RDF Namespace * is used by the root element and can be inherited by all of its @@ -230,18 +230,18 @@ * though it's not needed there, and can be inherited by its * descendants:

* - *
- * <xml version="1.0" standalone="yes"?>
+ * 
{@code
+ * 
  *
- * <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ * 
- *  <rdf:Description about="http://www.foo.com/ids/books/12345">
- *   <dc:title>A Dark Night</dc:title>
- *   <dc:creator>Jane Smith</dc:title>
- *   <dc:date>2000-09-09</dc:title>
- *  </rdf:Description>
- * </rdf:RDF>
- * 
+ * + * A Dark Night + * Jane Smith + * 2000-09-09 + * + * + * }
* *

This approach is also useful for declaring Namespace prefixes * that be used by qualified names appearing in attribute values or @@ -372,7 +372,7 @@ /** * Set whether the writer should print out the XML declaration - * (<?xml version='1.0' ... ?>). + * ({@code }). *

* This option is set to true by default. */