public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException { String prefix = ""; // Find prefix for attribute, ignoring default namespace if (namespaceURI.length() > 0) { prefix = _nsContext.getNonDefaultPrefix(namespaceURI); // Undeclared prefix or ignorable default ns? if (prefix == null || prefix.length() == 0) { // Workaround for BUG in SAX NamespaceSupport helper // which incorrectly defines namespace declaration URI if (namespaceURI == EncodingConstants.XMLNS_NAMESPACE_NAME || namespaceURI.equals(EncodingConstants.XMLNS_NAMESPACE_NAME)) { // TODO // Need to check carefully the rule for the writing of // namespaces in StAX. Is it safe to ignore such // attributes, as declarations will be made using the // writeNamespace method return; } throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.URIUnbound", new Object[]{namespaceURI})); } } writeAttribute(prefix, namespaceURI, localName, value); }
public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException { String prefix = ""; // Find prefix for attribute, ignoring default namespace if (namespaceURI.length() > 0) { prefix = _nsContext.getNonDefaultPrefix(namespaceURI); // Undeclared prefix or ignorable default ns? if (prefix == null || prefix.length() == 0) { // Workaround for BUG in SAX NamespaceSupport helper // which incorrectly defines namespace declaration URI if (namespaceURI == EncodingConstants.XMLNS_NAMESPACE_NAME || namespaceURI.equals(EncodingConstants.XMLNS_NAMESPACE_NAME)) { // TODO // Need to check carefully the rule for the writing of // namespaces in StAX. Is it safe to ignore such // attributes, as declarations will be made using the // writeNamespace method return; } throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.URIUnbound", new Object[]{namespaceURI})); } } writeAttribute(prefix, namespaceURI, localName, value); }
public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException { String prefix = ""; // Find prefix for attribute, ignoring default namespace if (namespaceURI.length() > 0) { prefix = _nsContext.getNonDefaultPrefix(namespaceURI); // Undeclared prefix or ignorable default ns? if (prefix == null || prefix.length() == 0) { // Workaround for BUG in SAX NamespaceSupport helper // which incorrectly defines namespace declaration URI if (namespaceURI == EncodingConstants.XMLNS_NAMESPACE_NAME || namespaceURI.equals(EncodingConstants.XMLNS_NAMESPACE_NAME)) { // TODO // Need to check carefully the rule for the writing of // namespaces in StAX. Is it safe to ignore such // attributes, as declarations will be made using the // writeNamespace method return; } throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.URIUnbound", new Object[]{namespaceURI})); } } writeAttribute(prefix, namespaceURI, localName, value); }