Maven 1.x XDoc Plugin
  1. Maven 1.x XDoc Plugin
  2. MPXDOC-118

[PATCH] Allow xdoc templates to escape XML

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Labels:
      None
    • Number of attachments :
      3

      Description

      It would be very useful if site.jsl offered a tag we could use to escape XML text. This is particularly useful when you need to include the contents of another XML file into your xdoc, as described below:

      1.The way it is now, the code included inside the <source> tags won't be escaped and hence won't be rendered (as the browser will ignore the unknown XML tags)
      <source>
      &xmlBeingIncluded;
      </source>

      2.With the patch I'm including, we would use:
      <source>
      <escapeXml>
      &xmlBeingIncluded;
      </escapeXml>
      </source>

      Besides the patch, I'm providing a simple test case ilustrating the issue.

      in the test case provided with the patch.

      1. mpxdoc-118.patch
        2 kB
        Felipe Leme
      1. Screenshot-MPXDOC-118.png
        129 kB

        Activity

        Hide
        Felipe Leme added a comment -

        Proposed patch.

        Show
        Felipe Leme added a comment - Proposed patch.
        Hide
        Felipe Leme added a comment -

        Test case - just run 'maven xdoc' on it and see the results...

        Show
        Felipe Leme added a comment - Test case - just run 'maven xdoc' on it and see the results...
        Hide
        Felipe Leme added a comment -

        Screenshot of the test case

        Show
        Felipe Leme added a comment - Screenshot of the test case
        Hide
        dion gillard added a comment -

        What's wrong with <![CDATA[ stuff ]]> ?

        Show
        dion gillard added a comment - What's wrong with <![CDATA[ stuff ]]> ?
        Hide
        Felipe Leme added a comment -

        It doesn't work with included XML (at least I couldn't get it to , as shown in the test case. It work with code like this:

        <[CDATA[
        <bla-bla-bla>
        </bla-bla-bla>
        ]]>

        In fact, that's what we were using in the document that originated this patch. But that contenct came from a dinamic XML, so we rather included that file than copy and paste its content again everytime it changes.

        But if you try:
        <[CDATA[
        &myIncludedXml;
        ]]>

        the result would be only:

        &myIncludedXml;

        Show
        Felipe Leme added a comment - It doesn't work with included XML (at least I couldn't get it to , as shown in the test case. It work with code like this: <[CDATA[ <bla-bla-bla> </bla-bla-bla> ]]> In fact, that's what we were using in the document that originated this patch. But that contenct came from a dinamic XML, so we rather included that file than copy and paste its content again everytime it changes. But if you try: <[CDATA[ &myIncludedXml; ]]> the result would be only: &myIncludedXml;
        Hide
        Felipe Leme added a comment -

        Could I commit this change? Any objection?

        Show
        Felipe Leme added a comment - Could I commit this change? Any objection?
        Hide
        Arnaud Heritier added a comment -

        ok for me, but it must be documented.

        Show
        Arnaud Heritier added a comment - ok for me, but it must be documented.
        Hide
        Felipe Leme added a comment -

        Fixed (and documented

        Show
        Felipe Leme added a comment - Fixed (and documented

          People

          • Assignee:
            Felipe Leme
            Reporter:
            Felipe Leme
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 10 minutes
              10m
              Remaining:
              Remaining Estimate - 10 minutes
              10m
              Logged:
              Time Spent - Not Specified
              Not Specified