Search in sources :

Example 1 with XmlDeclaration

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

the class XmlTreeBuilder method insert.

void insert(Token.Comment commentToken) {
    Comment comment = new Comment(commentToken.getData(), baseUri);
    Node insert = comment;
    if (commentToken.bogus) {
        // xml declarations are emitted as bogus
        // comments (which is right for html, but
        // not xml)
        String data = comment.getData();
        if (data.length() > 1 && (data.startsWith("!") || data.startsWith("?"))) {
            String declaration = data.substring(1);
            insert = new XmlDeclaration(declaration, comment.baseUri(), data.startsWith("!"));
        }
    }
    insertNode(insert);
}
Also used : Comment(com.smartandroid.sa.tag.nodes.Comment) TextNode(com.smartandroid.sa.tag.nodes.TextNode) Node(com.smartandroid.sa.tag.nodes.Node) XmlDeclaration(com.smartandroid.sa.tag.nodes.XmlDeclaration)

Aggregations

Comment (com.smartandroid.sa.tag.nodes.Comment)1 Node (com.smartandroid.sa.tag.nodes.Node)1 TextNode (com.smartandroid.sa.tag.nodes.TextNode)1 XmlDeclaration (com.smartandroid.sa.tag.nodes.XmlDeclaration)1