Package name.pehl.totoe.xml.client

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


    @UiHandler("select")
    void onSelect(ClickEvent event)
    {
        String result = null;
        Node contextNode = null;

        String xmlValue = xmlIn.getText();
        String xpathValue = xpath.getText();
        String contextValue = context.getText();
        String namespacesValue = namespaces.getText();
        if (xmlValue == null || xmlValue.trim().length() == 0)
        {
            result = "No xml input given";
        }
        else if (xpathValue == null || xpathValue.trim().length() == 0)
        {
            result = "No xpath given";
        }

        if (namespacesValue != null && namespacesValue.trim().length() == 0)
        {
            namespacesValue = null;
        }
        try
        {
            Document document = new XmlParser().parse(xmlValue, namespacesValue);
            if (contextValue != null && contextValue.trim().length() != 0)
            {
                contextNode = document.selectNode(contextValue);
            }
            else
            {
                contextNode = document;
            }
            List<Node> nodes = contextNode.selectNodes(xpathValue);
            result = buildResult(nodes);
        }
        catch (XPathException e)
        {
            result = "Exception:\n" + e.getMessage();
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 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 testSelectNode()
    {
        Document document = parse();
        Node functions = document.selectNode("//dns:functions");
        assertFunctionsNode(functions);

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


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

     * @return a {@link Node} instance that corresponds to the DOM object
     */
    @SuppressWarnings("unchecked")
    static <T extends Node> T create(JavaScriptObject jso)
    {
        Node result = null;
        if (jso != null)
        {
            NodeType type = NodeType.typeOf(nativeTypeOf(jso));
            switch (type)
            {
View Full Code Here

     * @return the text of the first child in case the first child implements
     *         {@link HasText}, <code>null</code> otherwise.
     */
    static String getTextFromFirstChild(HasChildren hasChildrenNode)
    {
        Node firstChild = hasChildrenNode.getFirstChild();
        if (firstChild != null && firstChild instanceof HasText)
        {
            return ((HasText) firstChild).getText();
        }
        return null;
View Full Code Here

    @Override
    public String selectValue(String xpath, WhitespaceHandling whitespaceHandling)
    {
        try
        {
            Node singleNode = selectNode(xpath);
            if (singleNode instanceof HasText)
            {
                HasText textNode = (HasText) singleNode;
                String text = textNode.getText(whitespaceHandling);
                return text;
View Full Code Here

TOP

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

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.