Skip to main content
A Open Source Solution
Home Download Support Configuration Development ImagoX

Example 1:

This example does not use the <defaults> mechanism and so specifies every option in the XML and XSL documents.

XML


<mail
    to="foo@xenei.net, bar@xenei.net"
    from="example1@xenei.net"
    bcc="theLurker@xenei.net"
    cc="archives@xenei.net"
    reply-to="webmaster@xenei.net"
    subject="The example 1 message"
    >
    This is the body of the message.
    Any HTML markup will be transformed using the current stylesheet.
</mail>

				

XSL


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:xmail="xalan://org.xenei.imago.extensions.ImagoMail"
    extension-element-prefixes="xmail"
>
....
<xsl:template match="mail">
    <xmail:send
        to="{@mailto}"
        from="{@mailfrom}"
        subject="{@subject}">
        to="{@to}"
        from="{@from}"
        bcc="{@bcc}"
        cc="@{cc}"
        reply-to="@{reply-to}"
        subject="{@subject}"
    >
    <xsl:apply-templates/>
    </xmail:send>
</xsl:template>

				

Example 2:

This example uses the <defaults> mechanism. The defaults are shown as "special" here.

XML


<mail default="special">
    This is the body of the message.
    Any HTML markup will be transformed using the current stylesheet.
</mail>

				

XSL


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:xmail="xalan://org.xenei.imago.extensions.ImagoMail"
    extension-element-prefixes="xmail"
>
....
<xsl:template match="mail">
    <xmail:send
        default="{@default}"
        to="{@mailto}"
        from="{@mailfrom}"
        subject="{@subject}">
        to="{@to}"
        from="{@from}"
        bcc="{@bcc}"
        cc="@{cc}"
        reply-to="@{reply-to}"
        subject="{@subject}"
    >
    <xsl:apply-templates/>
    </xmail:send>
</xsl:template>

				
All trademarks and copyrights are the property of their respective owners.
Copyright © 2002-2004 by Xenei.com, All Rights Reserved
OpenSource.org
AnyBrowser.org
Xenei.org - Open Source Solutions