Package org.apache.xml.serialize

Examples of org.apache.xml.serialize.XMLSerializer.serialize()


            } else if (node instanceof Element) {
                format.setOmitXMLDeclaration(true);
                serial.serialize((Element) node);
            } else if (node instanceof DocumentFragment) {
                format.setOmitXMLDeclaration(true);
                serial.serialize((DocumentFragment) node);
            } else if (node instanceof Text) {
                Text text = (Text) node;
                return text.getData();
            } else if (node instanceof Attr) {
                Attr attr = (Attr) node;
View Full Code Here


    {
        OutputFormat format  = new OutputFormat(doc, null, true);
        StringWriter writer = new StringWriter(1000);
        XMLSerializer serial = new XMLSerializer(writer, format);
        serial.asDOMSerializer();
        serial.serialize(doc);
        String docString = writer.toString();

        validate(docString, schemaLocationPropertyValue, resolver);
    }
View Full Code Here

    try
    {
      XMLSerializer serializer = new XMLSerializer( new PrintWriter( out ), outputFormat );
      serializer.asDOMSerializer();
      serializer.serialize( xmlDocumentResult );
    }
    catch( IOException e )
    {
      SoapUI.logError( e );
    }
View Full Code Here

        XMLSerializer oSerialize = new XMLSerializer(oWriter, oFormat);

        try
        {
          oElt.getOwnerDocument().normalizeDocument();
            oSerialize.serialize(oElt);
        }
        catch (java.io.IOException ioe)
        {
            throw new RuntimeException(
                "Problem serializing the XML document:\n" + ioe.getMessage());
View Full Code Here

                XMLSerializer ser = new XMLSerializer(str, out);
               
                // normalizeDocument adds "xmlns" attributes, among other normalization
                doc.normalizeDocument(); // XXX: should we clone the document?
                ser.serialize(doc.getDocumentElement())
            }
            catch( Exception e )
            {
                return null;
            }
View Full Code Here

        XMLSerializer oSerialize = new XMLSerializer(oWriter, oFormat);

        try
        {
          oElt.getOwnerDocument().normalizeDocument();
            oSerialize.serialize(oElt);
        }
        catch (java.io.IOException ioe)
        {
            throw new RuntimeException(
                "Problem serializing the XML document:\n" + ioe.getMessage());
View Full Code Here

                XMLSerializer ser = new XMLSerializer(str, out);
               
                // normalizeDocument adds "xmlns" attributes, among other normalization
                doc.normalizeDocument(); // XXX: should we clone the document?
                ser.serialize(doc.getDocumentElement())
            }
            catch( Exception e )
            {
                return null;
            }
View Full Code Here

            format.setIndent(2);
           
            // Write to workspace.xml
            FileOutputStream os = new FileOutputStream(new File(workspaceFile));
            XMLSerializer serializer = new XMLSerializer(os, format);
            serializer.serialize(document);
            os.close();
        } catch (Exception e) {
            throw new ServiceRuntimeException(e);
        }
    }
View Full Code Here

            format.setLineWidth(65);
            format.setIndenting(true);
            format.setIndent(2);
            Writer out = new StringWriter();
            XMLSerializer serializer = new XMLSerializer(out, format);
            serializer.serialize(document);
            return out.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

           
            // Write to domain.composite
            File file = new File(rootDirectory + "/" + compositeFile);
            FileOutputStream os = new FileOutputStream(file);
            XMLSerializer serializer = new XMLSerializer(os, format);
            serializer.serialize(document);

            // Cache composite collection
            cache.compositeCollection = compositeCollection;
            cache.compositeCollectionLastModified = file.lastModified();
           
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.