Package oracle.xml.parser.v2

Examples of oracle.xml.parser.v2.XMLDocument


            throw XMLPlatformException.xmlPlatformInvalidXPath(e);
        }
    }

    public Document createDocument() throws XMLPlatformException {
        return new XMLDocument();
    }
View Full Code Here


        return new XMLDocument();
    }

    public Document createDocumentWithPublicIdentifier(String name, String publicIdentifier, String systemIdentifier) throws XMLPlatformException {
        try {
            XMLDocument xmlDocument = (XMLDocument)createDocument();
            Element rootElement = xmlDocument.createElement(name);
            xmlDocument.appendChild(rootElement);
            xmlDocument.setDoctype(name, systemIdentifier, publicIdentifier);
            return xmlDocument;
        } catch (Exception e) {
            throw XMLPlatformException.xmlPlatformCouldNotCreateDocument(e);
        }
    }
View Full Code Here

                Element rootElement = document.createElement(name);
                document.appendChild(rootElement);
                return document;
            }

            XMLDocument xmlDocument = (XMLDocument)createDocument();
            Element rootElement = xmlDocument.createElement(name);
            xmlDocument.appendChild(rootElement);
            xmlDocument.setDoctype(name, systemIdentifier, null);
            return xmlDocument;
        } catch (Exception e) {
            throw XMLPlatformException.xmlPlatformCouldNotCreateDocument(e);
        }
    }
View Full Code Here

        transform(source, result);
    }

    public void transform(Node sourceNode, Writer resultWriter) throws XMLPlatformException {
        try {
            XMLDocument xmlDocument;
            if (sourceNode.getNodeType() == Node.DOCUMENT_NODE) {
                xmlDocument = (XMLDocument)sourceNode;
            } else {
                xmlDocument = (XMLDocument)sourceNode.getOwnerDocument();
            }

            if (isFragment()) {
                xmlDocument.setEncoding(null);
                xmlDocument.setVersion(null);
            } else {
                xmlDocument.setEncoding(getEncoding());
                xmlDocument.setVersion(getVersion());
            }

            XMLNode xmlNode = (XMLNode)sourceNode;
            PrintWriter printWriter = new PrintWriter(resultWriter);
            XDKPrintDriver xdkPrintDriver = new XDKPrintDriver(printWriter);
View Full Code Here

    public void transform(Document sourceDocument, Node resultParentNode, URL stylesheet) throws XMLPlatformException {
        try {
            XSLProcessor xslProcessor = new XSLProcessor();
            XSLStylesheet xslStylesheet = xslProcessor.newXSLStylesheet(stylesheet);
            XMLDocument xmlDocument = (XMLDocument)sourceDocument;
            XMLDocumentFragment resultDocumentFragment = xslProcessor.processXSL(xslStylesheet, xmlDocument);
            resultParentNode.appendChild(resultDocumentFragment);
        } catch (XSLException e) {
            throw XMLPlatformException.xmlPlatformTransformException(e);
        }
View Full Code Here

    }

    // Implementation methods
    //-------------------------------------------------------------------------
    protected boolean transform(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws MessagingException {
        XMLDocument document = createXSQLDocument(exchange, in);
        XSQLRequest request = createXSQLRequest(exchange, in, document);
        Document response = request.processToXML();
        out.setContent(new DOMSource(response));
        return true;
    }
View Full Code Here

            }
        };

        DOMParser parser = new DOMParser();
        parser.parse(new StringReader("<xsql:query xmlns:xsql='urn:oracle-xsql' connection='demo' tag-case='lower' row-element='cheese' rowset-element='food'> select * from cheese </xsql:query>"));
        XMLDocument document = parser.getDocument();
        XSQLRequest request = new XSQLRequest(factory, document, new URL("http://foo.com"));
        Document response = request.processToXML();
        System.out.println("XML is:");
        System.out.println(transformer.toString(new DOMSource(response)));
    }
View Full Code Here

        }
    }

    public void transform(Node sourceNode, Writer resultWriter) throws XMLPlatformException {
        try {
            XMLDocument xmlDocument;
            if (sourceNode.getNodeType() == Node.DOCUMENT_NODE) {
                xmlDocument = (XMLDocument)sourceNode;
            } else {
                xmlDocument = (XMLDocument)sourceNode.getOwnerDocument();
            }

            if (isFragment()) {
                xmlDocument.setEncoding(null);
                xmlDocument.setVersion(null);
            } else {
                xmlDocument.setEncoding(getEncoding());
                xmlDocument.setVersion(getVersion());
            }

            XMLNode xmlNode = (XMLNode)sourceNode;
            PrintWriter printWriter = new PrintWriter(resultWriter);
            XDKPrintDriver xdkPrintDriver = new XDKPrintDriver(printWriter);
View Full Code Here

    public void transform(Document sourceDocument, Node resultParentNode, URL stylesheet) throws XMLPlatformException {
        try {
            XSLProcessor xslProcessor = new XSLProcessor();
            XSLStylesheet xslStylesheet = xslProcessor.newXSLStylesheet(stylesheet);
            XMLDocument xmlDocument = (XMLDocument)sourceDocument;
            XMLDocumentFragment resultDocumentFragment = xslProcessor.processXSL(xslStylesheet, xmlDocument);
            resultParentNode.appendChild(resultDocumentFragment);
        } catch (XSLException e) {
            throw XMLPlatformException.xmlPlatformTransformException(e);
        }
View Full Code Here

            throw XMLPlatformException.xmlPlatformInvalidXPath(e);
        }
    }

    public Document createDocument() throws XMLPlatformException {
        return new XMLDocument();
    }
View Full Code Here

TOP

Related Classes of oracle.xml.parser.v2.XMLDocument

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.