Package org.ccil.cowan.tagsoup

Examples of org.ccil.cowan.tagsoup.XMLWriter


      }
    }
   
    private boolean doProcess2(Record inputRecord, InputStream stream) throws IOException, SAXException {     
      ByteArrayOutputStream out = new ByteArrayOutputStream(16 * 1024);
      XMLWriter xmlWriter = new XMLWriter(new BufferedWriter(new OutputStreamWriter(out, Charsets.UTF_8)));
      xmlWriter.setOutputProperty(XMLWriter.ENCODING, "UTF-8");
      if (omitXMLDeclaration) {
        xmlWriter.setOutputProperty(XMLWriter.OMIT_XML_DECLARATION, "yes");
      }
      xmlReader.setContentHandler(xmlWriter);
      Charset detectedCharset = detectCharset(inputRecord, charset);
      InputSource source = new InputSource(new BufferedReader(new InputStreamReader(stream, detectedCharset)));
     
View Full Code Here


  public void operate( FlowProcess flowProcess, FunctionCall functionCall )
    {
    try
      {
      StringWriter writer = new StringWriter();
      XMLWriter xmlWriter = new XMLWriter( writer );

      xmlWriter.setPrefix( getSchema().getURI(), "" );
      xmlWriter.setOutputProperty( XMLWriter.OMIT_XML_DECLARATION, "yes" );

      InputSource source = new InputSource( new StringReader( (String) functionCall.getArguments().getObject( 0 ) ) );

      getParser().setContentHandler( xmlWriter );
View Full Code Here

TOP

Related Classes of org.ccil.cowan.tagsoup.XMLWriter

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.