public String writeReport( final WriteableDocumentBundle bundle, final BundleWriterState state ) throws IOException, BundleWriterException { if ( bundle == null ) { throw new NullPointerException(); } if ( state == null ) { throw new NullPointerException(); } final OutputStream outputStream = new BufferedOutputStream( bundle.createEntry( "settings.xml", "text/xml" ) ); final DefaultTagDescription tagDescription = BundleWriterHandlerRegistry.getInstance().createWriterTagDescription(); final XmlWriter writer = new XmlWriter( new OutputStreamWriter( outputStream, "UTF-8" ), tagDescription, " ", "\n" ); writer.writeXmlDeclaration( "UTF-8" ); final AttributeList rootAttributes = new AttributeList(); rootAttributes.addNamespaceDeclaration( "", BundleNamespaces.SETTINGS ); writer.writeTag( BundleNamespaces.SETTINGS, "settings", rootAttributes, XmlWriterSupport.OPEN ); writeConfiguration( state, writer ); writeRuntimeInformation( state, writer ); writer.writeCloseTag(); writer.close(); return "settings.xml"; }
public void open() throws IOException { final DefaultTagDescription td = new DefaultTagDescription(); td.setNamespaceHasCData( XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, false ); td.setElementHasCData( XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "text", true ); // prepare anything that might needed to be prepared .. final String encoding = metaData.getConfiguration().getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.pageable.xml.Encoding", EncodingRegistry.getPlatformDefaultEncoding() ); final Writer writer = new BufferedWriter( new OutputStreamWriter( outputStream, encoding ) ); this.xmlWriter = new XmlWriter( writer, td ); this.xmlWriter.writeXmlDeclaration( encoding ); final AttributeList attrs = new AttributeList(); attrs.addNamespaceDeclaration( "", XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE ); xmlWriter.writeTag( XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "layout-output", attrs, XmlWriter.OPEN ); }
public void open() throws IOException { final DefaultTagDescription td = new DefaultTagDescription(); td.setNamespaceHasCData( XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, false ); td.setElementHasCData( XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "text", true ); // prepare anything that might needed to be prepared .. final String encoding = metaData.getConfiguration().getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.table.xml.Encoding", EncodingRegistry.getPlatformDefaultEncoding() ); final Writer writer = new BufferedWriter( new OutputStreamWriter( outputStream, encoding ) ); this.xmlWriter = new XmlWriter( writer, td ); this.xmlWriter.writeXmlDeclaration( null ); final AttributeList attrs = new AttributeList(); attrs.addNamespaceDeclaration( "", XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE ); xmlWriter.writeTag( XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "layout-output", attrs, XmlWriter.OPEN ); }
/** * Writes a report to a character stream writer. * * @param w * the character stream writer. * @throws IOException * if there is an I/O problem. * @throws ReportWriterException * if there is a problem writing the report. */ public void write( final Writer w ) throws IOException, ReportWriterException { final XmlWriter xmlWriter = new XmlWriter( w, createTagDescription() ); xmlWriter.writeXmlDeclaration( getEncoding() ); final ReportDefinitionWriter writer = new ReportDefinitionWriter( this, xmlWriter ); writer.write(); }
xmlWriter.writeXmlDeclaration( "UTF-8" );
final XmlWriter writer = new XmlWriter( new OutputStreamWriter( outputStream, "UTF-8" ), tagDescription, " ", "\n" ); writer.writeXmlDeclaration( "UTF-8" );
final XmlWriter writer = new XmlWriter( new OutputStreamWriter( outputStream, "UTF-8" ), tagDescription, " ", "\n" ); writer.writeXmlDeclaration( "UTF-8" );
public void write( final IDatabaseConnection[] connections, final OutputStream out ) throws IOException { DefaultTagDescription tagDescription = new DefaultTagDescription(); tagDescription.setDefaultNamespace( ConnectionModule.NAMESPACE ); tagDescription.setNamespaceHasCData( ConnectionModule.NAMESPACE, false ); tagDescription.setElementHasCData( ConnectionModule.NAMESPACE, "attribute", true ); final XmlWriter writer = new XmlWriter( new OutputStreamWriter( out, "UTF-8" ), tagDescription ); writer.writeXmlDeclaration( "UTF-8" ); final AttributeList rootList = new AttributeList(); rootList.addNamespaceDeclaration( null, ConnectionModule.NAMESPACE ); writer.writeTag( ConnectionModule.NAMESPACE, "connections", rootList, XmlWriter.OPEN ); for ( int i = 0; i < connections.length; i++ ) { final IDatabaseConnection connection = connections[i]; write( connection, writer ); } writer.writeCloseTag(); writer.flush(); }
xmlWriter.writeXmlDeclaration( "UTF-8" );
writer.writeXmlDeclaration( "UTF-8" );
writer.writeXmlDeclaration( "UTF-8" );
dwriter.writeXmlDeclaration( encoding ); dwriter.writeTag( ConfigEditorBoot.NAMESPACE, "config-description", attList, XmlWriterSupport.OPEN ); //$NON-NLS-1$
public void write( final OutputStream outputStream, final ElementStyleDefinition styleDefinition ) throws IOException { final DefaultTagDescription tagDescription = BundleWriterHandlerRegistry.getInstance().createWriterTagDescription(); final XmlWriter writer = new XmlWriter( new OutputStreamWriter( new NoCloseOutputStream( outputStream ), "UTF-8" ), tagDescription, " ", "\n" ); writer.writeXmlDeclaration( "UTF-8" ); final AttributeList rootAttributes = new AttributeList(); rootAttributes.addNamespaceDeclaration( "", BundleNamespaces.STYLE ); rootAttributes.addNamespaceDeclaration( "layout", BundleNamespaces.LAYOUT ); rootAttributes.addNamespaceDeclaration( "core", AttributeNames.Core.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "html", AttributeNames.Html.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "swing", AttributeNames.Swing.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "pdf", AttributeNames.Pdf.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "designtime", AttributeNames.Designtime.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "crosstab", AttributeNames.Crosstab.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "pentaho", AttributeNames.Pentaho.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "table", AttributeNames.Table.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "page", ExtParserModule.NAMESPACE ); writer.writeTag( BundleNamespaces.STYLE, "style-definition", rootAttributes, XmlWriter.OPEN ); StyleFileWriter.writeStyleDefinition( writer, styleDefinition ); writer.writeCloseTag(); writer.flush(); writer.close(); } }
final XmlWriter writer = new XmlWriter( new OutputStreamWriter( outputStream, "UTF-8" ), tagDescription, " ", "\n" ); writer.writeXmlDeclaration( "UTF-8" );
writer.writeXmlDeclaration( encoding );
final XmlWriter writer = new XmlWriter( new OutputStreamWriter( outputStream, "UTF-8" ), tagDescription, " ", "\n" ); writer.writeXmlDeclaration( "UTF-8" );
configuration.getConfigProperty( HtmlTableModule.ENCODING, EncodingRegistry.getPlatformDefaultEncoding() ); docWriter.writeXmlDeclaration( encoding ); for ( int i = 0; i < XHTML_HEADER.length; i++ ) { docWriter.writeText( XHTML_HEADER[i] );
new XmlWriter( new OutputStreamWriter( new FileOutputStream( "/Users/user/fonts.xml" ), "UTF-8" ), defaultTagDescription ); writer.writeXmlDeclaration( "UTF-8" ); writer.writeTag( null, "font-spec", "fallback-font", "Arial", false );