Examples of XMLWriter


Examples of org.pentaho.reporting.libraries.xmlns.writer.XmlWriter

      this.xmlWriter.close();
      return;
    }


    final XmlWriter docWriter = new XmlWriter(writer, xmlWriter.getTagDescription());
    docWriter.addImpliedNamespace(HtmlPrinter.XHTML_NAMESPACE, "");
    docWriter.setHtmlCompatiblityMode(true);

    if (styleFile != null)
    {
      // now its time to write the header with the link to the style-sheet-file
      writeCompleteHeader(docWriter, writer, contentProducer, logicalPageBox, styleFileUrl, null);
    }
    else
    {
      writeCompleteHeader(docWriter, writer, contentProducer, logicalPageBox, null, styleManager);
    }

    xmlWriter.writeCloseTag(); // for the body ..
    xmlWriter.flush();

    // no need to check for IOExceptions here, as we know the implementation does not create such things
    final MemoryStringReader stringReader = bufferWriter.createReader();
    docWriter.writeStream(stringReader);
    stringReader.close();

    docWriter.writeCloseTag(); // for the html ..
    docWriter.close();
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.xmlns.writer.XmlWriter

   *                             if the report serialisation failed.
   */
  public void write() throws IOException, ReportWriterException
  {
    final SubReport report = (SubReport) getReport();
    final XmlWriter xmlWriter = getXmlWriter();

    final AttributeList attList = new AttributeList();
    if (getReportWriter().hasParent() == false)
    {
      attList.addNamespaceDeclaration("", ExtParserModule.NAMESPACE);
    }

    final String query = report.getQuery();
    if (query != null)
    {
      attList.setAttribute(ExtParserModule.NAMESPACE, "query", query);
    }
    xmlWriter.writeTag(ExtParserModule.NAMESPACE,
        "sub-report", attList, XmlWriterSupport.OPEN);

    writeParameterDeclaration();

    // no need to write the parser config, if this subreport is inlined.
    if (getReportWriter().hasParent() == false)
    {
      final ParserConfigWriter parserConfigWriter =
          new ParserConfigWriter(getReportWriter(), xmlWriter);
      parserConfigWriter.write();
    }

    final ReportConfigWriter reportConfigWriter =
        new ReportConfigWriter(getReportWriter(), xmlWriter);
    reportConfigWriter.write();

    final StylesWriter stylesWriter =
        new StylesWriter(getReportWriter(), xmlWriter);
    stylesWriter.write();

    final ReportDescriptionWriter reportDescriptionWriter
        = new ReportDescriptionWriter(getReportWriter(), xmlWriter);
    reportDescriptionWriter.write();

    final FunctionsWriter functionsWriter =
        new FunctionsWriter(getReportWriter(), xmlWriter);
    functionsWriter.write();
    xmlWriter.writeCloseTag();
  }
View Full Code Here

Examples of org.restlet.ext.xml.XmlWriter

     * Initiates the parsing of a mixed content part of the current document.
     */
    private void initiateInlineMixedContent() {
        this.contentDepth = 0;
        StringWriter sw = new StringWriter();
        currentContentWriter = new XmlWriter(sw);

        for (String prefix : this.prefixMappings.keySet()) {
            currentContentWriter.forceNSDecl(this.prefixMappings.get(prefix),
                    prefix);
        }
View Full Code Here

Examples of org.restlet.util.XmlWriter

* @contributor nlevitt
*/
public class XmlMarshaller {
   
    protected static XmlWriter getXmlWriter(Writer writer) {
        XmlWriter xmlWriter = new XmlWriter(writer);

        // https://webarchive.jira.com/browse/HER-1603?focusedCommentId=22558#action_22558
        xmlWriter.setDataFormat(true);
        xmlWriter.setIndentStep(2);

        return xmlWriter;
    }
View Full Code Here

Examples of org.sonar.api.utils.text.XmlWriter

    List<ActiveRule> activeRules = index.get(ActiveRuleIndex.class).findByProfile(profile.getKey());
    writeXml(writer, profile, activeRules);
  }

  private void writeXml(Writer writer, QualityProfileDto profile, List<ActiveRule> activeRules) {
    XmlWriter xml = XmlWriter.of(writer).declaration();
    xml.begin("profile");
    xml.prop("name", profile.getName());
    xml.prop("language", profile.getLanguage());
    xml.begin("rules");
    for (ActiveRule activeRule : activeRules) {
      xml.begin("rule");
      xml.prop("repositoryKey", activeRule.key().ruleKey().repository());
      xml.prop("key", activeRule.key().ruleKey().rule());
      xml.prop("priority", activeRule.severity());
      xml.begin("parameters");
      for (Map.Entry<String, String> param : activeRule.params().entrySet()) {
        xml
          .begin("parameter")
          .prop("key", param.getKey())
          .prop("value", param.getValue())
          .end();
      }
      xml.end("parameters");
      xml.end("rule");
    }
    xml.end("rules").end("profile").close();
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.core.io.xml.XMLWriter

  @Test
  public void testBeansProjectDescriptionWriterWithXMLConfigsOnly() throws Exception {
    beansProject.addConfig("basic-bean-config.xml", IBeansConfig.Type.MANUAL);
   
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    XMLWriter writer = new XMLWriter(os);
    BeansProjectDescriptionWriter.write(beansProject, writer);
    writer.flush();
    writer.close();
   
    String description = os.toString();
   
    Matcher matcher = Pattern
        .compile(
View Full Code Here

Examples of org.tastefuljava.hiketools.geo.XMLWriter

    private static final DecimalFormat NUMBER_FORMAT
            = new DecimalFormat("0.########");

    public static void writeTrack(TrackPoint points[], File file)
            throws IOException {
        XMLWriter out = new XMLWriter(file);
        try {
            writeTrack(points, out);
        } finally {
            out.close();
        }
    }
View Full Code Here

Examples of prefuse.util.io.XMLWriter

        Schema ns = graph.getNodeTable().getSchema();
        Schema es = graph.getEdgeTable().getSchema();
        checkGraphMLSchema(ns);
        checkGraphMLSchema(es);
       
        XMLWriter xml = new XMLWriter(new PrintWriter(os));
        xml.begin(Tokens.GRAPHML_HEADER, 2);
       
        xml.comment("prefuse GraphML Writer | "
                + new Date(System.currentTimeMillis()));
       
        // print the graph schema
        printSchema(xml, Tokens.NODE, ns, null);
        printSchema(xml, Tokens.EDGE, es, new String[] {
            graph.getEdgeSourceField(), graph.getEdgeTargetField()
        });
        xml.println();
       
        // print graph contents
        xml.start(Tokens.GRAPH, Tokens.EDGEDEF,
            graph.isDirected() ? Tokens.DIRECTED : Tokens.UNDIRECTED);
       
        // print the nodes
        xml.comment("nodes");
        Iterator nodes = graph.nodes();
        while ( nodes.hasNext() ) {
            Node n = (Node)nodes.next();
           
            if ( ns.getColumnCount() > 0 ) {
                xml.start(Tokens.NODE, Tokens.ID, String.valueOf(n.getRow()));
                for ( int i=0; i<ns.getColumnCount(); ++i ) {
                    String field = ns.getColumnName(i);
                    xml.contentTag(Tokens.DATA, Tokens.KEY, field,
                                   n.getString(field));
                }
                xml.end();
            } else {
                xml.tag(Tokens.NODE, Tokens.ID, String.valueOf(n.getRow()));
            }
        }
       
        // add a blank line
        xml.println();
       
        // print the edges
        String[] attr = new String[]{Tokens.ID, Tokens.SOURCE, Tokens.TARGET};
        String[] vals = new String[3];
       
        xml.comment("edges");
        Iterator edges = graph.edges();
        while ( edges.hasNext() ) {
            Edge e = (Edge)edges.next();
            vals[0] = String.valueOf(e.getRow());
            vals[1] = String.valueOf(e.getSourceNode().getRow());
            vals[2] = String.valueOf(e.getTargetNode().getRow());
           
            if ( es.getColumnCount() > 2 ) {
                xml.start(Tokens.EDGE, attr, vals, 3);
                for ( int i=0; i<es.getColumnCount(); ++i ) {
                    String field = es.getColumnName(i);
                    if ( field.equals(graph.getEdgeSourceField()) ||
                         field.equals(graph.getEdgeTargetField()) )
                        continue;
                   
                    xml.contentTag(Tokens.DATA, Tokens.KEY, field,
                                   e.getString(field));
                }
                xml.end();
            } else {
                xml.tag(Tokens.EDGE, attr, vals, 3);
            }
        }
        xml.end();
       
        // finish writing file
        xml.finish("</"+Tokens.GRAPHML+">\n");
    }
View Full Code Here

Examples of tiled.io.xml.XMLWriter

        if (filename.endsWith(".tmx.gz")) {
            os = new GZIPOutputStream(os);
        }

        Writer writer = new OutputStreamWriter(os, Charset.forName("UTF-8"));
        XMLWriter xmlWriter = new XMLWriter(writer);

        xmlWriter.startDocument();
        writeMap(map, xmlWriter, filename);
        xmlWriter.endDocument();

        writer.flush();

        if (os instanceof GZIPOutputStream) {
            ((GZIPOutputStream)os).finish();
View Full Code Here

Examples of util.io.XMLWriter

      program.appendChild(createNodeWithTextValue(document, "title", prog.getTitle()));

    }

    XMLWriter writer = new XMLWriter();
    writer.writeDocumentToOutputStream(document, output, "UTF-8");
  }
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.