/** * @param i * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getAttributeValue */ public String getAttributeValue(int i) { String returnString = null; if (parser != null) { returnString = parser.getAttributeValue(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { OMAttribute attrib = getAttribute((OMElement) lastNode, i); if (attrib != null) { returnString = attrib.getAttributeValue(); } } else { throw new IllegalStateException( "attribute type accessed in illegal event!"); } } return returnString; }
/** * @param i * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getAttributeNamespace */ public String getAttributeNamespace(int i) { String returnString = null; if (parser != null) { returnString = parser.getAttributeNamespace(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { OMAttribute attrib = getAttribute((OMElement) lastNode, i); if (attrib != null) { OMNamespace nameSpace = attrib.getNamespace(); if (nameSpace != null) { returnString = nameSpace.getNamespaceURI(); } } } else { throw new IllegalStateException( "attribute nameSpace accessed in illegal event!"); } } return returnString; }
/** * @param i * @return Returns QName. * @see javax.xml.stream.XMLStreamReader#getAttributeName */ public QName getAttributeName(int i) { QName returnQName = null; if (parser != null) { returnQName = parser.getAttributeName(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { returnQName = getAttribute((OMElement) lastNode, i).getQName(); } else { throw new IllegalStateException( "attribute count accessed in illegal event!"); } } return returnQName; }
/** * @param i * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getAttributeLocalName */ public String getAttributeLocalName(int i) { String returnString = null; if (parser != null) { returnString = parser.getAttributeLocalName(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { OMAttribute attrib = getAttribute((OMElement) lastNode, i); if (attrib != null) { if (attrib.getNamespace() != null) { returnString = attrib.getLocalName(); } else { returnString = ((Attr) attrib).getNodeName(); } } } else { throw new IllegalStateException( "attribute localName accessed in illegal event!"); } } return returnString; }
/** * @param i * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getAttributePrefix */ public String getAttributePrefix(int i) { String returnString = null; if (parser != null) { returnString = parser.getAttributePrefix(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { OMAttribute attrib = getAttribute((OMElement) lastNode, i); if (attrib != null) { OMNamespace nameSpace = attrib.getNamespace(); if (nameSpace != null) { returnString = nameSpace.getPrefix(); } } } else { throw new IllegalStateException( "attribute prefix accessed in illegal event!"); } } return returnString; }