xsl-list
[Top] [All Lists]

Re: [xsl] Managing debug logging in complex transforms: what do people do?

2014-03-24 15:54:52
On 24 March 2014 20:46, Eliot Kimber <ekimber(_at_)contrext(_dot_)com> wrote:
I'll have to think about the details of <xsl:message> more before I can
answer the XSLT 3 requirements question.

But something I'd really like is a way to get the current mode name so I
can put it in the message, without having to pass it as a second debugging
tunnel parameter.

E.g.:

<xsl:template mode="#all" match="*">
  <xsl:message> + [DEBUG] {$modeName}: Unhandled element <xsl:value-of
select="concat(name(..), '/', name(.))"/></xsl:message>
</xsl:template>

Where here "{$modeName}" is a placeholder for some way to reflect the
current mode.

I can't think of a "proper" way... I'm not sure there is one.  You
could just do:

<xsl:apply-templates select="$find-mode" mode="#current"/>

where $find-mode is an element such as

<mine:find-mode/>

and then have a template for each mode in your xslt:

<xsl:template match="mine:find-mode" mode="aaa">aaa</xsl:template>

<xsl:template match="mine:find-mode" mode="bbb">bbb</xsl:template>

etc

Not great, but it would do the job.

-- 
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--