public String getPrefix(String uri) { return mCurrElem.getPrefix(uri); }
/** * Method called to find an existing prefix for the given namespace, * if any exists in the scope. If one is found, it's returned (including * "" for the current default namespace); if not, null is returned. * * @param nsURI URI of namespace for which we need a prefix */ protected final String findElemPrefix(String nsURI, SimpleOutputElement elem) throws XMLStreamException { /* Special case: empty NS URI can only be bound to the empty * prefix... */ if (nsURI == null || nsURI.length() == 0) { String currDefNsURI = elem.getDefaultNsUri(); if (currDefNsURI != null && currDefNsURI.length() > 0) { // Nope; won't do... has to be re-bound, but not here: return null; } return ""; } return mCurrElem.getPrefix(nsURI); }
public void writeDefaultNamespace(String nsURI) throws XMLStreamException { /* 01-Sep-2006, TSa: The use case for calling this method is that * of caller may wanting to 'suggest' that * such a namespace should indeed be bound at this level. This * may be necessary for canonicalization, or for minimizing number * of binding declarations (all children need the ns, but root * itself not). */ if (!mStartElementOpen) { throwOutputError(ERR_NSDECL_WRONG_STATE); } /* ... We have one complication though: if the current element * uses default namespace, can not change it (attributes don't * matter -- they never use the default namespace, but either don't * belong to a namespace, or belong to one using explicit prefix) */ String prefix = mCurrElem.getPrefix(); if (prefix != null && prefix.length() > 0) { // ok, can change it mCurrElem.setDefaultNsUri(nsURI); doWriteDefaultNs(nsURI); } }
protected void writeStartOrEmpty(String localName, String nsURI) throws XMLStreamException { // Need a prefix... String prefix = mCurrElem.getPrefix(nsURI); if (prefix == null) { throw new XMLStreamException("Unbound namespace URI '"+nsURI+"'"); } checkStartElement(localName, prefix); if (mValidator != null) { mValidator.validateElementStart(localName, nsURI, prefix); } if (mOutputElemPool != null) { SimpleOutputElement newCurr = mOutputElemPool; mOutputElemPool = newCurr.reuseAsChild(mCurrElem, prefix, localName, nsURI); --mPoolSize; mCurrElem = newCurr; } else { mCurrElem = mCurrElem.createChild(prefix, localName, nsURI); } doWriteStartTag(prefix, localName); }
@Override public String getPrefix(String uri) { return mCurrElem.getPrefix(uri); }
@Override public String getPrefix(String uri) { return mCurrElem.getPrefix(uri); }
public String getPrefix(String uri) { return mCurrElem.getPrefix(uri); }
public String getPrefix(String uri) { return mCurrElem.getPrefix(uri); }
@Override public String getPrefix(String uri) { return mCurrElem.getPrefix(uri); }
public String getPrefix(String uri) { return mCurrElem.getPrefix(uri); }
public String getPrefix(String uri) { return mCurrElem.getPrefix(uri); }
String prefix = thisElem.getPrefix(); String localName = thisElem.getLocalName(); String nsURI = thisElem.getNamespaceURI();
(curr.getLocalName(), curr.getNamespaceURI(), curr.getPrefix());
/** * Method called to find an existing prefix for the given namespace, * if any exists in the scope. If one is found, it's returned (including * "" for the current default namespace); if not, null is returned. * * @param nsURI URI of namespace for which we need a prefix */ protected final String findElemPrefix(String nsURI, SimpleOutputElement elem) throws XMLStreamException { /* Special case: empty NS URI can only be bound to the empty * prefix... */ if (nsURI == null || nsURI.length() == 0) { String currDefNsURI = elem.getDefaultNsUri(); if (currDefNsURI != null && currDefNsURI.length() > 0) { // Nope; won't do... has to be re-bound, but not here: return null; } return ""; } return mCurrElem.getPrefix(nsURI); }
/** * Method called to find an existing prefix for the given namespace, * if any exists in the scope. If one is found, it's returned (including * "" for the current default namespace); if not, null is returned. * * @param nsURI URI of namespace for which we need a prefix */ protected final String findElemPrefix(String nsURI, SimpleOutputElement elem) throws XMLStreamException { /* Special case: empty NS URI can only be bound to the empty * prefix... */ if (nsURI == null || nsURI.length() == 0) { String currDefNsURI = elem.getDefaultNsUri(); if (currDefNsURI != null && currDefNsURI.length() > 0) { // Nope; won't do... has to be re-bound, but not here: return null; } return ""; } return mCurrElem.getPrefix(nsURI); }
public void writeDefaultNamespace(String nsURI) throws XMLStreamException { /* 01-Sep-2006, TSa: The use case for calling this method is that * of caller may wanting to 'suggest' that * such a namespace should indeed be bound at this level. This * may be necessary for canonicalization, or for minimizing number * of binding declarations (all children need the ns, but root * itself not). */ if (!mStartElementOpen) { throwOutputError(ERR_NSDECL_WRONG_STATE); } /* ... We have one complication though: if the current element * uses default namespace, can not change it (attributes don't * matter -- they never use the default namespace, but either don't * belong to a namespace, or belong to one using explicit prefix) */ String prefix = mCurrElem.getPrefix(); if (prefix != null && prefix.length() > 0) { // ok, can change it mCurrElem.setDefaultNsUri(nsURI); doWriteDefaultNs(nsURI); } }
protected void writeStartOrEmpty(String localName, String nsURI) throws XMLStreamException { // Need a prefix... String prefix = mCurrElem.getPrefix(nsURI); if (prefix == null) { throw new XMLStreamException("Unbound namespace URI '"+nsURI+"'"); } checkStartElement(localName, prefix); if (mValidator != null) { mValidator.validateElementStart(localName, nsURI, prefix); } if (mOutputElemPool != null) { SimpleOutputElement newCurr = mOutputElemPool; mOutputElemPool = newCurr.reuseAsChild(mCurrElem, prefix, localName, nsURI); --mPoolSize; mCurrElem = newCurr; } else { mCurrElem = mCurrElem.createChild(prefix, localName, nsURI); } doWriteStartTag(prefix, localName); }
@Override protected void writeStartOrEmpty(String localName, String nsURI) throws XMLStreamException { // Need a prefix... String prefix = mCurrElem.getPrefix(nsURI); if (prefix == null) { throw new XMLStreamException("Unbound namespace URI '"+nsURI+"'"); } checkStartElement(localName, prefix); if (mValidator != null) { mValidator.validateElementStart(localName, nsURI, prefix); } if (mOutputElemPool != null) { SimpleOutputElement newCurr = mOutputElemPool; mOutputElemPool = newCurr.reuseAsChild(mCurrElem, prefix, localName, nsURI); --mPoolSize; mCurrElem = newCurr; } else { mCurrElem = mCurrElem.createChild(prefix, localName, nsURI); } doWriteStartTag(prefix, localName); }
protected void writeStartOrEmpty(String localName, String nsURI) throws XMLStreamException { // Need a prefix... String prefix = mCurrElem.getPrefix(nsURI); if (prefix == null) { throw new XMLStreamException("Unbound namespace URI '"+nsURI+"'"); } checkStartElement(localName, prefix); if (mValidator != null) { mValidator.validateElementStart(localName, nsURI, prefix); } if (mOutputElemPool != null) { SimpleOutputElement newCurr = mOutputElemPool; mOutputElemPool = newCurr.reuseAsChild(mCurrElem, prefix, localName, nsURI); --mPoolSize; mCurrElem = newCurr; } else { mCurrElem = mCurrElem.createChild(prefix, localName, nsURI); } doWriteStartTag(prefix, localName); }
protected void writeStartOrEmpty(String localName, String nsURI) throws XMLStreamException { // Need a prefix... String prefix = mCurrElem.getPrefix(nsURI); if (prefix == null) { throw new XMLStreamException("Unbound namespace URI '"+nsURI+"'"); } checkStartElement(localName, prefix); if (mValidator != null) { mValidator.validateElementStart(localName, nsURI, prefix); } if (mOutputElemPool != null) { SimpleOutputElement newCurr = mOutputElemPool; mOutputElemPool = newCurr.reuseAsChild(mCurrElem, prefix, localName, nsURI); --mPoolSize; mCurrElem = newCurr; } else { mCurrElem = mCurrElem.createChild(prefix, localName, nsURI); } doWriteStartTag(prefix, localName); }