Package org.pdf4j.saxon.event

Examples of org.pdf4j.saxon.event.LocationProvider


            siblingsAtDepth = p2;
        }
        prevAtDepth[currentDepth] = -1;
        siblingsAtDepth[currentDepth] = 0;

        LocationProvider locator = pipe.getLocationProvider();
        if (locator instanceof SourceLocationProvider) {
            tree.setSystemId(nodeNr, locator.getSystemId(locationId));
//            if (lineNumbering) {
//                tree.setLineAndColumn(nodeNr, locator.getLineNumber(locationId), locator.getColumnNumber(locationId));
//            }
        } else if (currentDepth == 1) {
            tree.setSystemId(nodeNr, systemId);
        }
        if (lineNumbering) {
            tree.setLineNumber(nodeNr, locator.getLineNumber(locationId), locator.getColumnNumber(locationId));
        }
    }
View Full Code Here


        }
        tree.next[nodeNr] = prevAtDepth[currentDepth - 1];   // *O* owner pointer in last sibling
        prevAtDepth[currentDepth] = nodeNr;
        siblingsAtDepth[currentDepth]++;

        LocationProvider locator = pipe.getLocationProvider();
        if (locator instanceof SourceLocationProvider) {
            tree.setSystemId(nodeNr, locator.getSystemId(locationId));
            if (lineNumbering) {
                tree.setLineNumber(nodeNr, locator.getLineNumber(locationId), locator.getColumnNumber(locationId));
            }
        }
    }
View Full Code Here

     */

    public void write(Item item) throws XPathException {
        ExpressionLocation loc = new ExpressionLocation();
        if (locationId != -1) {
            LocationProvider provider = getPipelineConfiguration().getLocationProvider();
            loc.setSystemId(provider.getSystemId(locationId));
            loc.setLineNumber(provider.getLineNumber(locationId));
        }
        listener.message(new XdmNode((NodeInfo)item), terminate, loc);
    }
View Full Code Here

    public void processingInstruction (String name, CharSequence remainder, int locationId, int properties)
    {
      int nameCode = namePool.allocate("", "", name);
        ProcInstImpl pi = new ProcInstImpl(nameCode, remainder.toString());
        currentNode.addChild(pi, size[depth]++);
        LocationProvider locator = pipe.getLocationProvider();
        if (locator!=null) {
            pi.setLocation(locator.getSystemId(locationId),
                           locator.getLineNumber(locationId));
        }
    }
View Full Code Here

    }

    public Location getLocation() {
        if (startElementEvent != null) {
            PipelineConfiguration pipe = startElementEvent.getPipelineConfiguration();
            final LocationProvider provider = pipe.getLocationProvider();
            final int locationId = startElementEvent.getLocationId();
            return new Location() {
                public int getCharacterOffset() {
                    return -1;
                }

                public int getColumnNumber() {
                    return provider.getColumnNumber(locationId);
                }

                public int getLineNumber() {
                    return provider.getLineNumber(locationId);
                }

                public String getPublicId() {
                    return null;
                }

                public String getSystemId() {
                    return provider.getSystemId(locationId);
                }
            };
        } else if (currentItem instanceof NodeInfo) {
            final NodeInfo node = (NodeInfo)currentItem;
            return new Location() {
View Full Code Here

TOP

Related Classes of org.pdf4j.saxon.event.LocationProvider

Copyright © 2018 www.massapicom. 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.