Java XML Parse Stream parseText(XMLStreamReader parser)

Here you can find the source of parseText(XMLStreamReader parser)

Description

parse Text

License

Open Source License

Declaration

public static String parseText(XMLStreamReader parser) throws XMLStreamException 

Method Source Code


//package com.java2s;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;

public class Main {
    public static String parseText(XMLStreamReader parser) throws XMLStreamException {
        for (int event = parser.next(); event != XMLStreamConstants.END_ELEMENT; event = parser.next()) {
            if (event == XMLStreamConstants.CHARACTERS)
                return parser.getText();
        }//from   w w  w . ja v a 2s .  co  m

        return null;
    }
}

Related

  1. parseNoContent(final XMLStreamReader reader)
  2. parseNumber(XMLEventReader stream)
  3. parser(InputStream inputStream)
  4. parseStream(InputStream stream, boolean validate, boolean expandEntityRefs)
  5. parseStreamToXML(InputStream in)
  6. parseValue(XMLStreamReader xmlRdr, String elementName)
  7. parseXml(InputStream in)
  8. parseXml(InputStream in)
  9. parseXML(InputStream in)