Examples of xpath()


Examples of com.jcabi.xml.XML.xpath()

        this.storage.lock();
        final String number;
        try {
            final XML xml = this.storage.xml();
            number = Integer.toString(
                1 + xml.xpath("/github/gists/gist/id/text()").size()
            );
            final Directives dirs = new Directives().xpath("/github/gists")
                .add("gist")
                .add("id").set(number).up()
                .add("files");
View Full Code Here

Examples of com.jcabi.xml.XML.xpath()

                .add("number", 1)
                .build()
        );
        final XML xml = storage.xml();
        MatcherAssert.assertThat(
            xml.xpath("/github/name/text()").get(0),
            Matchers.describedAs(xml.toString(), Matchers.endsWith("you!"))
        );
    }

}
View Full Code Here

Examples of com.jcabi.xml.XMLDocument.xpath()

            } catch (Exception e) {
                throw new RuntimeException("Unable to fetch list of Camel components from: " + camelComponentsListLocation, e);
            }

            XML xml = new XMLDocument(xmlString);
            List<String> connectors = xml.xpath("/connectors/connector/@id");
            for (String id : connectors) {
                result.add("camel-" + id);
            }
            availableComponents = Collections.unmodifiableSet(result);
        }
View Full Code Here

Examples of com.joshondesign.xml.Doc.xpath()

    private List<File> loadRecentDocs(File file) {
        List<File> files = new ArrayList<File>();
        if(file.exists()) {
            try {
                Doc doc = XMLParser.parse(file);
                for(Elem e : doc.xpath("//file")) {
                    File f = new File(e.attr("filepath"));
                    //files.add(new File(e.attr("filepath")));
                    if(f.exists()) {
                        files.add(f);
                    }
View Full Code Here

Examples of com.joshondesign.xml.Doc.xpath()

        rect.setFillPaint(grad);
        rect.setStrokeWidth(0);
        page.clear();
        page.add(rect);
        Doc xdoc = saveAndReadback(doc);
        Elem e = xdoc.xpath("/svg/linearGradient/stop").iterator().next();
        assertTrue("0.0".equals(e.attr("offset")));
    }
    @Test public void testLinearGradientRect() throws Exception {
        MultiGradientFill grad = new LinearGradientFill()
                .setStartX(0).setEndX(100)
View Full Code Here

Examples of com.joshondesign.xml.Doc.xpath()

        rect.setFillPaint(grad);
        rect.setStrokeWidth(0);
        page.clear();
        page.add(rect);
        Doc xdoc = saveAndReadback(doc);
        Iterator<? extends Elem> it = xdoc.xpath("/svg/linearGradient/stop").iterator();
        it.next();
        Elem e = it.next();
        assertTrue("0.5".equals(e.attr("offset")));
    }
View Full Code Here

Examples of com.joshondesign.xml.Doc.xpath()

        if(version < NativeExport.CURRENT_VERSION) {
            doc = upgradeDocument(doc);
        }
        loadNumberAttribute(doc.xpathElement("/sketchy/info"),sdoc,"width");
        loadNumberAttribute(doc.xpathElement("/sketchy/info"),sdoc,"height");
        for(Elem e : doc.xpath("/sketchy/page")) {
            loadPage(sdoc,e,zipFile);
        }
        String type = doc.xpathString("/sketchy/info/@type");
        if("presentation".equals(type)) {
            sdoc.setPresentation(true);
View Full Code Here

Examples of com.joshondesign.xml.Doc.xpath()

    public static List<SNode> loadShapes(File file, ZipFile zipFile) throws Exception {
        Doc doc = XMLParser.parse(new FileInputStream(file));
        doc.setBaseURI(file.toURI());
        List<SNode> shapes = new ArrayList<SNode>();
        for(Elem e : doc.xpath("/sketchy/*")) {
            shapes.add(loadAnyShape(e,zipFile));
        }
        return shapes;
    }

View Full Code Here

Examples of com.joshondesign.xml.Elem.xpath()

            loadBooleanAttribute(info,sdoc,"gridActive");
            loadBooleanAttribute(info,sdoc,"pagesVisible");
            if(info.hasAttr("backgroundFill")) {
                sdoc.setBackgroundFill(loadFillPaint(info, "backgroundFill", zipFile));
            }
            for(Elem element : info.xpath("property")) {
                sdoc.setStringProperty(
                        element.attr("name"),
                        element.attr("value"));
            }
View Full Code Here

Examples of com.joshondesign.xml.Elem.xpath()

                    ;
            if(egrad.hasAttr("startXSnapped")) fill.setStartXSnapped(LinearGradientFill.Snap.valueOf(egrad.attr("startXSnapped")));
            if(egrad.hasAttr("startYSnapped"))fill.setStartYSnapped(LinearGradientFill.Snap.valueOf(egrad.attr("startYSnapped")));
            if(egrad.hasAttr("endXSnapped"))fill.setEndXSnapped(LinearGradientFill.Snap.valueOf(egrad.attr("endXSnapped")));
            if(egrad.hasAttr("endYSnapped"))fill.setEndYSnapped(LinearGradientFill.Snap.valueOf(egrad.attr("endYSnapped")));
            for(Elem stop : egrad.xpath("stop")) {
                fill.addStop(
                        Double.parseDouble(stop.attr("position")),
                        new FlatColor(stop.attr("color"))
                        );
            }
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.