Examples of xpathElement()


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

        Log.info("version = ",version);
        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");
View Full Code Here

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

        Log.info("version = ",version);
        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)) {
View Full Code Here

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

        String type = doc.xpathString("/sketchy/info/@type");
        if("presentation".equals(type)) {
            sdoc.setPresentation(true);
        }

        Elem info = doc.xpathElement("/sketchy/info");
        if(info != null) {
            loadBooleanAttribute(info,sdoc,"gridActive");
            loadBooleanAttribute(info,sdoc,"pagesVisible");
            if(info.hasAttr("backgroundFill")) {
                sdoc.setBackgroundFill(loadFillPaint(info, "backgroundFill", zipFile));
View Full Code Here

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

        sdoc.removePage(sdoc.getCurrentPage());
        SketchDocument.SketchPage page = sdoc.addPage();
        u.p("parsing");
        Doc doc = XMLParser.parse(stream);
        u.p("parsed");
        Elem svg = doc.xpathElement("/svg");
        for(Elem n : svg.xpath("./*")) {
            u.p("node = " + n + " " + n.name());
            SNode node = loadNode(n);
            if(node != null) page.add(node);
        }
View Full Code Here

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

            }
            for(File xml : new File(basedir,"hardware/boards/").listFiles()) {
                Util.p("parsing: " + xml.getCanonicalPath());
                try {
                    Doc doc = XMLParser.parse(xml);
                    Elem e = doc.xpathElement("/board");
                    Device d = new Device();
                    d.name = e.attr("name");
                    d.protocol = e.attr("protocol");
                    d.maximum_size = Integer.parseInt(e.attr("maximum-size"));
                    d.upload_speed = Integer.parseInt(e.attr("upload-speed"));
View Full Code Here

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

    }

    private Example parseExample(File file) {
        try {
            Doc doc = XMLParser.parse(file);
            Elem e = doc.xpathElement("/example");
            Example ex = new Example();
            ex.name = e.attr("name");
            for(Elem k : e.xpath("keyword")) {
                ex.keywords.add(k.text().toLowerCase());
                //Util.p("added keyword: " + k.text().toLowerCase());
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.