Search in sources :

Example 1 with DataNode

use of com.smartandroid.sa.tag.nodes.DataNode 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)

Aggregations

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