< prev index next >

src/java.xml/share/classes/javax/xml/stream/XMLStreamWriter.java

Print this page

        

*** 41,174 **** * <table class="striped"> * <caption>XML Namespaces, {@code javax.xml.stream.isRepairingNamespaces} and write method behaviour</caption> * <thead> * <tr style="border-bottom: 1px solid black"> * <th>Method</th> <!-- method --> ! * <th colspan="2">{@code isRepairingNamespaces} == true</th> ! * <th colspan="2">{@code isRepairingNamespaces} == false</th> * </tr> * <tr> * <th></th> <!-- method --> ! * <th>namespaceURI bound</th> ! * <th>namespaceURI unbound</th> ! * <th>namespaceURI bound</th> ! * <th>namespaceURI unbound</th> * </tr> * </thead> * * <tbody> * <tr> ! * <th>{@code writeAttribute(namespaceURI, localName, value)}</th> * <!-- isRepairingNamespaces == true --> ! * <td> * <!-- namespaceURI bound --> * prefix:localName="value"&nbsp;<sup>[1]</sup> * </td> ! * <td> * <!-- namespaceURI unbound --> * xmlns:{generated}="namespaceURI" {generated}:localName="value" * </td> * <!-- isRepairingNamespaces == false --> ! * <td> * <!-- namespaceURI bound --> * prefix:localName="value"&nbsp;<sup>[1]</sup> * </td> ! * <td> * <!-- namespaceURI unbound --> * {@code XMLStreamException} * </td> * </tr> * * <tr> ! * <th>{@code writeAttribute(prefix, namespaceURI, localName, value)}</th> * <!-- isRepairingNamespaces == true --> ! * <td> * <!-- namespaceURI bound --> * bound to same prefix:<br> * prefix:localName="value"&nbsp;<sup>[1]</sup><br> * <br> * bound to different prefix:<br> * xmlns:{generated}="namespaceURI" {generated}:localName="value" * </td> ! * <td> * <!-- namespaceURI unbound --> * xmlns:prefix="namespaceURI" prefix:localName="value"&nbsp;<sup>[3]</sup> * </td> * <!-- isRepairingNamespaces == false --> ! * <td> * <!-- namespaceURI bound --> * bound to same prefix:<br> * prefix:localName="value"&nbsp;<sup>[1][2]</sup><br> * <br> * bound to different prefix:<br> * {@code XMLStreamException}<sup>[2]</sup> * </td> ! * <td> * <!-- namespaceURI unbound --> * xmlns:prefix="namespaceURI" prefix:localName="value"&nbsp;<sup>[2][5]</sup> * </td> * </tr> * * <tr> ! * <th>{@code writeStartElement(namespaceURI, localName)}<br> * <br> * {@code writeEmptyElement(namespaceURI, localName)}</th> * <!-- isRepairingNamespaces == true --> ! * <td > * <!-- namespaceURI bound --> * {@code <prefix:localName>}&nbsp;<sup>[1]</sup> * </td> ! * <td> * <!-- namespaceURI unbound --> * {@code <{generated}:localName xmlns:{generated}="namespaceURI">} * </td> * <!-- isRepairingNamespaces == false --> ! * <td> * <!-- namespaceURI bound --> * {@code prefix:localName>}&nbsp;<sup>[1]</sup> * </td> ! * <td> * <!-- namespaceURI unbound --> * {@code XMLStreamException} * </td> * </tr> * * <tr> ! * <th>{@code writeStartElement(prefix, localName, namespaceURI)}<br> * <br> * {@code writeEmptyElement(prefix, localName, namespaceURI)}</th> * <!-- isRepairingNamespaces == true --> ! * <td> * <!-- namespaceURI bound --> * bound to same prefix:<br> * {@code <prefix:localName>}&nbsp;<sup>[1]</sup><br> * <br> * bound to different prefix:<br> * {@code <{generated}:localName xmlns:{generated}="namespaceURI">} * </td> ! * <td> * <!-- namespaceURI unbound --> * {@code <prefix:localName xmlns:prefix="namespaceURI">}&nbsp;<sup>[4]</sup> * </td> * <!-- isRepairingNamespaces == false --> ! * <td> * <!-- namespaceURI bound --> * bound to same prefix:<br> * {@code <prefix:localName>}&nbsp;<sup>[1]</sup><br> * <br> * bound to different prefix:<br> * {@code XMLStreamException} * </td> ! * <td> * <!-- namespaceURI unbound --> * {@code <prefix:localName>}&nbsp; * </td> * </tr> * </tbody> ! * <tfoot> ! * <tr> ! * <td colspan="5"> * Notes: * <ul> * <li>[1] if namespaceURI == default Namespace URI, then no prefix is written</li> * <li>[2] if prefix == "" || null {@literal &&} namespaceURI == "", then * no prefix or Namespace declaration is generated or written</li> --- 41,173 ---- * <table class="striped"> * <caption>XML Namespaces, {@code javax.xml.stream.isRepairingNamespaces} and write method behaviour</caption> * <thead> * <tr style="border-bottom: 1px solid black"> * <th>Method</th> <!-- method --> ! * <th id="repTrue" colspan="2">{@code isRepairingNamespaces} == true</th> ! * <th id="repFalse" scope="col" colspan="2">{@code isRepairingNamespaces} == false</th> * </tr> * <tr> * <th></th> <!-- method --> ! * <th id="repTrueBound">namespaceURI bound</th> ! * <th id="repTrueUnbound">namespaceURI unbound</th> ! * <th id="repFalseBound">namespaceURI bound</th> ! * <th id="repFalseUnbound">namespaceURI unbound</th> * </tr> * </thead> * * <tbody> * <tr> ! * <th id="writeAttr">{@code writeAttribute(namespaceURI, localName, value)}</th> * <!-- isRepairingNamespaces == true --> ! * <td headers="writeAttr repTrue repTrueBound"> * <!-- namespaceURI bound --> * prefix:localName="value"&nbsp;<sup>[1]</sup> * </td> ! * <td headers="writeAttr repTrue repTrueUnbound"> * <!-- namespaceURI unbound --> * xmlns:{generated}="namespaceURI" {generated}:localName="value" * </td> * <!-- isRepairingNamespaces == false --> ! * <td headers="writeAttr repFalse repFalseBound"> * <!-- namespaceURI bound --> * prefix:localName="value"&nbsp;<sup>[1]</sup> * </td> ! * <td headers="writeAttr repFalse repFalseUnbound"> * <!-- namespaceURI unbound --> * {@code XMLStreamException} * </td> * </tr> * * <tr> ! * <th id="writeAttrPrefix">{@code writeAttribute(prefix, namespaceURI, localName, value)}</th> * <!-- isRepairingNamespaces == true --> ! * <td headers="writeAttrPrefix repTrue repTrueBound"> * <!-- namespaceURI bound --> * bound to same prefix:<br> * prefix:localName="value"&nbsp;<sup>[1]</sup><br> * <br> * bound to different prefix:<br> * xmlns:{generated}="namespaceURI" {generated}:localName="value" * </td> ! * <td headers="writeAttrPrefix repTrue repTrueUnbound"> * <!-- namespaceURI unbound --> * xmlns:prefix="namespaceURI" prefix:localName="value"&nbsp;<sup>[3]</sup> * </td> * <!-- isRepairingNamespaces == false --> ! * <td headers="writeAttrPrefix repFalse repFalseBound"> * <!-- namespaceURI bound --> * bound to same prefix:<br> * prefix:localName="value"&nbsp;<sup>[1][2]</sup><br> * <br> * bound to different prefix:<br> * {@code XMLStreamException}<sup>[2]</sup> * </td> ! * <td headers="writeAttrPrefix repFalse repFalseUnbound"> * <!-- namespaceURI unbound --> * xmlns:prefix="namespaceURI" prefix:localName="value"&nbsp;<sup>[2][5]</sup> * </td> * </tr> * * <tr> ! * <th id="writeStartElem">{@code writeStartElement(namespaceURI, localName)}<br> * <br> * {@code writeEmptyElement(namespaceURI, localName)}</th> * <!-- isRepairingNamespaces == true --> ! * <td headers="writeStartElem repTrue repTrueBound"> * <!-- namespaceURI bound --> * {@code <prefix:localName>}&nbsp;<sup>[1]</sup> * </td> ! * <td headers="writeStartElem repTrue repTrueUnbound"> * <!-- namespaceURI unbound --> * {@code <{generated}:localName xmlns:{generated}="namespaceURI">} * </td> * <!-- isRepairingNamespaces == false --> ! * <td headers="writeStartElem repFalse repFalseBound"> * <!-- namespaceURI bound --> * {@code prefix:localName>}&nbsp;<sup>[1]</sup> * </td> ! * <td headers="writeStartElem repFalse repFalseUnbound"> * <!-- namespaceURI unbound --> * {@code XMLStreamException} * </td> * </tr> * * <tr> ! * <th id="writeStartElemPrefix">{@code writeStartElement(prefix, localName, namespaceURI)}<br> * <br> * {@code writeEmptyElement(prefix, localName, namespaceURI)}</th> * <!-- isRepairingNamespaces == true --> ! * <td headers="writeStartElemPrefix repTrue repTrueBound"> * <!-- namespaceURI bound --> * bound to same prefix:<br> * {@code <prefix:localName>}&nbsp;<sup>[1]</sup><br> * <br> * bound to different prefix:<br> * {@code <{generated}:localName xmlns:{generated}="namespaceURI">} * </td> ! * <td headers="writeStartElemPrefix repTrue repTrueUnbound"> * <!-- namespaceURI unbound --> * {@code <prefix:localName xmlns:prefix="namespaceURI">}&nbsp;<sup>[4]</sup> * </td> * <!-- isRepairingNamespaces == false --> ! * <td headers="writeStartElemPrefix repFalse repFalseBound"> * <!-- namespaceURI bound --> * bound to same prefix:<br> * {@code <prefix:localName>}&nbsp;<sup>[1]</sup><br> * <br> * bound to different prefix:<br> * {@code XMLStreamException} * </td> ! * <td headers="writeStartElemPrefix repFalse repFalseUnbound"> * <!-- namespaceURI unbound --> * {@code <prefix:localName>}&nbsp; * </td> * </tr> * </tbody> ! * </table> ! * Notes: * <ul> * <li>[1] if namespaceURI == default Namespace URI, then no prefix is written</li> * <li>[2] if prefix == "" || null {@literal &&} namespaceURI == "", then * no prefix or Namespace declaration is generated or written</li>
*** 177,190 **** * no prefix is generated or written, an xmlns declaration is generated * and written if the namespaceURI is unbound</li> * <li>[5] if prefix == "" || null, then it is treated as an invalid attempt to * define the default Namespace and an XMLStreamException is thrown</li> * </ul> - * </td> - * </tr> - * </tfoot> - * </table> * * @version 1.0 * @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved. * @see XMLOutputFactory * @see XMLStreamReader --- 176,185 ----
< prev index next >