Package groovy.util

Examples of groovy.util.XmlParser


        return xml;
    }

    @Override
    public void load(InputStream inputStream) throws Exception {
        xml = new XmlParser().parse(inputStream);
        load(xml);
    }
View Full Code Here


        }

        public Node asNode() {
            if (node == null) {
                try {
                    node = new XmlParser().parseText(toString());
                } catch (Exception e) {
                    throw UncheckedException.asUncheckedException(e);
                }
                builder = null;
                element = null;
View Full Code Here

     * Converts an OMElement into a groovy.util.Node
     */
    public Object toScript(OMElement o) {
        try {

            Node xmlNode = new XmlParser().parseText(o.toString());
            return xmlNode;

        } catch (Exception e) {
            throw new SynapseException(e);
        }       
View Full Code Here

    public XmlTemplateEngine() throws SAXException, ParserConfigurationException {
        this(DEFAULT_INDENTATION, false);
    }

    public XmlTemplateEngine(String indentation, boolean validating) throws SAXException, ParserConfigurationException {
        this(new XmlParser(validating, true), new GroovyShell());
        setIndentation(indentation);
    }
View Full Code Here

    public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
        return newParser().parse(stream);
    }

    private XmlParser newParser() throws Exception {
        XmlParser xmlParser = new XmlParser(newSaxParser());
        xmlParser.setErrorHandler(getErrorHandler());
        xmlParser.setTrimWhitespace(!isKeepWhitespace());
        return xmlParser;
    }
View Full Code Here

    public XmlTemplateEngine() throws SAXException, ParserConfigurationException {
        this(DEFAULT_INDENTATION, false);
    }

    public XmlTemplateEngine(String indentation, boolean validating) throws SAXException, ParserConfigurationException {
        this(new XmlParser(validating, true), new GroovyShell());
        setIndentation(indentation);
    }
View Full Code Here

        task.doLast(new Action<Object>() {
            public void execute(Object obj)
            {
                try
                {
                    Node root = new XmlParser().parseText(Files.toString(project.file(".classpath"), Charset.defaultCharset()));

                    HashMap<String, String> map = new HashMap<String, String>();
                    map.put("name", "org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY");
                    map.put("value", delayedString(NATIVES_DIR).call());
View Full Code Here

    public XmlTemplateEngine() throws SAXException, ParserConfigurationException {
        this(DEFAULT_INDENTATION, false);
    }

    public XmlTemplateEngine(String indentation, boolean validating) throws SAXException, ParserConfigurationException {
        this(new XmlParser(validating, true), new GroovyShell());
        this.xmlParser.setTrimWhitespace(true);
        setIndentation(indentation);
    }
View Full Code Here

        }

        public Node asNode() {
            if (node == null) {
                try {
                    node = new XmlParser().parseText(toString());
                } catch (Exception e) {
                    throw UncheckedException.throwAsUncheckedException(e);
                }
                builder = null;
                element = null;
View Full Code Here

TOP

Related Classes of groovy.util.XmlParser

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.