Search in sources :

Example 1 with TextNode

use of com.smartandroid.sa.tag.nodes.TextNode in project SmartAndroidSource by jaychou2012.

the class HtmlTreeBuilder method insert.

void insert(Token.Character characterToken) {
    Node node;
    // characters in script and style go in as datanodes, not text nodes
    String tagName = currentElement().tagName();
    if (tagName.equals("script") || tagName.equals("style"))
        node = new DataNode(characterToken.getData(), baseUri);
    else
        node = new TextNode(characterToken.getData(), baseUri);
    // doesn't use insertNode, because
    currentElement().appendChild(node);
// we don't foster these; and will
// always have a stack.
}
Also used : DataNode(com.smartandroid.sa.tag.nodes.DataNode) DataNode(com.smartandroid.sa.tag.nodes.DataNode) TextNode(com.smartandroid.sa.tag.nodes.TextNode) Node(com.smartandroid.sa.tag.nodes.Node) TextNode(com.smartandroid.sa.tag.nodes.TextNode)

Example 2 with TextNode

use of com.smartandroid.sa.tag.nodes.TextNode in project SmartAndroidSource by jaychou2012.

the class XmlTreeBuilder method insert.

void insert(Token.Character characterToken) {
    Node node = new TextNode(characterToken.getData(), baseUri);
    insertNode(node);
}
Also used : TextNode(com.smartandroid.sa.tag.nodes.TextNode) Node(com.smartandroid.sa.tag.nodes.Node) TextNode(com.smartandroid.sa.tag.nodes.TextNode)

Aggregations

Node (com.smartandroid.sa.tag.nodes.Node)2 TextNode (com.smartandroid.sa.tag.nodes.TextNode)2 DataNode (com.smartandroid.sa.tag.nodes.DataNode)1