Package name.pehl.totoe.xml.client

Examples of name.pehl.totoe.xml.client.Document


        {
            namespacesValue = null;
        }
        try
        {
            Document document = new XmlParser().parse(xmlValue, namespacesValue);
            if (contextValue != null && contextValue.trim().length() != 0)
            {
                contextNode = document.selectNode(contextValue);
            }
            else
            {
                contextNode = document;
            }
View Full Code Here


*/
public abstract class AbstractXmlParserTest extends AbstractTotoeTest
{
    public void testParseNull()
    {
        Document document = new XmlParser().parse(NULL_STRING);
        assertNull(document);
    }
View Full Code Here

    }


    public void testParseEmpty()
    {
        Document document = new XmlParser().parse(EMPTY_STRING);
        assertNull(document);
    }
View Full Code Here

    }


    public void testParseBlank()
    {
        Document document = new XmlParser().parse(BLANK_STRING);
        assertNull(document);
    }
View Full Code Here


    public void testParseWithNamespacesAsMap()
    {
        String xml = XmlParserResources.INSTANCE.swissArmyKnifeNs().getText();
        Document document = new XmlParser().parse(xml, NAMESPACES_MAP);
        assertDocument(document);
        assertRootElement(document, document.getRoot());
        assertIdAttribute(document, document.getRoot(), document.getRoot().getAttribute(ID_ATTRIBUTE));
    }
View Full Code Here

    }


    public void testParseWithNamespacesAsString()
    {
        Document document = parse();
        assertDocument(document);
        assertRootElement(document, document.getRoot());
        assertIdAttribute(document, document.getRoot(), document.getRoot().getAttribute(ID_ATTRIBUTE));
    }
View Full Code Here

    }


    public void testSelectNodes()
    {
        Document document = parse();
        List<Node> functions = document.selectNodes("//functions");
        assertFunctionsNodes(functions);

        Element root = document.getRoot();
        functions = root.selectNodes("functions");
        assertFunctionsNodes(functions);
    }
View Full Code Here

    }


    public void testSelectNode()
    {
        Document document = parse();
        Node functions = document.selectNode("//functions");
        assertFunctionsNode(functions);

        Element root = document.getRoot();
        functions = root.selectNode("functions");
        assertFunctionsNode(functions);
    }
View Full Code Here

    }


    public void testSelectDescriptionText()
    {
        Document document = parse();
        Node description = document.selectNode("//description/text()");
        assertDescriptionText(description);
    }
View Full Code Here


    public void testSelectValues()
    {
        // There's only one unit attribute without a namespace!
        Document document = parse();
        String[] units = document.selectValues("//@unit");
        assertNotNull(units);
        assertEquals(1, units.length);
        assertUnitValue(units[0]);
    }
View Full Code Here

TOP

Related Classes of name.pehl.totoe.xml.client.Document

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.