public String getLocalName() { // Note: for this we need not (yet) finish reading element if (mCurrToken == START_ELEMENT || mCurrToken == END_ELEMENT) { return mElementStack.getLocalName(); } if (mCurrToken == ENTITY_REFERENCE) { /* 30-Sep-2005, TSa: Entity will be null in non-expanding mode * if no definition was found: */ return (mCurrEntity == null) ? mCurrName: mCurrEntity.getName(); } throw new IllegalStateException("Current state not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
public String getPrefixedName() { switch (mCurrToken) { case START_ELEMENT: case END_ELEMENT: { String prefix = mElementStack.getPrefix(); String ln = mElementStack.getLocalName(); if (prefix == null) { return ln; } StringBuffer sb = new StringBuffer(ln.length() + 1 + prefix.length()); sb.append(prefix); sb.append(':'); sb.append(ln); return sb.toString(); } case ENTITY_REFERENCE: return getLocalName(); case PROCESSING_INSTRUCTION: return getPITarget(); case DTD: return getDTDRootName(); } throw new IllegalStateException("Current state not START_ELEMENT, END_ELEMENT, ENTITY_REFERENCE, PROCESSING_INSTRUCTION or DTD"); }
public void fireSaxEndElement(ContentHandler h) throws SAXException { if (h != null) { /* Order of events is reversed (wrt. start-element): first * the end tag event, then unbound prefixes */ String uri = mElementStack.getNsURI(); // Sax requires "" (not null) for ns uris... h.endElement((uri == null) ? "" : uri, mElementStack.getLocalName(), getPrefixedName()); // Any expiring ns declarations? int nsCount = mElementStack.getCurrentNsCount(); for (int i = 0; i < nsCount; ++i) { String prefix = mElementStack.getLocalNsPrefix(i); //String nsUri = mElementStack.getLocalNsURI(i); h.endPrefixMapping((prefix == null) ? "" : prefix); } } }
public void fireSaxStartElement(ContentHandler h, Attributes attrs) throws SAXException { if (h != null) { // First; any ns declarations? int nsCount = mElementStack.getCurrentNsCount(); for (int i = 0; i < nsCount; ++i) { String prefix = mElementStack.getLocalNsPrefix(i); String uri = mElementStack.getLocalNsURI(i); h.startPrefixMapping((prefix == null) ? "" : prefix, uri); } // Then start-elem event itself: String uri = mElementStack.getNsURI(); // Sax requires "" (not null) for ns uris... h.startElement((uri == null) ? "" : uri, mElementStack.getLocalName(), getPrefixedName(), attrs); } }
throws IOException, XMLStreamException String ln = elemStack.getLocalName(); boolean nsAware = elemStack.isNamespaceAware();
String expLocalName = mElementStack.getLocalName();
elemStack.getLocalName(), elemStack.getNsURI());
writeStartElement(prefix, elemStack.getLocalName(), uri);
public String getLocalName() { // Note: for this we need not (yet) finish reading element if (mCurrToken == START_ELEMENT || mCurrToken == END_ELEMENT) { return mElementStack.getLocalName(); } if (mCurrToken == ENTITY_REFERENCE) { /* 30-Sep-2005, TSa: Entity will be null in non-expanding mode * if no definition was found: */ return (mCurrEntity == null) ? mCurrName: mCurrEntity.getName(); } throw new IllegalStateException("Current state not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
public String getLocalName() { // Note: for this we need not (yet) finish reading element if (mCurrToken == START_ELEMENT || mCurrToken == END_ELEMENT) { return mElementStack.getLocalName(); } if (mCurrToken == ENTITY_REFERENCE) { /* 30-Sep-2005, TSa: Entity will be null in non-expanding mode * if no definition was found: */ return (mCurrEntity == null) ? mCurrName: mCurrEntity.getName(); } throw new IllegalStateException("Current state not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
public String getLocalName() { // Note: for this we need not (yet) finish reading element if (mCurrToken == START_ELEMENT || mCurrToken == END_ELEMENT) { return mElementStack.getLocalName(); } if (mCurrToken == ENTITY_REFERENCE) { /* 30-Sep-2005, TSa: Entity will be null in non-expanding mode * if no definition was found: */ return (mCurrEntity == null) ? mCurrName: mCurrEntity.getName(); } throw new IllegalStateException("Current state not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
public String getLocalName() { // Note: for this we need not (yet) finish reading element if (mCurrToken == START_ELEMENT || mCurrToken == END_ELEMENT) { return mElementStack.getLocalName(); } if (mCurrToken == ENTITY_REFERENCE) { /* 30-Sep-2005, TSa: Entity will be null in non-expanding mode * if no definition was found: */ return (mCurrEntity == null) ? mCurrName: mCurrEntity.getName(); } throw new IllegalStateException("Current state not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
@Override public String getLocalName() { // Note: for this we need not (yet) finish reading element if (mCurrToken == START_ELEMENT || mCurrToken == END_ELEMENT) { return mElementStack.getLocalName(); } if (mCurrToken == ENTITY_REFERENCE) { /* 30-Sep-2005, TSa: Entity will be null in non-expanding mode * if no definition was found: */ return (mCurrEntity == null) ? mCurrName: mCurrEntity.getName(); } throw new IllegalStateException("Current state not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
@Override public String getLocalName() { // Note: for this we need not (yet) finish reading element if (mCurrToken == START_ELEMENT || mCurrToken == END_ELEMENT) { return mElementStack.getLocalName(); } if (mCurrToken == ENTITY_REFERENCE) { /* 30-Sep-2005, TSa: Entity will be null in non-expanding mode * if no definition was found: */ return (mCurrEntity == null) ? mCurrName: mCurrEntity.getName(); } throw new IllegalStateException("Current state not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
@Override public String getLocalName() { // Note: for this we need not (yet) finish reading element if (mCurrToken == START_ELEMENT || mCurrToken == END_ELEMENT) { return mElementStack.getLocalName(); } if (mCurrToken == ENTITY_REFERENCE) { /* 30-Sep-2005, TSa: Entity will be null in non-expanding mode * if no definition was found: */ return (mCurrEntity == null) ? mCurrName: mCurrEntity.getName(); } throw new IllegalStateException("Current state not START_ELEMENT, END_ELEMENT or ENTITY_REFERENCE"); }
public void fireSaxStartElement(ContentHandler h, Attributes attrs) throws SAXException { if (h != null) { // First; any ns declarations? int nsCount = mElementStack.getCurrentNsCount(); for (int i = 0; i < nsCount; ++i) { String prefix = mElementStack.getLocalNsPrefix(i); String uri = mElementStack.getLocalNsURI(i); h.startPrefixMapping((prefix == null) ? "" : prefix, uri); } // Then start-elem event itself: String uri = mElementStack.getNsURI(); // Sax requires "" (not null) for ns uris... h.startElement((uri == null) ? "" : uri, mElementStack.getLocalName(), getPrefixedName(), attrs); } }
public void fireSaxStartElement(ContentHandler h, Attributes attrs) throws SAXException { if (h != null) { // First; any ns declarations? int nsCount = mElementStack.getCurrentNsCount(); for (int i = 0; i < nsCount; ++i) { String prefix = mElementStack.getLocalNsPrefix(i); String uri = mElementStack.getLocalNsURI(i); h.startPrefixMapping((prefix == null) ? "" : prefix, uri); } // Then start-elem event itself: String uri = mElementStack.getNsURI(); // Sax requires "" (not null) for ns uris... h.startElement((uri == null) ? "" : uri, mElementStack.getLocalName(), getPrefixedName(), attrs); } }
public void fireSaxStartElement(ContentHandler h, Attributes attrs) throws SAXException { if (h != null) { // First; any ns declarations? int nsCount = mElementStack.getCurrentNsCount(); for (int i = 0; i < nsCount; ++i) { String prefix = mElementStack.getLocalNsPrefix(i); String uri = mElementStack.getLocalNsURI(i); h.startPrefixMapping((prefix == null) ? "" : prefix, uri); } // Then start-elem event itself: String uri = mElementStack.getNsURI(); // Sax requires "" (not null) for ns uris... h.startElement((uri == null) ? "" : uri, mElementStack.getLocalName(), getPrefixedName(), attrs); } }
public void fireSaxStartElement(ContentHandler h, Attributes attrs) throws SAXException { if (h != null) { // First; any ns declarations? int nsCount = mElementStack.getCurrentNsCount(); for (int i = 0; i < nsCount; ++i) { String prefix = mElementStack.getLocalNsPrefix(i); String uri = mElementStack.getLocalNsURI(i); h.startPrefixMapping((prefix == null) ? "" : prefix, uri); } // Then start-elem event itself: String uri = mElementStack.getNsURI(); // Sax requires "" (not null) for ns uris... h.startElement((uri == null) ? "" : uri, mElementStack.getLocalName(), getPrefixedName(), attrs); } }
public void fireSaxStartElement(ContentHandler h, Attributes attrs) throws SAXException { if (h != null) { // First; any ns declarations? int nsCount = mElementStack.getCurrentNsCount(); for (int i = 0; i < nsCount; ++i) { String prefix = mElementStack.getLocalNsPrefix(i); String uri = mElementStack.getLocalNsURI(i); h.startPrefixMapping((prefix == null) ? "" : prefix, uri); } // Then start-elem event itself: String uri = mElementStack.getNsURI(); // Sax requires "" (not null) for ns uris... h.startElement((uri == null) ? "" : uri, mElementStack.getLocalName(), getPrefixedName(), attrs); } }