Book a Demo

Author Topic: html report  (Read 5139 times)

marcelloh

  • EA User
  • **
  • Posts: 192
  • Karma: +0/-0
    • View Profile
html report
« on: February 03, 2009, 10:17:21 pm »
When reporting to HTML, there are visible tags because of the < and  > . Is there an option which doesn't convert this, but leave the tag just as a valid html-tag? (or perhaps the other way around?)

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: html report
« Reply #1 on: February 04, 2009, 04:48:29 am »
Hi,

I guess you're referring to HTML tags used in element notes. At least for certain tags this works for me.
E.g. a hyperlink tag written as
Code: [Select]
<a href="some_url">Link Description</a>in an element's note is rendered properly as hyperlink in the generated HTML report.
Seems that not all HTML tags are handled that way (see also http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1233583427).
Which tags you're trying to use in particular?

Günther

marcelloh

  • EA User
  • **
  • Posts: 192
  • Karma: +0/-0
    • View Profile
Re: html report
« Reply #2 on: February 04, 2009, 06:49:58 am »
About everything I can do within a note or a scenario
I opened all generated HTML, replaced every &lt; with the correct value, did the same with &gt; and volia. It looked good.
But the generator should do this by itself, not by me.

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: html report
« Reply #3 on: February 04, 2009, 08:30:57 pm »
As long the generator doesn't provide an option to handle this and as far I have noticed XHTML compatible output is generated, a small XSLT transformation could be used, instead of replacing all the &lt; &gt; (and maybe further entities) by hand.
I was stumbling over the same problem when generating my own HTML reports directly from exported XMI.
Here's a snippet to replace the entities:
Code: [Select]
     <xsl:template name="preserveTags">
            <xsl:param name="text" />
            <xsl:variable name="tmp1">
                  <xsl:value-of select="replace($text,'&amp;amp;lt;','&lt;')" />
            </xsl:variable>
            <xsl:variable name="tmp2">
                  <xsl:value-of select="replace($tmp1,'&amp;lt;','&lt;')" />
            </xsl:variable>
            <xsl:variable name="tmp3">
                  <xsl:value-of select="replace($tmp2,'&amp;amp;gt;','&gt;')" />
            </xsl:variable>
            <xsl:variable name="tmp4">
                  <xsl:value-of select="replace($tmp3,'&amp;gt;','&gt;')" />
            </xsl:variable>
            <xsl:variable name="tmp5">
                  <xsl:value-of select="replace($tmp4,'&amp;quot;','&quot;')" />
            </xsl:variable>
            <xsl:value-of disable-output-escaping="yes" select="$tmp5" />
      </xsl:template>
Take care which XSLT-processor you're using, this is XSLT2.0. At least with Saxon9.1 it works fine.

In general I agree, the EA HTML generator should provide such option.
Allowing to post process the output with a stylesheet like the XMI Export would also be a good idea (BTW: That XMI-Export option didn't work with my XSLT, so I'm starting the postprocessing manually).

HTH
Günther

marcelloh

  • EA User
  • **
  • Posts: 192
  • Karma: +0/-0
    • View Profile
Re: html report
« Reply #4 on: February 04, 2009, 11:25:13 pm »
Okay, a solution outside EA is not where I was looking for.
I think programming should be out of the question.
(And text replacing as well....)

The generated HTML is quite bad actually, and needs a little more fixing by Sparks-people. Perhaps it would even be better to generate xml-files, with a xsl-transformation, so people can fix the presentation themselves.

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: html report
« Reply #5 on: February 05, 2009, 01:35:46 am »
The latter option is already present, as I have mentioned. The XML you can use as base for this, can be produced with the XMI Export.
The hard part is writing the appropriate XSL of course. Or did you mean, that EA should provide a standard transformation, that can be customized as needed?

Best regards,
Günther

marcelloh

  • EA User
  • **
  • Posts: 192
  • Karma: +0/-0
    • View Profile
Re: html report
« Reply #6 on: February 05, 2009, 02:28:44 am »
EA should provide this.
And then it would be easy to generate a report based on actual information in a form that we like.
(We could even exchange some of our XSL's to get various look& feels of reports, via the forum or so.)