Package kiss

Examples of kiss.XML.find()


    private synchronized XML rebuild(Path file) {
        long now = new Date().getTime();
        XML html = I.xml(file);

        // append live coding script
        html.find("script[src=\"application.js\"]").after(I
                .xml("script")
                .attr("type", "text/javascript")
                .attr("src", "live.js"));

        // ignore cache
View Full Code Here


                .xml("script")
                .attr("type", "text/javascript")
                .attr("src", "live.js"));

        // ignore cache
        for (XML link : html.find("link[rel=stylesheet]")) {
            String href = link.attr("href");

            if (href.length() != 0 && !href.startsWith("http://") && !href.startsWith("htttps://")) {
                link.attr("href", href + "?" + now);
            }
View Full Code Here

            if (href.length() != 0 && !href.startsWith("http://") && !href.startsWith("htttps://")) {
                link.attr("href", href + "?" + now);
            }
        }

        for (XML link : html.find("script[src]")) {
            String src = link.attr("src");

            if (src.length() != 0 && !src.startsWith("http://") && !src.startsWith("htttps://")) {
                link.attr("src", src + "?" + now);
            }
View Full Code Here

            Events<WatchEvent<Path>> observable = I.observe(html);

            XML xml = I.xml(html);

            // observe js
            for (XML js : xml.find("script[src]")) {
                String src = js.attr("src");

                if (src.length() != 0 && !src.startsWith("http://") && !src.startsWith("https://")) {
                    observable = observable.merge(observeFile(src));
                }
View Full Code Here

                }
            }
            observable = observable.merge(observeFile("live.js"));

            // observe css
            for (XML css : xml.find("link[rel=stylesheet]")) {
                String href = css.attr("href");

                if (href.length() != 0 && !href.startsWith("http://") && !href.startsWith("https://")) {
                    observable = observable.merge(observeFile(href));
                }
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.