use of org.apache.harmony.xml.dom.TextImpl in project XobotOS by xamarin.
the class DocumentBuilderImpl method appendText.
/**
* @param token the XML pull parser token type, such as XmlPullParser.CDSECT
* or XmlPullParser.ENTITY_REF.
*/
private void appendText(DocumentImpl document, Node parent, int token, String text) {
// Ignore empty runs.
if (text.isEmpty()) {
return;
}
// Merge with any previous text node if possible.
if (coalescing || token != XmlPullParser.CDSECT) {
Node lastChild = parent.getLastChild();
if (lastChild != null && lastChild.getNodeType() == Node.TEXT_NODE) {
Text textNode = (Text) lastChild;
textNode.appendData(text);
return;
}
}
// Okay, we really do need a new text node
parent.appendChild(token == XmlPullParser.CDSECT ? new CDATASectionImpl(document, text) : new TextImpl(document, text));
}
use of org.apache.harmony.xml.dom.TextImpl in project j2objc by google.
the class DocumentBuilderImpl method appendText.
/**
* @param token the XML pull parser token type, such as XmlPullParser.CDSECT
* or XmlPullParser.ENTITY_REF.
*/
private void appendText(DocumentImpl document, Node parent, int token, String text) {
// Ignore empty runs.
if (text.isEmpty()) {
return;
}
// Merge with any previous text node if possible.
if (coalescing || token != XmlPullParser.CDSECT) {
Node lastChild = parent.getLastChild();
if (lastChild != null && lastChild.getNodeType() == Node.TEXT_NODE) {
Text textNode = (Text) lastChild;
textNode.appendData(text);
return;
}
}
// Okay, we really do need a new text node
parent.appendChild(token == XmlPullParser.CDSECT ? new CDATASectionImpl(document, text) : new TextImpl(document, text));
}
use of org.apache.harmony.xml.dom.TextImpl in project robovm by robovm.
the class DocumentBuilderImpl method appendText.
/**
* @param token the XML pull parser token type, such as XmlPullParser.CDSECT
* or XmlPullParser.ENTITY_REF.
*/
private void appendText(DocumentImpl document, Node parent, int token, String text) {
// Ignore empty runs.
if (text.isEmpty()) {
return;
}
// Merge with any previous text node if possible.
if (coalescing || token != XmlPullParser.CDSECT) {
Node lastChild = parent.getLastChild();
if (lastChild != null && lastChild.getNodeType() == Node.TEXT_NODE) {
Text textNode = (Text) lastChild;
textNode.appendData(text);
return;
}
}
// Okay, we really do need a new text node
parent.appendChild(token == XmlPullParser.CDSECT ? new CDATASectionImpl(document, text) : new TextImpl(document, text));
}
Aggregations