Package net.sf.saxon.trans

Examples of net.sf.saxon.trans.DynamicError


                Object o = ((VirtualNode)item).getUnderlyingNode();
                if (o instanceof Node) {
                    nodes.add(o);
                } else {
                    if (requireXOM) {
                        DynamicError err = new DynamicError("Extension function required class " + targetClass.getName() +
                                "; supplied value of class " + item.getClass().getName() +
                                " could not be converted");
                        throw err;
                    };
                }
            } else if (requireXOM) {
                DynamicError err = new DynamicError("Extension function required class " + targetClass.getName() +
                            "; supplied value of class " + item.getClass().getName() +
                            " could not be converted");
                throw err;
            } else {
                return null;
            }
        }

        if (nodes.size() == 0 && !requireXOM) {
            return null// empty sequence supplied - try a different mapping
        }
        if (Node.class.isAssignableFrom(targetClass)) {
            if (nodes.size() != 1) {
                DynamicError err = new DynamicError("Extension function requires a single XOM Node" +
                                "; supplied value contains " + nodes.size() + " nodes");
                throw err;
            }
            return nodes.get(0);
        } else if (targetClass.isArray() && Node.class.isAssignableFrom(targetClass.getComponentType())) {
View Full Code Here


                                }
                            }
                        }
                    }
                } catch (XMLStreamException e) {
                    throw new DynamicError(e);
                }
            default:
                throw new IllegalStateException("getStringValue() called when current event is " + currentEvent);

        }
View Full Code Here

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

                }
            }

            String path = getServletContext().getRealPath(source);
            if (path==null) {
                throw new DynamicError("Source file " + source + " not found");
            }
            File sourceFile = new File(path);
            transformer.transform(new StreamSource(sourceFile), new StreamResult(out));
        } catch (Exception err) {
            out.println(err.getMessage());
View Full Code Here

    */

    private synchronized Templates tryCache(String url) throws TransformerException {
        String path = getServletContext().getRealPath(url);
        if (path==null) {
            throw new DynamicError("Stylesheet " + url + " not found");
        }

        Templates x = (Templates)cache.get(path);
        if (x==null) {
            TransformerFactory factory = TransformerFactory.newInstance();
View Full Code Here

            XMLInputFactory factory = XMLInputFactory.newInstance();
            factory.setXMLReporter(new StaxErrorReporter());
            XMLStreamReader reader = factory.createXMLStreamReader(systemId, inputStream);
            this.reader = reader;
        } catch (XMLStreamException e) {
            throw new DynamicError(e);
        }
    }
View Full Code Here

                int c = message.indexOf("\nMessage: ");
                if (c > 0) {
                    message = message.substring(c+10);
                }
            }
            DynamicError err = new DynamicError("Error reported by XML parser: " + message);
            err.setErrorCode(SaxonErrorCode.SXXP0003);
            err.setLocator(translateLocation(e.getLocation()));
            throw err;
        }
        return currentEvent;
    }
View Full Code Here

                                return currentEvent;
                            }
                        }
                    }
                } catch (XMLStreamException e) {
                    throw new DynamicError(e);
                }
                throw new IllegalStateException(
                        "Element start has no matching element end");
            default:
                throw new IllegalStateException(
View Full Code Here

TOP

Related Classes of net.sf.saxon.trans.DynamicError

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.