Package org.pdf4j.saxon

Examples of org.pdf4j.saxon.AugmentedSource


     *         the document node at the root of the tree of the resulting in-memory document.
     */

    public XdmNode build(Source source) throws SaxonApiException {

        AugmentedSource as = AugmentedSource.makeAugmentedSource(source);
        as.setDTDValidationMode(dtdValidation ? Validation.STRICT : Validation.STRIP);
        if (schemaValidator != null) {
            as.setSchemaValidationMode(schemaValidator.isLax() ? Validation.LAX : Validation.STRICT);
            if (schemaValidator.getDocumentElementName() != null) {
                as.setTopLevelElement(schemaValidator.getDocumentElementName().getStructuredQName());
            }
            if (schemaValidator.getDocumentElementType() != null) {
                as.setTopLevelType(schemaValidator.getDocumentElementType());
            }
        }
        if (whitespacePolicy != null) {
            as.setStripSpace(whitespacePolicy.ordinal());
        }
        as.setLineNumbering(lineNumbering);
        if (source.getSystemId() == null && baseURI != null) {
            source.setSystemId(baseURI.toString());
        }
        try {
            NodeInfo doc = config.buildDocument(as);
View Full Code Here


            } else {
                return origin;
            }
        } else {
            if (stripSpace) {
                AugmentedSource as = AugmentedSource.makeAugmentedSource(source);
                as.setStripSpace(Whitespace.ALL);
                source = as;
            }
            return config.buildDocument(source);
        }
    }
View Full Code Here

        XMLReader parser = null;
        SchemaType topLevelType = null;

        if (source instanceof AugmentedSource) {
            AugmentedSource as = (AugmentedSource)source;
            options.setPleaseCloseAfterUse(as.isPleaseCloseAfterUse());
            stripSpace = as.getStripSpace();
            if (as.isXIncludeAwareSet()) {
                options.setXIncludeAware(as.isXIncludeAware());
            }
            options.setSourceIsXQJ(as.sourceIsXQJ());

            int localValidate = ((AugmentedSource)source).getSchemaValidation();
            if (localValidate != Validation.DEFAULT) {
                schemaValidation = localValidate;
                if (isFinal) {
View Full Code Here

        boolean stable = true;
        NamePool pool = context.getController().getNamePool();

        StreamSource source = new StreamSource(catalogFile.toString());
        AugmentedSource as = AugmentedSource.makeAugmentedSource(source);
        as.setSchemaValidationMode(Validation.SKIP);
        DocumentInfo catalog = context.getConfiguration().buildDocument(as);       
//        DocumentInfo catalog =
//                (DocumentInfo) Document.makeDoc(catalogFile.toString(), null, context, null);
        if (catalog==null) {
            // we failed to read the catalogue
View Full Code Here

     * {@link Configuration#buildDocument}
    */

    public NodeInfo build(Source source) throws XPathException {
        if (stripSpace) {
            AugmentedSource as = AugmentedSource.makeAugmentedSource(source);
            as.setStripSpace(Whitespace.ALL);
            source = as;
        } else if (source instanceof NodeInfo) {
            return (NodeInfo)source;
        }
        return getConfiguration().buildDocument(source);
View Full Code Here

        // This method is weird. It seems the user is expected to supply an XMLReader that already
        // knows what document it is supposed to read!
        try {
            Source ss = new SAXSource(value, new InputSource("dummy"));
            ss = augmentSource(ss, type);
            AugmentedSource as = AugmentedSource.makeAugmentedSource(ss);
            as.setSourceIsXQJ(true);
            DocumentInfo doc = getConfiguration().buildDocument(as);
            checkDocumentType(doc, (SaxonXQItemType)type);
            return new SaxonXQItem(doc, this);
        } catch (XPathException de) {
            throw newXQException(de);
View Full Code Here

                    break;
                default:
                    throw new XQException("Required item type for document node is incorrect");
            }
        }
        AugmentedSource out = AugmentedSource.makeAugmentedSource(in);
        out.setSchemaValidationMode(Validation.STRICT);
        return out;
    }
View Full Code Here

TOP

Related Classes of org.pdf4j.saxon.AugmentedSource

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.