brett 2004/04/07 17:42:45 Modified: xdoc/src/plugin-resources site.jsl xdoc/src/plugin-test/xdocs-replacement test.xml xdoc/xdocs changes.xml Log: PR: MPXDOC-82 fix handling of a href Revision Changes Path 1.51 +21 -11 maven-plugins/xdoc/src/plugin-resources/site.jsl Index: site.jsl =================================================================== RCS file: /home/cvs/maven-plugins/xdoc/src/plugin-resources/site.jsl,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- site.jsl 29 Mar 2004 20:54:21 -0000 1.50 +++ site.jsl 8 Apr 2004 00:42:45 -0000 1.51 @@ -425,17 +425,27 @@ </jsl:template> <!-- remove the space at the end of parsed "a" anchors and fix local hrefs --> - <jsl:template match="a" trim="true"><x:element name="a"> - <x:forEach var="attr" select="@*"> - <j:choose> - <j:when test="${attr.name == 'href' and attr.value.startsWith('#')}"> - <x:attribute name="href"><doc:escapeNameToken value="${attr.value}"/></x:attribute> - </j:when> - <j:otherwise><x:attribute name="${attr.name}">${attr.value}</x:attribute></j:otherwise> - </j:choose> - </x:forEach> - <jsl:applyTemplates/> - </x:element></jsl:template> + <jsl:template match="a" trim="true"> + <j:set var="href"><x:expr select="@href" /></j:set> + <j:choose> + <j:when test="${!empty(href) and href.startsWith('#')}"> + <x:element name="a" trim="true"> + <x:forEach var="attr" select="@*"> + <j:choose> + <j:when test="${attr.name == 'href'}"> + <x:attribute name="href"><doc:escapeNameToken value="${attr.value}"/></x:attribute> + </j:when> + <j:otherwise> + <x:attribute name="${attr.name}">${attr.value}</x:attribute> + </j:otherwise> + </j:choose> + </x:forEach> + <jsl:applyTemplates/> + </x:element> + </j:when> + <j:otherwise><jsl:copy><jsl:applyTemplates/></jsl:copy></j:otherwise> + </j:choose> + </jsl:template> <!-- copy any other elements through --> <jsl:template match="*" trim="false"><jsl:copy trim="false"><jsl:applyTemplates trim="false"/></jsl:copy></jsl:template> 1.3 +7 -2 maven-plugins/xdoc/src/plugin-test/xdocs-replacement/test.xml Index: test.xml =================================================================== RCS file: /home/cvs/maven-plugins/xdoc/src/plugin-test/xdocs-replacement/test.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- test.xml 4 Mar 2004 18:39:49 -0000 1.2 +++ test.xml 8 Apr 2004 00:42:45 -0000 1.3 @@ -32,6 +32,11 @@ <body> <section name="test1"> &_module; + + <p><a href="#Section 2">blah</a></p> + </section> + <section name="Section 2"> + <p><a href="/servlet/x?param=1&q=foo">foo -> bar</a></p> </section> </body> -</document> \ No newline at end of file +</document> 1.37 +2 -0 maven-plugins/xdoc/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/maven-plugins/xdoc/xdocs/changes.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- changes.xml 29 Mar 2004 20:55:09 -0000 1.36 +++ changes.xml 8 Apr 2004 00:42:45 -0000 1.37 @@ -25,6 +25,8 @@ </properties> <body> <release version="1.7-SNAPSHOT" date="in CVS"> + <action dev="brett" type="fix">remove changes-report.xml which was generating over the top of the actual report. This information already exists in the changes plugin documentation.</action> + <action dev="brett" type="fix" issue="MPXDOC-82">fix processing of a href links</action> <action dev="brett" type="fix" issue="MPXDOC-84">fix URI problems</action> <action dev="dion" type="fix" issue="MPXDOC-89">html tags not passed through for source and pre tags</action> </release>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]