Skip to Content
author's profile photo Former Member
Former Member

Mail Adapter :: eMail Reporting

Hi

I am creating one scenario using following weblog :

/people/community.user/blog/2006/09/08/email-report-as-attachment-excelword

But in my mail I am getting the Headings but not the values which I am providing through my XML file.

I even deleted all the fomatting elements but still the same thing.

My XSLT file is like this now ...

***********************************************

?xml version='1.0'?>

http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">

http://sap.com/xi/XI/Mail/30">

<Subject>Deliveries from XI</Subject>

<From><i>MY EMAIL ID</i></From>

<To><i>My EMAIL ID</i></To>

<Content_Type>text/html</Content_Type>

<Content>

<xsl:text xsl:space="preserve">Catalog of CDs available:</xsl:text>

<xsl:text xsl:space="preserve">Title</xsl:text>

<xsl:text xsl:space="preserve">Artist</xsl:text>

<xsl:text xsl:space="preserve">Country</xsl:text>

<xsl:text xsl:space="preserve">Company</xsl:text>

<xsl:text xsl:space="preserve">Price</xsl:text>

<xsl:text xsl:space="preserve">Year</xsl:text>

<xsl:for-each select="Catalog_MT/cd">

<xsl:value-of select="title"/>

<xsl:value-of select="artist"/>

<xsl:value-of select="country"/>

<xsl:value-of select="company"/>

<xsl:value-of select="price"/>

<xsl:value-of select="year"/>

</xsl:for-each>

</Content>

</ns1:Mail>

</xsl:template>

</xsl:stylesheet>

*************************************************

My XML file is this

<?xml version="1.0" encoding="ISO-8859-1" ?>

- <ns0:Catalog_MT xmlns:ns0="urn:Reporting">

- <cd>

<title>Empire Burlesque</title>

<artist>Bob Dylan</artist>

<country>USA</country>

<company>Columbia</company>

<price>10.90</price>

<year>1985</year>

</cd>

- <cd>

<title>Hide your heart</title>

<artist>Bonnie Tyler</artist>

<country>UK</country>

<company>CBS Records</company>

<price>9.90</price>

<year>1988</year>

</cd>

</ns0:Catalog_MT>

***************************************

I am getting the output like this in my Mail Body -->

<i><b>Catalog of CDs available:TitleArtistCountryCompanyPriceYear</b></i>

I am not so good in XSLT. Can you pls. suggest what am I missing.

Regards

- Lalit -

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Oct 18, 2006 at 07:55 AM

    Hi,

    You did not consider namespace in your XSLT

    try this

    http://www.w3.org/1999/XSL/Transform" xmlns:ns2="urn:Reporting">

    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

    <xsl:template match="/">

    http://sap.com/xi/XI/Mail/30">

    <Subject>Deliveries from XI</Subject>

    <From>MY EMAIL ID</From>

    <To>My EMAIL ID</To>

    <Content_Type>text/html</Content_Type>

    <Content>

    <xsl:text xsl:space="preserve">Catalog of CDs available:</xsl:text>

    <xsl:text xsl:space="preserve">Title</xsl:text>

    <xsl:text xsl:space="preserve">Artist</xsl:text>

    <xsl:text xsl:space="preserve">Country</xsl:text>

    <xsl:text xsl:space="preserve">Company</xsl:text>

    <xsl:text xsl:space="preserve">Price</xsl:text>

    <xsl:text xsl:space="preserve">Year</xsl:text>

    <xsl:for-each select<b>="ns2:Catalog_MT/cd"</b>>

    <xsl:value-of select="title"/>

    <xsl:value-of select="artist"/>

    <xsl:value-of select="country"/>

    <xsl:value-of select="company"/>

    <xsl:value-of select="price"/>

    <xsl:value-of select="year"/>

    </xsl:for-each>

    </Content>

    </ns1:Mail>

    </xsl:template>

    </xsl:stylesheet>

    Regards,

    Prakash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 18, 2006 at 08:07 AM

    Hi,

    Your XSLT should be:

    <?xml version='1.0'?>

    http://www.w3.org/1999/XSL/Transform">

    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

    <xsl:template match="/">

    http://sap.com/xi/XI/Mail/30">

    <b><ns0:Catalog_MT xmlns:ns0="urn:Reporting"></b>

    <Subject>Deliveries from XI</Subject>

    <From>MY EMAIL ID</From>

    <To>My EMAIL ID</To>

    <Content_Type>text/html</Content_Type>

    <Content>

    <xsl:text xsl:space="preserve">Catalog of CDs available:</xsl:text>

    <xsl:text xsl:space="preserve">Title</xsl:text>

    <xsl:text xsl:space="preserve">Artist</xsl:text>

    <xsl:text xsl:space="preserve">Country</xsl:text>

    <xsl:text xsl:space="preserve">Company</xsl:text>

    <xsl:text xsl:space="preserve">Price</xsl:text>

    <xsl:text xsl:space="preserve">Year</xsl:text>

    <b><xsl:for-each select="ns0:Catalog_MT/cd"></b>

    <xsl:value-of select="title"/>

    <xsl:value-of select="artist"/>

    <xsl:value-of select="country"/>

    <xsl:value-of select="company"/>

    <xsl:value-of select="price"/>

    <xsl:value-of select="year"/>

    </xsl:for-each>

    </Content>

    <b></ns0:Catalog_MT></b>

    </ns1:Mail>

    </xsl:template>

    </xsl:stylesheet>

    Regards

    Suraj

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Prakash Arunachalam

      Thanks Bhaveh & Prakash

      That worked for me & now I am able to use Dynamic IDs.

      Prakash you are an expert in XSL as the program which u suggest me above, i need to learn XSL first in order to understand that.

      - Lalit -

      { Problem resolved }

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.