• jenneking
  • NEWBIE
  • 30 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

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.

 

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.

 

Interesting behavior with SOQL query.

Here is the setup.

Some_Field__c is a Text length 20.

Some_Field__c is not null

This is proven by running

SELECT Some_Field__c FROM Account  WHERE Id ='0013000000Ik1srAAB'  and Some_Field__c !=null

and it returns the row.

And

SELECT Some_Field__c FROM Account  WHERE Id ='0013000000Ik1srAAB'  and Some_Field__c = null

does not return a row.

The row is an empty string but

SELECT Some_Field__c FROM Account  WHERE Id ='0013000000Ik1srAAB'  and Some_Field__c = ''

doesnt return anything.

Also,

SELECT Some_Field__c FROM Account  WHERE Id ='0013000000Ik1srAAB'  and Some_Field__c = '%'

doesn't return anything.


This is happening on a summer 08 sandbox org.

How do I filter on the empty string?