/** Convenience method to parse a String into XML. * * <p>In this case, the encoding is ignored; the string already has to * be Unicode. After the parsing, you will still find the encoding from * the XML declaration in the Document (if there was one). */ public static Document parse (String xml) { return new XMLParser ().parse (new XMLStringSource (xml)); }
public XmlModel unmarshal(String text) throws Exception { Document doc; if (text != null && text.trim().length() > 0) { doc = parse(new XMLStringSource(text)); } else { doc = createExemplarDoc(); } return unmarshal(doc, "Text"); }
public XmlModel unmarshal(String text) throws Exception { Document doc; if (text != null && text.trim().length() > 0) { doc = parse(new XMLStringSource(text)); } else { doc = createExemplarDoc(); } return unmarshal(doc, "Text"); }
XMLStringSource source = new XMLStringSource (""); throw new XMLParseException ("Error parsing XML declaration: "+e.getMessage (), e) .setSource (source, 0); try source = new XMLStringSource (new String (header, ENCODING_ISO_8859_1)); if (!matcher.find ()) throw new XMLParseException ("Missing version in XML declaration") .setSource (new XMLStringSource (s), pos); if (c != '\'' && c != '"') throw new XMLParseException ("Missing opening quote for encoding") .setSource (new XMLStringSource (s), pos); if (pos2 == -1) throw new XMLParseException ("Missing closing quote for encoding") .setSource (new XMLStringSource (s), pos); .setSource (new XMLStringSource (s), encodingOffset);
protected void parseXMLDeclaration (String text) XMLSource source = new XMLStringSource (text);
Document camelDoc = parse(new XMLStringSource(xml)); Node camelElem = camelDoc.getRootElement();
Document camelDoc = parse(new XMLStringSource(xml)); Node camelElem = camelDoc.getRootElement();
XMLStringSource source = new XMLStringSource (expandedEntity); XMLTokenizer entityTokenizer = new XMLTokenizer (source); entityTokenizer.setEntityResolver (parentTokenizer.getEntityResolver ());