Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject.selectPath()


                }

                if (cursor.isContainer()) {
                    Element elm = (Element) cursor.getDomNode();
                    String path = createXPath(elm);
                    XmlObject[] paths = destXml.selectPath(path);
                    if (paths != null && paths.length > 0) {
                        Element elm2 = (Element) paths[0].getDomNode();

                        // transfer attributes
                        transferAttributes(elm, elm2);
View Full Code Here


            String namespaces = declareXPathNamespaces(xmlObject);
            if (namespaces != null && namespaces.trim().length() > 0) {
                xpath = namespaces + xpath;
            }

            XmlObject[] path = xmlObject.selectPath(xpath);
            for (XmlObject xml : path) {
                setNodeValue(xml.getDomNode(), value);
            }

            return xmlObject.toString();
View Full Code Here

    }

    public static String getXPathValue(String value, String xpath) {
        try {
            XmlObject xmlObject = XmlObject.Factory.parse(value);
            XmlObject[] nodes = xmlObject.selectPath(xpath);
            if (nodes.length > 0) {
                return getNodeValue(nodes[0].getDomNode());
            }
        } catch (Throwable e) {
            e.printStackTrace();
View Full Code Here

    protected abstract String getRootElementName();

    protected CTGroupShape getSpTree(){
        if(_spTree == null) {
            XmlObject root = getXmlObject();
            XmlObject[] sp = root.selectPath(
                    "declare namespace p='http://schemas.openxmlformats.org/presentationml/2006/main' .//*/p:spTree");
            if(sp.length == 0) throw new IllegalStateException("CTGroupShape was not found");
            _spTree = (CTGroupShape)sp[0];
        }
        return _spTree;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.