hasComment = false; writer.startElement( parser.getName() ); for ( int i = 0; i < parser.getAttributeCount(); i++ )
/** {@inheritDoc} */ protected void writeStartTag( Tag t, MutableAttributeSet att, boolean isSimpleTag ) { if ( this.tableCaptionXMLWriterStack.isEmpty() ) { super.writeStartTag ( t, att, isSimpleTag ); } else { String tag = ( getNameSpace() != null ? getNameSpace() + ":" : "" ) + t.toString(); this.tableCaptionXMLWriterStack.getLast().startElement( tag ); if ( att != null ) { Enumeration<?> names = att.getAttributeNames(); while ( names.hasMoreElements() ) { Object key = names.nextElement(); Object value = att.getAttribute( key ); this.tableCaptionXMLWriterStack.getLast().addAttribute( key.toString(), value.toString() ); } } if ( isSimpleTag ) { this.tableCaptionXMLWriterStack.getLast().endElement(); } } }
writer.startElement( "dependency" ); writer.startElement( "groupId" ); writer.writeText( artifact.getGroupId() ); writer.endElement(); writer.startElement( "artifactId" ); writer.writeText( artifact.getArtifactId() ); writer.endElement(); writer.startElement( "version" ); writer.writeText( artifact.getBaseVersion() ); if ( !StringUtils.isBlank( artifact.getClassifier() ) ) writer.startElement( "classifier" ); writer.writeText( artifact.getClassifier() ); writer.endElement(); writer.startElement( "scope" ); writer.writeText( artifact.getScope() ); writer.endElement();
writer.startElement( "itext" ); writer.addAttribute( "creationdate", DateFormat.getDateTimeInstance().format( new Date() ) ); writer.addAttribute( "producer", "Doxia iText" );
/** * Start a title. * * @param writer the writer. * @param leading leading. * @param font the font. * @param size the size. * @param fontstyle the fontstyle. * @param red red. * @param green green. * @param blue blue. */ private void startTitle( PrettyPrintXMLWriter writer, String leading, String font, String size, String fontstyle, String red, String green, String blue ) { writer.startElement( "title" ); writer.addAttribute( "leading", leading ); writer.addAttribute( "font", font ); writer.addAttribute( "size", size ); writer.addAttribute( "fontstyle", fontstyle ); writer.addAttribute( "red", red ); writer.addAttribute( "green", green ); writer.addAttribute( "blue", blue ); }
String red, String green, String blue ) writer.startElement( "chunk" ); writer.addAttribute( "font", font ); writer.addAttribute( "size", size );
PrettyPrintXMLWriter buildXmlPrinter = new PrettyPrintXMLWriter( buildXmlWriter ); buildXmlPrinter.startElement( "project" ); buildXmlPrinter.addAttribute( "default", "copy-resources" ); buildXmlPrinter.startElement( "target" ); buildXmlPrinter.addAttribute( NAME, "init" ); buildXmlPrinter.startElement( "target" ); buildXmlPrinter.addAttribute( NAME, "copy-resources" ); buildXmlPrinter.addAttribute( "depends", "init" ); buildXmlPrinter.startElement("copy"); buildXmlPrinter.addAttribute("todir", dir.getOutput()); buildXmlPrinter.addAttribute("filtering", "" + dir.isFiltering()); buildXmlPrinter.startElement("fileset"); buildXmlPrinter.addAttribute("dir", dir.getPath()); if (dir.getIncludeAsString() != null) {
/** * Write a chapter. * * @param writer the writer. * @param chapter the Chapter. * @param context the BookContext. * @throws BookDoxiaException if the chapter cannot be written. */ private void renderChapter( Sink sink, PrettyPrintXMLWriter writer, Chapter chapter, BookContext context ) throws BookDoxiaException { writer.startElement( "chapter" ); writer.addAttribute( "numberdepth", "1" ); writer.addAttribute( "depth", "1" ); writer.addAttribute( "indent", "1" ); startTitle( writer, "36.0", "Helvetica", "24.0", "normal", "255", "0", "0" ); chunk( writer, chapter.getTitle(), "Helvetica", "24.0", "normal", "255", "0", "0" ); writer.endElement(); // title // writer.startElement( "sectioncontent" ); for ( Section section : chapter.getSections() ) { renderSection( sink, writer, section, context ); } // writer.endElement(); // sectioncontent writer.endElement(); // chapter }