Oracle Analytics Publisher

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

XML Comments in XSL sub-templates?

Incorrect Answer
12
Views
2
Comments

Strange things happen when I add XML comments to the XSL sub-templates embedded in my RTF report template.

This code works as expected.

<!-- Strip Suffixes -->
<xsl:template name="StripSuffixes">
    <xsl:param name="raw"/>
    ...
</xsl:template>

<!-- StripPrefixes -->
<xsl:template name="StripPrefixes">
    <xsl:param name="raw"/>
    ...
</xsl:template>

<!-- SUMMARY -->
<xsl:variable xdofo:ctx="incontext" name="SUMMARY">
    ...
</xsl:variable>

<!-- TOTALS -->
<xsl:variable xdofo:ctx="incontext" name="TOTALS">
    ...
</xsl:variable>

Doesn't seem to matter how many words are in the first XML comment. However, it fails if I add words to the second XML comment (e.g.StripPrefixes becomes Strip Prefixes.

...
<!-- Strip Prefixes -->
<xsl:template name="StripPrefixes">
...

But works fine if I add words to the last XML comment, instead (e.g. TOTALS becomes All Totals).

...
<!-- All Totals -->
<xsl:variable xdofo:ctx="incontext" name="TOTALS">
...

Meaningful snippet from the ERROR:

...
oracle.xdo.XDOException: oracle.xdo11g.xpath.XPathException: Variable not defined: 'raw'.
...

I'm thinking this has to do with where each block winds up in the output XSL-FO, but I have no idea how to control that. Documentation on context commands (xdofo:ctx) is unfortunately limited. I tried moving all the <xsl:template> blocks below the <xsl:variable> blocks, but didn't help. Neither did specifying the "begin" context for the <xsl:template> blocks.

Ultimately, I just want to add comments to help document and explain what the code is doing, etc. for the benefit of others who may need to understand it in the future.

What am I missing? What's the trick? Alternatives? Help?

Answers

Welcome!

It looks like you're new here. Sign in or register to get started.