DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=36890>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=36890 ------- Additional Comments From [EMAIL PROTECTED] 2005-10-06 15:52 ------- Yes, I understood that part. You iterate over the fileset(s) with Ant-Contrib's <for>, generating a small XML file that only lists the files to process (one per element). You feed this file into an XSL that process this file, applying a template rule to each file element to document() load it, and copy its elements. Here's an example: <echo file="${javadocs}/index.xml" ><?xml version="1.0" ?> <javadocs last-modified="${CVS_DATE}" root="${docsroot}"> </echo> <ac:for param="name" list="${docdirs}"> <ac:sequential> ... <echo file="${javadocs}/index.xml" append="true"><![CDATA[ <module name="@{name}" tag="[EMAIL PROTECTED]" errors="[EMAIL PROTECTED]" warnings="[EMAIL PROTECTED]" versions="[EMAIL PROTECTED]" packages="[EMAIL PROTECTED]" /> ]]></echo> </ac:sequential> </ac:for> <echo file="${javadocs}/index.xml" append="true"> </javadocs> </echo> <!-- Inject the errors/warnings stats into index.xml --> <style in="${javadocs}/index.xml" out="${javadocs}/index2.xml" style="config/javadocs-addchecks.xsl" /> <!-- The index.html listing all Modules and the Javadocs links --> <style in="${javadocs}/index2.xml" out="${javadocs}/index.html" style="config/javadocs-index.xsl"> <param name="cycletitle" expression="${cycletitle}" /> </style> ... And here's an example XSL to inject something into the document. You simply need a variation that copies the content of the xmlroot variable into the result document instead of copying the input element with additional nodes. --DD <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="UTF-8" indent="yes" /> <!-- ================================================= --> <xsl:template match="node() | @*"> <xsl:copy> <xsl:apply-templates select="@* | node()" /> </xsl:copy> </xsl:template> <!-- ================================================= --> <xsl:template match="module"> <xsl:param name="javadocs" select="'../build/javadocs'" /> <xsl:variable name="docsdir" select="concat($javadocs, '/', @name)" /> <xsl:variable name="xmlfile" select="concat($docsdir, '/checkstyle.xml')" /> <xsl:variable name="xmlroot" select="document($xmlfile)/checkstyle" /> <xsl:copy> <!-- copy attributes --> <xsl:copy-of select="@*" /> <!-- insert checktyle element --> <xsl:choose> <xsl:when test="$xmlroot"> <xsl:variable name="errorcount" select="count($xmlroot/file/error)" /> <xsl:variable name="totalfiles" select="count($xmlroot/file)" /> <checkstyle errorcount="{$errorcount}" errorfiles="{count($xmlroot/file[error])}" totalfiles="{$totalfiles}" errperfile="{$errorcount div $totalfiles}" fullreport="{$xmlfile}" /> </xsl:when> <xsl:otherwise> <checkstyle report="{$xmlfile}" /> </xsl:otherwise> </xsl:choose> <!-- copy nested elements --> <xsl:apply-templates select="node()" /> </xsl:copy> </xsl:template> </xsl:stylesheet> -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]