You need to sign in to do that
Don't have an account?
jenneking
XML case-sensitive tags changed - contentType="application/msword
I'm trying to figure out why this XML code is changed from case-sensitive to case-insensitive when using contentType to generate a Word Document.
<apex:page standardController="Opportunity" extensions="ext_document" showheader="false" standardstylesheets="false" sideBar="false" contentType="application/msword#Word.doc" cache="true"> <html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xml:space="preserve"> <head> <title>Word Document</title> <!--[if gte mso 9]> <xml> <o:DocumentProperties> <o:Author>Author</o:Author> <o:Version>v1.001</o:Version> </o:DocumentProperties> <w:WordDocument> <w:View>Print</w:View> <w:Zoom>100</w:Zoom> <w:DoNotOptimizeForBrowser/> </w:WordDocument> </xml> <![endif]--> <style type="text/css"> p.MsoHeader, li.MsoHeader, div.MsoHeader{ margin:0in; margin-top:.0001pt; mso-pagination:widow-orphan; tab-stops:center 3.0in right 6.0in; } p.MsoFooter, li.MsoFooter, div.MsoFooter{ margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; tab-stops:center 3.0in right 6.0in; } @page Section1{ size:8.5in 11.0in; margin:0.5in 0.5in 0.5in 0.5in; font-family:Times New Roman; font-size:10pt; mso-header-margin:0.5in; mso-header:h1; mso-footer:f1; mso-footer-margin:0.5in; mso-paper-source:0; } </style> </head> <apex:outputPanel > <body> Body of Document here </body> </apex:outputpanel> </html> </apex:page>
The XML is changed to the following:
<!--[if gte mso 9]> <xml> <o:documentproperties> <o:author>Author</o:author> <o:version>v1.001</o:version> </o:documentproperties> <w:worddocument> <w:view>Print</w:view> <w:zoom>100</w:zoom> <w:donotoptimizeforbrowser/> </w:worddocument> </xml> <![endif]-->
This renders the XML useless. If I save my VF Page code as HTML and open it with Word, it works. For some reason when rendered or when the HTML is created by SalesForce side servers, the case-sensitivity is changed.
Is there a way around this or some way to wrap the XML so that the case-sensitivity is not lost?
Thanks to anyone that can help resolve this issue.
Update - I have a case open with salesforce on this issue. See below, the Bold and Red font highlights the characters that are Lowercase instead of Uppercase.
This is how the VFpage is rendered.....
<!--[if gte mso 9]>
<xml>
<o:documentproperties>
<o:author>ProCore Resource Group, LLC</o:author>
<o:version>v1.001</o:version>
</o:documentproperties>
<w:worddocument>
<w:view>Print</w:view>
<w:zoom>100</w:zoom>
<w:donotoptimizeforbrowser/>
</w:worddocument>
</xml>
<![endif]-->
This is how the VFPage is coded.....
<!--[if gte mso 9]>
<xml>
<o:DocumentProperties>
<o:Author>ProCore Resource Group, LLC</o:Author>
<o:Version>v1.001</o:Version>
</o:DocumentProperties>
<w:WordDocument>
<w:View>Print</w:View>
<w:Zoom>100</w:Zoom>
<w:DoNotOptimizeForBrowser/>
</w:WordDocument>
</xml>
<![endif]-->
I'll update resolution of the case as it is received.