Re: [xep-support] Generating Log Entries From Within XEP

From: David Priest <priest@sfu.ca>
Date: Fri May 20 2005 - 08:39:03 PDT

The longer answer is "yes."

Use <xsl:message> to send output to the standard error path. Capture the
path and parse it for the information you seek (you may find it helpful to
preface your log items with text such as "--->LOG::" so that they are very
easy to identify.)

Here, for instance, is a means of logging unknown XML tags. Place this at
the very end of an XSL template file, and it'll capture everything that
"fell through" all the possible matches. It spits out a message to
standard error out, identifying the unknown tag, its parent path, and its
value.

<xsl:template match="*">
        <xsl:message>
                <xsl:value-of select="name(.)" />
                <xsl:text> encountered</xsl:text>
                <xsl:if test="parent::*">
                        <xsl:text> in </xsl:text>
                        <xsl:value-of select="name(parent::*)" />
                </xsl:if>
                <xsl:text>, but no template matches.</xsl:text>
        </xsl:message>
        <!-- highlight in red in the output -->
        <fo:block >
                <xsl:text>&lt;</xsl:text>
                <xsl:value-of select="name(.)" />
                <xsl:text>&gt;</xsl:text>
                <xsl:apply-templates />
                <xsl:text>&lt;/</xsl:text>
                <xsl:value-of select="name(.)" />
                <xsl:text>&gt;</xsl:text>
        </fo:block>
</xsl:template>

On Fri, 20 May 2005 05:30:56 -0700, Alexander Peshkov
<peshkov@renderx.com> wrote:

> Hello Brian,
>
> BJB> Is it possible to generate log entries by placing tags in the XSL-FO
> BJB> file?
>
> The short answer is "no".
>
> BJB> I want to log item identifiers and page numbers to be used by
> BJB> external programs. I know I can achieve something similar by using
> page
> BJB> citations and creating a separate flow at the end of my document.
> BJB> However, I would prefer to keep the item/page list external to the
> document.
>
> Hm, I cannot quite grasp what are you trying to do. Could you please
> describe your goal and requirements in more details? I have a vague
> feeling that processing of XEP intermediate format is what you are
> looking for.
>
> Best regards,
> Alexander Peshkov mailto:peshkov@renderx.com
> RenderX
>
>
> -------------------
> (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
> in the body of the message to majordomo@renderx.com from the address
> you are subscribed from.
> (*) By using the Service, you expressly agree to these Terms of Service
> http://www.renderx.com/tos.html
>

-- 
David Priest -- 250 542-5208
WritersBlock Technical Communications
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
Received on Fri May 20 08:58:31 2005

This archive was generated by hypermail 2.1.8 : Fri May 20 2005 - 08:58:32 PDT