Package net.sf.saxon.expr

Examples of net.sf.saxon.expr.ExpressionLocation


        if (!cache.contains(nameCode)) {
            if (!checker.isValidNCName(pool.getLocalName(nameCode))) {
                XPathException err = new XPathException("Invalid XML 1.0 element name " +
                        Err.wrap(pool.getLocalName(nameCode), Err.ELEMENT));
                err.setErrorCode("SERE0005");
                err.setLocator(new ExpressionLocation(getPipelineConfiguration().getLocationProvider(), locationId));
                throw err;
            }
            cache.add(nameCode);
        }
        nextReceiver.startElement(nameCode, typeCode, locationId, properties);
View Full Code Here


        if (!cache.contains(nameCode)) {
            if (!checker.isValidNCName(pool.getLocalName(nameCode))) {
                XPathException err = new XPathException("Invalid XML 1.0 attribute name " +
                        Err.wrap(pool.getLocalName(nameCode), Err.ATTRIBUTE));
                err.setErrorCode("SERE0005");
                err.setLocator(new ExpressionLocation(getPipelineConfiguration().getLocationProvider(), locationId));
                throw err;
            }
            cache.add(nameCode);
        }
        checkString(value, locationId);
View Full Code Here

    public void processingInstruction(String target, CharSequence data, int locationId, int properties) throws XPathException {
        if (!checker.isValidNCName(target)) {
            XPathException err = new XPathException("Invalid XML 1.0 processing instruction name " +
                    Err.wrap(target));
            err.setErrorCode("SERE0005");
            err.setLocator(new ExpressionLocation(getPipelineConfiguration().getLocationProvider(), locationId));
            throw err;
        }
        checkString(data, locationId);
        nextReceiver.processingInstruction(target, data, locationId, properties);
    }
View Full Code Here

            }
            if (!XMLCharacterData.isValid10(ch32)) {
                XPathException err = new XPathException("The result tree contains a character not allowed by XML 1.0 (hex " +
                        Integer.toHexString(ch32) + ')');
                err.setErrorCode("SERE0006");
                err.setLocator(new ExpressionLocation(getPipelineConfiguration().getLocationProvider(), locationId));
                throw err;
            }
        }
    }
View Full Code Here

    protected void reportError (SAXParseException e, boolean isFatal) {
        errorCount++;
        if (errorListener != null) {
            try {
                ExpressionLocation loc =
                        new ExpressionLocation(e.getSystemId(), e.getLineNumber(), e.getColumnNumber());
                XPathException err = new XPathException("Error reported by XML parser", loc, e);
                err.setErrorCode(SaxonErrorCode.SXXP0003);
                if (isFatal) {
                    errorListener.fatalError(err);
                } else {
View Full Code Here

      * @param location the StAX Location object
      * @return a Saxon/SAX SourceLocator object
      */

     private ExpressionLocation translateLocation(Location location) {
         ExpressionLocation loc = new ExpressionLocation();
         if (location != null) {
             loc.setLineNumber(location.getLineNumber());
             loc.setColumnNumber(location.getColumnNumber());
             loc.setSystemId(location.getSystemId());
             //loc.setPublicId(location.getPublicId());
         }
         return loc;
     }
View Full Code Here

    private class StaxErrorReporter implements XMLReporter {

        public void report(String message, String errorType,
                           Object relatedInformation, Location location)
                throws XMLStreamException {
            ExpressionLocation loc = translateLocation(location);
            XPathException err = new XPathException("Error reported by XML parser: " + message + " (" + errorType + ')');
            err.setLocator(loc);
            try {
                pipe.getErrorListener().error(err);
            } catch (TransformerException e) {
View Full Code Here

                    hostLanguage,
                    pendingStartTag == -2,
                    getPipelineConfiguration().isSerializing());
            LocationProvider lp = getPipelineConfiguration().getLocationProvider();
            if (lp != null) {
                err.setLocator(new ExpressionLocation(lp, locationId));
            }
            throw err;
        }

        // if this is a duplicate attribute, overwrite the original, unless
View Full Code Here

    }

    public Location getLocation() {
        SourceLocator sourceLocator = provider.getSourceLocator();
        if (sourceLocator == null) {
            sourceLocator = new ExpressionLocation();
        }
        return new SourceStreamLocation(sourceLocator);
    }
View Full Code Here

        if (!cache.contains(nameCode)) {
            if (!checker.isValidNCName(pool.getLocalName(nameCode))) {
                XPathException err = new XPathException("Invalid XML 1.0 element name " +
                        Err.wrap(pool.getLocalName(nameCode), Err.ELEMENT));
                err.setErrorCode("SERE0005");
                err.setLocator(new ExpressionLocation(getPipelineConfiguration().getLocationProvider(), locationId));
                throw err;
            }
            cache.add(nameCode);
        }
        nextReceiver.startElement(nameCode, typeCode, locationId, properties);
View Full Code Here

TOP

Related Classes of net.sf.saxon.expr.ExpressionLocation

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.