mil.dod.th.word.htm.doclet/src/org/udri/util/XSDAppender.java
private void addXSDs(File xsdDir, String name) throws IOException {

        StringBuilder resourceStr = new StringBuilder(
                "<div style='mso-element:para-border-div;border-top:double windowtext 2.5pt;")
        .append("border-left:none;border-bottom:double windowtext 2.5pt;border-right:none;")
        .append("mso-border-top-alt:triple windowtext 2.5pt;mso-border-bottom-alt:triple windowtext 2.5pt;")
        .append("padding:1.0pt 0in 1.0pt 0in'>");

        resourceStr
        .append("<h1 style='mso-list:l5 level1 lfo1'><![if !supportLists]><span class=grame><span")
        .append("style='mso-fareast-font-family:\"Times New Roman\"'><span style='mso-list:Ignore'>2<span")
        .append("style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
        .append("</span></span></span></span><![endif]><span class=grame><span style='mso-fareast-font-family:")
        .append("\"Times New Roman\"'>").append(name).append("<o:p></o:p></span></span></h1>")
        .append("</div>");

        _apiFile.println(resourceStr.toString());

        // Get all XSD files
        File[] xsds = xsdDir.listFiles(new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                if (pathname.getName().endsWith("xsd")) {
                    return true;
                }

                return false;
            }
        });

        for (File xsd : xsds) {

            // Write header
            StringBuilder xsdStr = new StringBuilder(
                    "<div style='mso-element:para-border-div;border-top:double windowtext 1.5pt;;")
            .append("border-left:none;border-bottom:double windowtext 1.5pt;border-right:none;")
            .append("padding:1.0pt 0in 1.0pt 0in'>");

            // Add intra-document link point
            xsdStr.append("<h2 style='mso-list:l5 level2 lfo1'><![if !supportLists]><span class=grame><span")
            .append("style='mso-fareast-font-family:\"Times New Roman\"'><span style='mso-list:Ignore'><span")
            .append("style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
            .append("</span></span></span></span><![endif]><span class=grame><span style='mso-fareast-font-family:")
            .append("\"Times New Roman\"'>").append(xsd.getName()).append("<o:p></o:p></span></span></h2>")
            .append("</div>");

            _apiFile.println(xsdStr.toString());

            // Write XSD file, using same font as for <code> comments.
            _apiFile.println("<p class=MsoNormal style='margin-left:50.0pt;'>");
            BufferedReader br = new BufferedReader(new FileReader(xsd));
            String line;
            while ((line = br.readLine()) != null) {
                _apiFile.print("<pre><span style='mso-bookmark:_Ref286137727'><span class=grame><span style='font-family:Courier'>");
                _apiFile.print(line.replaceAll("<", "&lt;").replaceAll(">",
                        "&gt;").replaceAll("\n", ""));
                _apiFile.println("</span></span></pre>");
            }
            br.close();
            _apiFile.println("</p>");

            _apiFile.flush();
        }
    }
/**
     * Write out XSD file to RandomAccessFile
     * 
     * @param name
     *            the header name
     */
Write out XSD file to RandomAccessFile

@param name
the header name
Write out XSD file to RandomAccessFile @param name the header name
private void addXSDs(File xsdDir, String name) throws IOException {
        StringBuilder resourceStr = new StringBuilder(
                "<div style='mso-element:para-border-div;border-top:double windowtext 2.5pt;")
        .append("border-left:none;border-bottom:double windowtext 2.5pt;border-right:none;")
        .append("mso-border-top-alt:triple windowtext 2.5pt;mso-border-bottom-alt:triple windowtext 2.5pt;")
        .append("padding:1.0pt 0in 1.0pt 0in'>");
        resourceStr
        .append("<h1 style='mso-list:l5 level1 lfo1'><![if !supportLists]><span class=grame><span")
        .append("style='mso-fareast-font-family:\"Times New Roman\"'><span style='mso-list:Ignore'>2<span")
        .append("style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
        .append("</span></span></span></span><![endif]><span class=grame><span style='mso-fareast-font-family:")
        .append("\"Times New Roman\"'>").append(name).append("<o:p></o:p></span></span></h1>")
        .append("</div>");
        _apiFile.println(resourceStr.toString());
        File[] xsds = xsdDir.listFiles(new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                if (pathname.getName().endsWith("xsd")) {
                    return true;
                }
                return false;
            }
        });
        for (File xsd : xsds) {
            StringBuilder xsdStr = new StringBuilder(
                    "<div style='mso-element:para-border-div;border-top:double windowtext 1.5pt;;")
            .append("border-left:none;border-bottom:double windowtext 1.5pt;border-right:none;")
            .append("padding:1.0pt 0in 1.0pt 0in'>");
            xsdStr.append("<h2 style='mso-list:l5 level2 lfo1'><![if !supportLists]><span class=grame><span")
            .append("style='mso-fareast-font-family:\"Times New Roman\"'><span style='mso-list:Ignore'><span")
            .append("style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
            .append("</span></span></span></span><![endif]><span class=grame><span style='mso-fareast-font-family:")
            .append("\"Times New Roman\"'>").append(xsd.getName()).append("<o:p></o:p></span></span></h2>")
            .append("</div>");
            _apiFile.println(xsdStr.toString());
            _apiFile.println("<p class=MsoNormal style='margin-left:50.0pt;'>");
            BufferedReader br = new BufferedReader(new FileReader(xsd));
            String line;
            while ((line = br.readLine()) != null) {
                _apiFile.print("<pre><span style='mso-bookmark:_Ref286137727'><span class=grame><span style='font-family:Courier'>");
                _apiFile.print(line.replaceAll("<", "&lt;").replaceAll(">",
                        "&gt;").replaceAll("\n", ""));
                _apiFile.println("</span></span></pre>");
            }
            br.close();
            _apiFile.println("</p>");
            _apiFile.flush();
        }
    }
private void addXSDs ( File xsdDir , String name ) throws IOException { StringBuilder resourceStr = new StringBuilder ( "<div style='mso-element:para-border-div;border-top:double windowtext 2.5pt;" ) . append ( "border-left:none;border-bottom:double windowtext 2.5pt;border-right:none;" ) . append ( "mso-border-top-alt:triple windowtext 2.5pt;mso-border-bottom-alt:triple windowtext 2.5pt;" ) . append ( "padding:1.0pt 0in 1.0pt 0in'>" ) ; resourceStr . append ( "<h1 style='mso-list:l5 level1 lfo1'><![if !supportLists]><span class=grame><span" ) . append ( "style='mso-fareast-font-family:\"Times New Roman\"'><span style='mso-list:Ignore'>2<span" ) . append ( "style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" ) . append ( "</span></span></span></span><![endif]><span class=grame><span style='mso-fareast-font-family:" ) . append ( "\"Times New Roman\"'>" ) . append ( name ) . append ( "<o:p></o:p></span></span></h1>" ) . append ( "</div>" ) ; _apiFile . println ( resourceStr . toString ( ) ) ; File [ ] xsds = xsdDir . listFiles ( new FileFilter ( ) { @ Override public boolean accept ( File pathname ) { if ( pathname . getName ( ) . endsWith ( "xsd" ) ) { return true ; } return false ; } } ) ; for ( File xsd : xsds ) { StringBuilder xsdStr = new StringBuilder ( "<div style='mso-element:para-border-div;border-top:double windowtext 1.5pt;;" ) . append ( "border-left:none;border-bottom:double windowtext 1.5pt;border-right:none;" ) . append ( "padding:1.0pt 0in 1.0pt 0in'>" ) ; xsdStr . append ( "<h2 style='mso-list:l5 level2 lfo1'><![if !supportLists]><span class=grame><span" ) . append ( "style='mso-fareast-font-family:\"Times New Roman\"'><span style='mso-list:Ignore'><span" ) . append ( "style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" ) . append ( "</span></span></span></span><![endif]><span class=grame><span style='mso-fareast-font-family:" ) . append ( "\"Times New Roman\"'>" ) . append ( xsd . getName ( ) ) . append ( "<o:p></o:p></span></span></h2>" ) . append ( "</div>" ) ; _apiFile . println ( xsdStr . toString ( ) ) ; _apiFile . println ( "<p class=MsoNormal style='margin-left:50.0pt;'>" ) ; BufferedReader br = new BufferedReader ( new FileReader ( xsd ) ) ; String line ; while ( ( line = br . readLine ( ) ) != null ) { _apiFile . print ( "<pre><span style='mso-bookmark:_Ref286137727'><span class=grame><span style='font-family:Courier'>" ) ; _apiFile . print ( line . replaceAll ( "<" , "&lt;" ) . replaceAll ( ">" , "&gt;" ) . replaceAll ( "\n" , "" ) ) ; _apiFile . println ( "</span></span></pre>" ) ; } br . close ( ) ; _apiFile . println ( "</p>" ) ; _apiFile . flush ( ) ; } }
Write out XSD file to RandomAccessFile
Write out XSD file to RandomAccessFile
// Get all XSD files // Write header // Add intra-document link point // Write XSD file, using same font as for <code> comments.