public void setPrefix(String prefix, String uri) throws XMLStreamException { if (_stackCount > -1 && _nsSupportContextStack[_stackCount] == false) { _nsSupportContextStack[_stackCount] = true; _nsContext.pushContext(); } _nsContext.declarePrefix(prefix, uri); }
public String getPrefix(String uri) throws XMLStreamException { return _nsContext.getPrefix(uri); }
public void reset() { super.reset(); _attributesArrayIndex = 0; _namespacesArrayIndex = 0; _nsContext.reset(); _stackCount = -1; _currentUri = _currentPrefix = null; _currentLocalName = null; _inStartElement = _isEmptyElement = false; }
_namespaceScopeContext.pushContext(); attrPrefix = ""; _namespaceScopeContext.declarePrefix(attrPrefix, attrNamespace); } else { if (attributesSize == _attributes.length) { if (attrPrefix != null && !_namespaceScopeContext.getNamespaceURI(attrPrefix).equals(attrNamespaceURI)) { _namespaceScopeContext.declarePrefix(attrPrefix, attrNamespaceURI); if (elementPrefix == null) elementPrefix = ""; if (elementNamespaceURI != null && !_namespaceScopeContext.getNamespaceURI(elementPrefix).equals(elementNamespaceURI)) { _namespaceScopeContext.declarePrefix(elementPrefix, elementNamespaceURI); if (!_namespaceScopeContext.isCurrentContextEmpty()) { if (attributesSize > 0) { write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG | for (int i = _namespaceScopeContext.getCurrentContextStartIndex(); i < _namespaceScopeContext.getCurrentContextEndIndex(); i++) { String prefix = _namespaceScopeContext.getPrefix(i); String uri = _namespaceScopeContext.getNamespaceURI(i); encodeNamespaceAttribute(prefix, uri); _namespaceScopeContext.popContext();
_currentUri = _nsContext.getNamespaceURI(""); encodeElementTermination(); if (_nsSupportContextStack[_stackCount--] == true) { _nsContext.popContext();
public void writeEndElement() throws XMLStreamException { if (_inStartElement) { encodeTerminationAndCurrentElement(false); } try { encodeElementTermination(); if (_nsSupportContextStack[_stackCount--] == true) { _nsContext.popContext(); } } catch (IOException e) { throw new XMLStreamException(e); } catch (EmptyStackException e) { throw new XMLStreamException(e); } }
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); }
_namespaceScopeContext.pushContext(); attrPrefix = ""; _namespaceScopeContext.declarePrefix(attrPrefix, attrNamespace); } else { if (attributesSize == _attributes.length) { if (attrPrefix != null && !_namespaceScopeContext.getNamespaceURI(attrPrefix).equals(attrNamespaceURI)) { _namespaceScopeContext.declarePrefix(attrPrefix, attrNamespaceURI); if (elementPrefix == null) elementPrefix = ""; if (elementNamespaceURI != null && !_namespaceScopeContext.getNamespaceURI(elementPrefix).equals(elementNamespaceURI)) { _namespaceScopeContext.declarePrefix(elementPrefix, elementNamespaceURI); if (!_namespaceScopeContext.isCurrentContextEmpty()) { if (attributesSize > 0) { write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG | for (int i = _namespaceScopeContext.getCurrentContextStartIndex(); i < _namespaceScopeContext.getCurrentContextEndIndex(); i++) { String prefix = _namespaceScopeContext.getPrefix(i); String uri = _namespaceScopeContext.getNamespaceURI(i); encodeNamespaceAttribute(prefix, uri); _namespaceScopeContext.popContext();
_currentUri = _nsContext.getNamespaceURI(""); } else { String tmpPrefix = getPrefix(_currentUri); encodeElementTermination(); if (_nsSupportContextStack[_stackCount--] == true) { _nsContext.popContext();
public void writeEndElement() throws XMLStreamException { if (_inStartElement) { encodeTerminationAndCurrentElement(false); } try { encodeElementTermination(); if (_nsSupportContextStack[_stackCount--] == true) { _nsContext.popContext(); } } catch (IOException e) { throw new XMLStreamException(e); } catch (EmptyStackException e) { throw new XMLStreamException(e); } }
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); }
_namespaceScopeContext.pushContext(); attrPrefix = ""; _namespaceScopeContext.declarePrefix(attrPrefix, attrNamespace); } else { if (attributesSize == _attributes.length) { if (attrPrefix != null && !_namespaceScopeContext.getNamespaceURI(attrPrefix).equals(attrNamespaceURI)) { _namespaceScopeContext.declarePrefix(attrPrefix, attrNamespaceURI); if (elementPrefix == null) elementPrefix = ""; if (elementNamespaceURI != null && !_namespaceScopeContext.getNamespaceURI(elementPrefix).equals(elementNamespaceURI)) { _namespaceScopeContext.declarePrefix(elementPrefix, elementNamespaceURI); if (!_namespaceScopeContext.isCurrentContextEmpty()) { if (attributesSize > 0) { write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG | for (int i = _namespaceScopeContext.getCurrentContextStartIndex(); i < _namespaceScopeContext.getCurrentContextEndIndex(); i++) { String prefix = _namespaceScopeContext.getPrefix(i); String uri = _namespaceScopeContext.getNamespaceURI(i); encodeNamespaceAttribute(prefix, uri); _namespaceScopeContext.popContext();
public void setPrefix(String prefix, String uri) throws XMLStreamException { if (_stackCount > -1 && _nsSupportContextStack[_stackCount] == false) { _nsSupportContextStack[_stackCount] = true; _nsContext.pushContext(); } _nsContext.declarePrefix(prefix, uri); }
_currentUri = _nsContext.getNamespaceURI(""); } else { String tmpPrefix = getPrefix(_currentUri); encodeElementTermination(); if (_nsSupportContextStack[_stackCount--] == true) { _nsContext.popContext();
public void reset() { super.reset(); _attributesArrayIndex = 0; _namespacesArrayIndex = 0; _nsContext.reset(); _stackCount = -1; _currentUri = _currentPrefix = null; _currentLocalName = null; _inStartElement = _isEmptyElement = false; }
public String getPrefix(String uri) throws XMLStreamException { return _nsContext.getPrefix(uri); }
public void writeEndElement() throws XMLStreamException { if (_inStartElement) { encodeTerminationAndCurrentElement(false); } try { encodeElementTermination(); if (_nsSupportContextStack[_stackCount--] == true) { _nsContext.popContext(); } } catch (IOException e) { throw new XMLStreamException(e); } catch (EmptyStackException e) { throw new XMLStreamException(e); } }
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 setPrefix(String prefix, String uri) throws XMLStreamException { if (_stackCount > -1 && _nsSupportContextStack[_stackCount] == false) { _nsSupportContextStack[_stackCount] = true; _nsContext.pushContext(); } _nsContext.declarePrefix(prefix, uri); }
public void reset() { super.reset(); _attributesArrayIndex = 0; _namespacesArrayIndex = 0; _nsContext.reset(); _stackCount = -1; _currentUri = _currentPrefix = null; _currentLocalName = null; _inStartElement = _isEmptyElement = false; }