Package oracle.xml.parser.v2

Examples of oracle.xml.parser.v2.XMLError


/** XMLDocument initialisation
*/
  public XmlConfig(String configFileName){
     try {
         DOMParser parser = new DOMParser();
         URL url = createURL(configFileName);
         parser.setErrorStream(System.err);
         parser.showWarnings(true);
         parser.parse(url);
         configDoc = parser.getDocument();
         rootConfigNode = (XMLNode) configDoc;
     } catch (Exception e) {
         System.out.println(e.toString());
     }
  }
View Full Code Here


    protected void init() throws JBIException {
        super.init();
        if (xsql == null) {
            if (xsqlResource != null) {
                try {
                    DOMParser parser = new DOMParser();
                    parser.parse(xsqlResource.getInputStream());
                    xsql = parser.getDocument();
                }
                catch (Exception e) {
                    throw new JBIException("Failed to parse: " + xsqlResource +". Reason: " + e, e);
                }
            }
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

    protected XMLDocument createXSQLDocument(MessageExchange exchange, NormalizedMessage in) throws MessagingException {
        if (xsql != null) {
            return xsql;
        }
        try {
            DocumentBuilder builder = new DocumentBuilder();
            SAXResult result = new SAXResult(builder);
            sourceTransformer.toResult(in.getContent(), result);
            return builder.getDocument();
        }
        catch (TransformerException e) {
            throw new MessagingException("Failed to convert inbound message content to an XMLDocument. Reason: " + e, e);
        }
    }
View Full Code Here

          showExemple(xpath + "text()");

          //parcoure des ATTRIBUE
          NamedNodeMap nnm =  n.getAttributes();
          for (int i = 0; i < nnm.getLength(); i++) {
            XMLAttr att = (XMLAttr) nnm.item(i);
            showExemple(xpath + "@"+att.getExpandedName());
          }
         

          //parcoure des nodes
          NodeList nl =  n.getChildNodes();
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

        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

TOP

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

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.