Examples of XMLWriter


Examples of com.sun.xml.bind.marshaller.XMLWriter

            return;
        }
        if (result instanceof StreamResult) {
            StreamResult sr = (StreamResult) result;
            XMLWriter w = null;

            if (sr.getWriter() != null)
                w = createWriter(sr.getWriter());
            else if (sr.getOutputStream() != null)
                w = createWriter(sr.getOutputStream());
View Full Code Here

Examples of com.sun.xml.internal.bind.marshaller.XMLWriter

        assert toBeFlushed==null;
        toBeFlushed = w;

        CharacterEscapeHandler ceh = createEscapeHandler(encoding);
        XMLWriter xw;

        if(isFormattedOutput()) {
            DataWriter d = new DataWriter(w,encoding,ceh);
            d.setIndentStep(indent);
            xw=d;
        } else
            xw = new XMLWriter(w,encoding,ceh);

        xw.setXmlDecl(!isFragment());
        xw.setHeader(header);
        return new SAXOutput(xw);   // TODO: don't we need a better writer?
    }
View Full Code Here

Examples of com.topologi.diffx.xml.XMLWriter

      throw new NullPointerException("Parameter projectTeam must not be null");
    if (this.handler == null)
      throw new IllegalStateException("ContentHandler not set");
    // start handling the document
    this.handler.startDocument();
    XMLWriter xw = new XMLWriterSAX(this.handler);
    xml.toXML(xw);
    this.handler.endDocument();
  }
View Full Code Here

Examples of com.volantis.mcs.papi.XMLWriter

        String vname, XFTextInputAttributes inputAttributes )
        throws JspTagException, IOException
    {
        HttpSession session = pageContext.getSession();
        HiddenFieldsSessionMap sessionMap = (HiddenFieldsSessionMap)session.getAttribute("_HIDDENATGFIELDS");
        XMLWriter writer = new XMLWriter(pageContext.getOut());
        try {
           
            // Type attribute is optional. If not present, it defaults to text
            if (inputAttributes.getType()==null)
            {
                inputAttributes.setType("text");
            }
           
            // Submit button... we need an XFAction instead of an XFInput
            if( ( inputAttributes.getType().equals( "submit" ) ) || ( inputAttributes.getType().equals( "reset" ) ) )
            {                               
                XFActionAttributes actionAttributes = new XFActionAttributes();               
                actionAttributes.setType( inputAttributes.getType() );
                actionAttributes.setStyleClass( inputAttributes.getStyleClass() );
                actionAttributes.setShortcut( inputAttributes.getShortcut() );
                actionAttributes.setCaption( inputAttributes.getCaption() );
                actionAttributes.setName( "i_" + vname );
                actionAttributes.setHelp( inputAttributes.getHelp() );
                actionAttributes.setPrompt( inputAttributes.getPrompt() );
                actionAttributes.setActive( "true" );
                actionAttributes.setCaptionPane( inputAttributes.getCaptionPane() );
                actionAttributes.setEntryPane( inputAttributes.getEntryPane() );

                writer.openElement(actionAttributes);
                writer.closeElement(actionAttributes);

                if (logger.isDebugEnabled()) {
                    logger.debug ( "Submit input. For group "+ getFormName(pageContext)+" setting attribute _V" + vname + " to " + inputAttributes.getName() );
                }
                sessionMap.setAttribute(getFormName(pageContext), "_V"+vname, inputAttributes.getName());
               
                // Deal with IE and image submit buttons.
                // IE sends i_button.x=anInt&i_button.y=anInt
                // Mozilla: i_button.x=anInt&i_button.y=anInt&i_button=valueOfCaptionAttribute
                // So we store a hashtable containing the name and the value of the caption               
                sessionMap.setButton(getFormName(pageContext), "i_"+vname, inputAttributes.getCaption());
               
            } else {
                if( inputAttributes.getType().equals( "hidden" ) == false )
                {
                    if (logger.isDebugEnabled()) {
                        logger.debug ( "Visible input. For group "+getFormName(pageContext)+ " setting attribute _V" + vname + " to " + inputAttributes.getName() );
                    }
                    sessionMap.setAttribute(getFormName(pageContext), "_V"+vname, inputAttributes.getName());
                   
                    inputAttributes.setName( "i_" + vname );

                    writer.openElement(inputAttributes);
                    writer.closeElement(inputAttributes);

                } else {
                    if( ( vname != null ) && (vname.length() > 0 ) )
                    {
                        if( inputAttributes.getName().startsWith( "_D" ) )
                        {
                            // _DARGS is a special case
                            if( inputAttributes.getName().equals( "_DARGS" ) )
                            {
                                if (logger.isDebugEnabled()) {
                                    logger.debug ( "Hidden input. For group "+getFormName(pageContext)+" setting attribute " + vname + " to " + inputAttributes.getInitial() );
                                }
                                sessionMap.setAttribute(getFormName(pageContext), "_DARGS", inputAttributes.getInitial());
                            } else {
                                if (logger.isDebugEnabled()) {
                                    logger.debug ( "Hidden input. For group "+getFormName(pageContext)+" setting attribute _D" + vname + " to " + inputAttributes.getName() );
                                }
                                sessionMap.setAttribute(getFormName(pageContext), "_D"+vname, inputAttributes.getName());
                            }
                        } else {                           
                            XFImplicitAttributes ia = new XFImplicitAttributes();
                            ia.setName( "i_" + vname );
                            ia.setValue( inputAttributes.getInitial() );

                            writer.openElement(ia);
                            writer.closeElement(ia);

                            if (logger.isDebugEnabled()) {
                                logger.debug ( "Hidden input. For group "+getFormName(pageContext)+" setting attribute _V" + vname + " to " + inputAttributes.getName() );
                            }
                            sessionMap.setAttribute(getFormName(pageContext), "_V"+vname, inputAttributes.getName());
                        }
                    } else {
                        if (logger.isDebugEnabled()) {
                            logger.debug ("hidden-input-undefined");
                        }
                        XFImplicitAttributes ia = new XFImplicitAttributes();
                        ia.setName( inputAttributes.getName() );
                        ia.setValue( inputAttributes.getInitial() );

                        writer.openElement(ia);
                        writer.closeElement(ia);
                                               
                    }
                }
            }
        }
View Full Code Here

Examples of de.pdark.decentxml.XMLWriter

        Document document = target.document;
        try {
            String enc = document.getEncoding() != null ? document.getEncoding() : "UTF-8";
            Writer w = new OutputStreamWriter(os, enc);
            XMLWriter xw = new XMLWriter(w);
            try {
                document.toXML(xw);
            } finally {
                xw.flush();
            }
        } finally {
            IOUtil.close(os);
        }
    }
View Full Code Here

Examples of de.willuhn.datasource.serialize.XmlWriter

        Writer writer = null;
        try
        {
          Logger.info("creating xml backup to " + file.getAbsolutePath());

          writer = new XmlWriter(new BufferedOutputStream(new FileOutputStream(file)));

          monitor.setStatusText(i18n.tr("Speichere Turnus-Informationen"));
          backup(TurnusImpl.class,writer,monitor);
          monitor.addPercentComplete(5);
View Full Code Here

Examples of diva.util.xml.XmlWriter

            public void init() throws Exception {
                url = new URL("file:/java/diva/util/test/xml1.xml"); //FIXME
                document = new XmlDocument(url);
                reader = new XmlReader();
                writer = new XmlWriter();
            }

            public void run() throws Exception {
                reader.parse(document);
View Full Code Here

Examples of fi.luomus.commons.xml.XMLWriter

  }

  private void writeXMLToOut(Document doc) throws Exception {
    res.setContentType("application/xml; charset=utf-8");
    PrintWriter out = res.getWriter();
    out.write(new XMLWriter(doc).generateXML(XMLWriter.NO_EMPTY_ELEMENTS));
    out.flush();
  }
View Full Code Here

Examples of fitnesse.util.XmlWriter

    assertEquals(sampleXml, results);
  }

  private String writeXml(Document doc) throws Exception {
    XmlWriter writer = new XmlWriter(output);
    writer.write(doc);
    writer.flush();
    writer.close();

    String results = new String(output.toByteArray());
    return results;
  }
View Full Code Here

Examples of info.aduna.xml.XMLWriter

    throws IOException
  {
    assert txn != null : "operation list must not be null";
    assert out != null : "output stream must not be null";

    XMLWriter xmlWriter = new XMLWriter(out);
    xmlWriter.setPrettyPrint(true);

    xmlWriter.startDocument();
    xmlWriter.startTag(TransactionXMLConstants.TRANSACTION_TAG);

    for (TransactionOperation op : txn) {
      serialize(op, xmlWriter);
    }

    xmlWriter.endTag(TransactionXMLConstants.TRANSACTION_TAG);
    xmlWriter.endDocument();
  }
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.