public String validateQNamePrefix(QName name) throws XMLStreamException { /* Gets bit more complicated: we need to ensure that given URI * is properly bound... */ String uri = name.getNamespaceURI(); String suggPrefix = name.getPrefix(); String actPrefix = validateElemPrefix(suggPrefix, uri, mCurrElem); if (actPrefix == null) { // no suitable prefix, must bind /* Need to ensure that we'll pass "" as prefix, not null, so * that it is understood as "I want to use the default NS", not * as "whatever prefix, I don't care" */ if (suggPrefix == null) { suggPrefix = ""; } actPrefix = generateElemPrefix(suggPrefix, uri, mCurrElem); if (actPrefix == null || actPrefix.length() == 0) { // def NS writeDefaultNamespace(uri); } else { writeNamespace(actPrefix, uri); } } return actPrefix; }
public void writeNamespace(String prefix, String nsURI) throws XMLStreamException { /* (see discussion in 'writeDefaultNamespace()' for details on * if and how this method may get called in repairing mode) */ if (prefix == null || prefix.length() == 0) { writeDefaultNamespace(nsURI); return; } if (!mStartElementOpen) { throwOutputError(ERR_NSDECL_WRONG_STATE); } /* 01-Sep-2006, TSa: Let's only add the declaration if the prefix * is as of yet unbound. If we have to re-bind things in future, * so be it -- for now, this should suffice (and if we have to * add re-binding, must verify that no attribute, nor element * itself, is using overridden prefix) */ int value = mCurrElem.isPrefixValid(prefix, nsURI, true); if (value == SimpleOutputElement.PREFIX_UNBOUND) { mCurrElem.addPrefix(prefix, nsURI); doWriteNamespace(prefix, nsURI); } }
@Override public String validateQNamePrefix(QName name) throws XMLStreamException { /* Gets bit more complicated: we need to ensure that given URI * is properly bound... */ String uri = name.getNamespaceURI(); String suggPrefix = name.getPrefix(); String actPrefix = validateElemPrefix(suggPrefix, uri, mCurrElem); if (actPrefix == null) { // no suitable prefix, must bind /* Need to ensure that we'll pass "" as prefix, not null, so * that it is understood as "I want to use the default NS", not * as "whatever prefix, I don't care" */ if (suggPrefix == null) { suggPrefix = ""; } actPrefix = generateElemPrefix(suggPrefix, uri, mCurrElem); if (actPrefix == null || actPrefix.length() == 0) { // def NS writeDefaultNamespace(uri); } else { writeNamespace(actPrefix, uri); } } return actPrefix; }
@Override public String validateQNamePrefix(QName name) throws XMLStreamException { /* Gets bit more complicated: we need to ensure that given URI * is properly bound... */ String uri = name.getNamespaceURI(); String suggPrefix = name.getPrefix(); String actPrefix = validateElemPrefix(suggPrefix, uri, mCurrElem); if (actPrefix == null) { // no suitable prefix, must bind /* Need to ensure that we'll pass "" as prefix, not null, so * that it is understood as "I want to use the default NS", not * as "whatever prefix, I don't care" */ if (suggPrefix == null) { suggPrefix = ""; } actPrefix = generateElemPrefix(suggPrefix, uri, mCurrElem); if (actPrefix == null || actPrefix.length() == 0) { // def NS writeDefaultNamespace(uri); } else { writeNamespace(actPrefix, uri); } } return actPrefix; }
@Override public String validateQNamePrefix(QName name) throws XMLStreamException { /* Gets bit more complicated: we need to ensure that given URI * is properly bound... */ String uri = name.getNamespaceURI(); String suggPrefix = name.getPrefix(); String actPrefix = validateElemPrefix(suggPrefix, uri, mCurrElem); if (actPrefix == null) { // no suitable prefix, must bind /* Need to ensure that we'll pass "" as prefix, not null, so * that it is understood as "I want to use the default NS", not * as "whatever prefix, I don't care" */ if (suggPrefix == null) { suggPrefix = ""; } actPrefix = generateElemPrefix(suggPrefix, uri, mCurrElem); if (actPrefix == null || actPrefix.length() == 0) { // def NS writeDefaultNamespace(uri); } else { writeNamespace(actPrefix, uri); } } return actPrefix; }
public String validateQNamePrefix(QName name) throws XMLStreamException { /* Gets bit more complicated: we need to ensure that given URI * is properly bound... */ String uri = name.getNamespaceURI(); String suggPrefix = name.getPrefix(); String actPrefix = validateElemPrefix(suggPrefix, uri, mCurrElem); if (actPrefix == null) { // no suitable prefix, must bind /* Need to ensure that we'll pass "" as prefix, not null, so * that it is understood as "I want to use the default NS", not * as "whatever prefix, I don't care" */ if (suggPrefix == null) { suggPrefix = ""; } actPrefix = generateElemPrefix(suggPrefix, uri, mCurrElem); if (actPrefix == null || actPrefix.length() == 0) { // def NS writeDefaultNamespace(uri); } else { writeNamespace(actPrefix, uri); } } return actPrefix; }
public void writeNamespace(String prefix, String nsURI) throws XMLStreamException { /* (see discussion in 'writeDefaultNamespace()' for details on * if and how this method may get called in repairing mode) */ if (prefix == null || prefix.length() == 0) { writeDefaultNamespace(nsURI); return; } if (!mStartElementOpen) { throwOutputError(ERR_NSDECL_WRONG_STATE); } /* 01-Sep-2006, TSa: Let's only add the declaration if the prefix * is as of yet unbound. If we have to re-bind things in future, * so be it -- for now, this should suffice (and if we have to * add re-binding, must verify that no attribute, nor element * itself, is using overridden prefix) */ int value = mCurrElem.isPrefixValid(prefix, nsURI, true); if (value == SimpleOutputElement.PREFIX_UNBOUND) { mCurrElem.addPrefix(prefix, nsURI); doWriteNamespace(prefix, nsURI); } }
public void writeNamespace(String prefix, String nsURI) throws XMLStreamException { /* (see discussion in 'writeDefaultNamespace()' for details on * if and how this method may get called in repairing mode) */ if (prefix == null || prefix.length() == 0) { writeDefaultNamespace(nsURI); return; } if (!mStartElementOpen) { throwOutputError(ERR_NSDECL_WRONG_STATE); } /* 01-Sep-2006, TSa: Let's only add the declaration if the prefix * is as of yet unbound. If we have to re-bind things in future, * so be it -- for now, this should suffice (and if we have to * add re-binding, must verify that no attribute, nor element * itself, is using overridden prefix) */ int value = mCurrElem.isPrefixValid(prefix, nsURI, true); if (value == SimpleOutputElement.PREFIX_UNBOUND) { mCurrElem.addPrefix(prefix, nsURI); doWriteNamespace(prefix, nsURI); } }
public void writeNamespace(String prefix, String nsURI) throws XMLStreamException { /* (see discussion in 'writeDefaultNamespace()' for details on * if and how this method may get called in repairing mode) */ if (prefix == null || prefix.length() == 0) { writeDefaultNamespace(nsURI); return; } if (!mStartElementOpen) { throwOutputError(ERR_NSDECL_WRONG_STATE); } /* 01-Sep-2006, TSa: Let's only add the declaration if the prefix * is as of yet unbound. If we have to re-bind things in future, * so be it -- for now, this should suffice (and if we have to * add re-binding, must verify that no attribute, nor element * itself, is using overridden prefix) */ int value = mCurrElem.isPrefixValid(prefix, nsURI, true); if (value == SimpleOutputElement.PREFIX_UNBOUND) { mCurrElem.addPrefix(prefix, nsURI); doWriteNamespace(prefix, nsURI); } }
@Override public void writeNamespace(String prefix, String nsURI) throws XMLStreamException { /* (see discussion in 'writeDefaultNamespace()' for details on * if and how this method may get called in repairing mode) */ if (prefix == null || prefix.length() == 0) { writeDefaultNamespace(nsURI); return; } if (!mStartElementOpen) { throwOutputError(ERR_NSDECL_WRONG_STATE); } /* 01-Sep-2006, TSa: Let's only add the declaration if the prefix * is as of yet unbound. If we have to re-bind things in future, * so be it -- for now, this should suffice (and if we have to * add re-binding, must verify that no attribute, nor element * itself, is using overridden prefix) */ int value = mCurrElem.isPrefixValid(prefix, nsURI, true); if (value == SimpleOutputElement.PREFIX_UNBOUND) { mCurrElem.addPrefix(prefix, nsURI); doWriteNamespace(prefix, nsURI); } }
public void writeNamespace(String prefix, String nsURI) throws XMLStreamException { /* (see discussion in 'writeDefaultNamespace()' for details on * if and how this method may get called in repairing mode) */ if (prefix == null || prefix.length() == 0) { writeDefaultNamespace(nsURI); return; } if (!mStartElementOpen) { throwOutputError(ERR_NSDECL_WRONG_STATE); } /* 01-Sep-2006, TSa: Let's only add the declaration if the prefix * is as of yet unbound. If we have to re-bind things in future, * so be it -- for now, this should suffice (and if we have to * add re-binding, must verify that no attribute, nor element * itself, is using overridden prefix) */ int value = mCurrElem.isPrefixValid(prefix, nsURI, true); if (value == SimpleOutputElement.PREFIX_UNBOUND) { mCurrElem.addPrefix(prefix, nsURI); doWriteNamespace(prefix, nsURI); } }
@Override public void writeNamespace(String prefix, String nsURI) throws XMLStreamException { /* (see discussion in 'writeDefaultNamespace()' for details on * if and how this method may get called in repairing mode) */ if (prefix == null || prefix.length() == 0) { writeDefaultNamespace(nsURI); return; } if (!mStartElementOpen) { throwOutputError(ERR_NSDECL_WRONG_STATE); } /* 01-Sep-2006, TSa: Let's only add the declaration if the prefix * is as of yet unbound. If we have to re-bind things in future, * so be it -- for now, this should suffice (and if we have to * add re-binding, must verify that no attribute, nor element * itself, is using overridden prefix) */ int value = mCurrElem.isPrefixValid(prefix, nsURI, true); if (value == SimpleOutputElement.PREFIX_UNBOUND) { mCurrElem.addPrefix(prefix, nsURI); doWriteNamespace(prefix, nsURI); } }
@Override public void writeNamespace(String prefix, String nsURI) throws XMLStreamException { /* (see discussion in 'writeDefaultNamespace()' for details on * if and how this method may get called in repairing mode) */ if (prefix == null || prefix.length() == 0) { writeDefaultNamespace(nsURI); return; } if (!mStartElementOpen) { throwOutputError(ERR_NSDECL_WRONG_STATE); } /* 01-Sep-2006, TSa: Let's only add the declaration if the prefix * is as of yet unbound. If we have to re-bind things in future, * so be it -- for now, this should suffice (and if we have to * add re-binding, must verify that no attribute, nor element * itself, is using overridden prefix) */ int value = mCurrElem.isPrefixValid(prefix, nsURI, true); if (value == SimpleOutputElement.PREFIX_UNBOUND) { mCurrElem.addPrefix(prefix, nsURI); doWriteNamespace(prefix, nsURI); } }