Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMNode.serialize()


                    osForTarget = new FileOutputStream(tempTargetFile);

                    XMLStreamWriter xsWriterForSource =
                        XMLOutputFactory.newInstance().createXMLStreamWriter(osForSource);

                    sourceNode.serialize(xsWriterForSource);
                    transformSrc = new StreamSource(tempSourceFile);
                    transformTgt = new StreamResult(osForTarget);

                } catch (XMLStreamException e) {
                    handleException("Error creating a StreamResult for the transformation", e, synCtx);
View Full Code Here


      XMLStreamWriter writer =
        XMLOutputFactory.newInstance().createXMLStreamWriter(out);
      writer.writeStartElement("");
      for (Iterator nodes = this.getChildren(); nodes.hasNext();) {
        OMNode node = (OMNode) nodes.next();
        node.serialize(writer);
      }
      writer.writeEndElement();
      return out.toString().substring(2);
    } catch (Exception e) {}
    return "";
View Full Code Here

            StringWriter out = new StringWriter();
            XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(out);
            writer.writeStartElement("");
            for (Iterator<?> nodes = this.getChildren(); nodes.hasNext();) {
                OMNode node = (OMNode)nodes.next();
                node.serialize(writer);
            }
            writer.writeEndElement();
            return out.getBuffer().toString().substring(2);
        } catch (Exception e) {
        }
View Full Code Here

            ByteArrayOutputStream baosForSource = new ByteArrayOutputStream();
            XMLStreamWriter xsWriterForSource = XMLOutputFactory.newInstance().createXMLStreamWriter(baosForSource);

            // serialize the validation target and get an input stream into it
            sourceNode = getValidateSource(synCtx);
            sourceNode.serialize(xsWriterForSource);
            baisFromSource = new ByteArrayInputStream(baosForSource.toByteArray());

        } catch (Exception e) {
            String msg = "Error accessing source element for validation : " + source;
            log.error(msg);
View Full Code Here

            ByteArrayOutputStream baosForSource = new ByteArrayOutputStream();
            XMLStreamWriter xsWriterForSource = XMLOutputFactory.newInstance().createXMLStreamWriter(baosForSource);

            OMNode sourceNode = getTransformSource(synCtx);
            log.debug("Transformation source : " + sourceNode);
            sourceNode.serialize(xsWriterForSource);
            Source transformSrc = new StreamSource(new ByteArrayInputStream(baosForSource.toByteArray()));

            // create a new Stream result over a new BAOS..
            ByteArrayOutputStream baosForTarget = new ByteArrayOutputStream();
            StreamResult transformTgt = new StreamResult(baosForTarget);
View Full Code Here

    }

    public void testElementSerilizationChild() throws Exception {
        OMElement elt = builder.getDocumentElement();
        OMNode node = elt.getFirstOMChild().getNextOMSibling();
        node.serialize(writer);

    }

    public void testElementSerilizationSOAPBodyCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
View Full Code Here

    }

    public void testElementSerilizationSOAPBodyCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        OMNode node = env.getBody();
        node.serialize(writer);
    }

    public void testElement() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        SOAPBody body = env.getBody();
View Full Code Here

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(out);
            writer.writeStartElement("");
            for (Iterator<?> nodes = this.getChildren(); nodes.hasNext();) {
                OMNode node = (OMNode)nodes.next();
                node.serialize(writer);
            }
            writer.writeEndElement();
            return out.toString().substring(2);
        } catch (Exception e) {
        }
View Full Code Here

    }

    public void testElementSerilizationChild() throws Exception {
        OMElement elt = builder.getDocumentElement();
        OMNode node = elt.getFirstOMChild().getNextOMSibling();
        node.serialize(writer);

    }

    public void testElementSerilizationSOAPBodyCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
View Full Code Here

    }

    public void testElementSerilizationSOAPBodyCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        OMNode node = env.getBody();
        node.serialize(writer);
    }

    public void testElement() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        SOAPBody body = env.getBody();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.