Package org.apache.commons.jxpath

Examples of org.apache.commons.jxpath.JXPathContext.iteratePointers()


        if (ptr.getNode() != null) {
            // There are some nodes to load from

            JXPathContext repeaterContext = jctx.getRelativeContext(ptr);
            // build a jxpath iterator for pointers
            Iterator rowPointers = repeaterContext.iteratePointers(this.rowPath);

            //iterate through it
            int rowNum = 0;
            while (rowPointers.hasNext()) {
                // Get a row. It is created if needed (depends on clearOnLoad)
View Full Code Here


    dbf.setValidating(false);
    DocumentBuilder db = dbf.newDocumentBuilder();
    db.setEntityResolver(new JXL.JXLEntityResolver());
    Document document = db.parse(file);
    JXPathContext ctx= JXPathContext.newContext(document);
    Iterator it = ctx.iteratePointers("//xslt[@href]");
    URI uri = file.toURI();
    while (it.hasNext()) {
      Pointer p = (Pointer) it.next();
      Element xsltElem = (Element) p.getNode();
      URI xslURI = uri.resolve(xsltElem.getAttribute("href"));
View Full Code Here

    private void importTemplates(DocumentBuilder db, org.w3c.dom.Document document, String systemId)
                          throws SAXException, IOException {
        URI uri = URI.create(systemId);
        JXPathContext context = JXPathContext.newContext(document.getDocumentElement());
        for (Iterator it = context.iteratePointers("template"); it.hasNext();) {
            Pointer pointer = (Pointer) it.next();
            Element element = (Element) pointer.getNode();
            Template template = new Template(element, this);
            template.setSystemId(systemId);
            templateList.add(template);
View Full Code Here

            Element include = null;
            NodeList nodeList = elem.getElementsByTagName("include");
            if (nodeList.getLength() > 0) {
                include = (Element) nodeList.item(0);
                JXPathContext ctx = JXPathContext.newContext(include);
                for (Iterator it2 = ctx.iteratePointers("pattern"); it2.hasNext();) {
                    DOMNodePointer p2 = (DOMNodePointer) it2.next();
                    Element pattern = (Element) p2.getBaseValue();
                    Element newInclude = document.createElement("include");
                    newInclude.appendChild(document.createTextNode(DOMUtil.getText(pattern)));
                    uriPatterns.appendChild(newInclude);
View Full Code Here

            Element exclude = null;
            nodeList = elem.getElementsByTagName("exclude");
            if (nodeList.getLength() > 0) {
                exclude = (Element) nodeList.item(0);
                JXPathContext ctx = JXPathContext.newContext(exclude);
                for (Iterator it2 = ctx.iteratePointers("pattern"); it2.hasNext();) {
                    DOMNodePointer p2 = (DOMNodePointer) it2.next();
                    Element pattern = (Element) p2.getBaseValue();
                    Element newExclude = document.createElement("exclude");
                    newExclude.appendChild(document.createTextNode(DOMUtil.getText(pattern)));
                    uriPatterns.appendChild(newExclude);
View Full Code Here

        int initialSize = repeater.getSize();
       
        // build a jxpath iterator for pointers
        JXPathContext repeaterContext =
            jxpc.getRelativeContext(jxpc.getPointer(this.repeaterPath));
        Iterator rowPointers = repeaterContext.iteratePointers(this.rowPath);
        //iterate through it
        while (rowPointers.hasNext()) {
            // create a new row, take that as the frmModelSubContext
            Repeater.RepeaterRow thisRow;
            if (initialSize > 0) {
View Full Code Here

            // Get the identity
            List identity = getIdentity(thisRow);
           
            if (hasNonNullElements(identity)) {
                // iterate nodes to find match
                Iterator rowPointers = repeaterContext.iteratePointers(this.rowPath);
                boolean found = false;
                while (rowPointers.hasNext()) {
                    Pointer jxp = (Pointer) rowPointers.next();
                    JXPathContext rowContext = repeaterContext.getRelativeContext(jxp);
                    List contextIdentity = getIdentity(rowContext);
View Full Code Here

        if (ptr.getNode() != null) {
            // There are some nodes to load from

            JXPathContext repeaterContext = jctx.getRelativeContext(ptr);
            // build a jxpath iterator for pointers
            Iterator rowPointers = repeaterContext.iteratePointers(this.rowPath);

            //iterate through it
            int rowNum = 0;
            while (rowPointers.hasNext()) {
                // Get a row. It is created if needed (depends on clearOnLoad)
View Full Code Here

            // Narrow to repeater context.
            JXPathContext repeaterContext = jctx.getRelativeContext(repeaterPointer);

            // Build a jxpath iterator for the repeater row pointers.
            Iterator rowPointers = repeaterContext.iteratePointers(this.rowPath);

            // Iterate through the rows of data.
            int rowNum = 0;
            while (rowPointers.hasNext()) {
View Full Code Here

       
        // Unfortunately the following statement doesn't work (it doesn't removes all elements from the
        // list because of a bug in JXPath) so I had to work out another immediate solution
        //multiValueContext.removeAll(this.rowPath);
       
        Iterator rowPointers = multiValueContext.iteratePointers(this.rowPath);
        List l = new ArrayList();
        while( rowPointers.hasNext() )
        {
            Pointer p = (Pointer)rowPointers.next();
            l.add(p.asPath());
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.