xsl-list
[Top] [All Lists]

Re: how to embed this complicated set of characters into the result file via an XSL

2004-01-23 23:03:13
The "wired" content is inside comments, so you can just use <xsl:comment>
around it and either escape the content or put it in a CDATA section.

<xsl:comment>[if gte mso 9]&gt;
&lt;xml&gt;
 &lt;o:DocumentProperties&gt;
  &lt;o:Author&gt;word&lt;/o:Author&gt;
  &lt;o:LastAuthor&gt;word&lt;/o:LastAuthor&gt;
  &lt;o:Revision&gt;0&lt;/o:Revision&gt;
  &lt;o:Created&gt;2000-01-01T02:59:00Z&lt;/o:Created&gt;
  &lt;o:LastSaved&gt;2000-01-01T02:59:00Z&lt;/o:LastSaved&gt;
  &lt;o:Company&gt;HP&lt;/o:Company&gt;
 &lt;/o:DocumentProperties&gt;
&lt;/xml&gt;
&lt;![endif]</xsl:comment>

<xsl:comment><![CDATA[[if gte mso 9]>
<xml>
 <w:WordDocument>
  <w:TrackRevisions/>
 </w:WordDocument>
</xml>
<![endif]]]></xsl:comment>


result is:

     <!--[if gte mso 9]>
<xml>
 <o:DocumentProperties>
  <o:Author>word</o:Author>
  <o:LastAuthor>word</o:LastAuthor>
  <o:Revision>0</o:Revision>
  <o:Created>2000-01-01T02:59:00Z</o:Created>
  <o:LastSaved>2000-01-01T02:59:00Z</o:LastSaved>
  <o:Company>HP</o:Company>
 </o:DocumentProperties>
</xml>
<![endif]-->
      <!--[if gte mso 9]>
<xml>
 <w:WordDocument>
  <w:TrackRevisions/>
 </w:WordDocument>
</xml>
<![endif]-->

Best Regards,
 George
-------------------------------------------------------
George Cristian Bina mailto:george(_at_)oxygenxml(_dot_)com
<oXygen/> XML Editor - http://www.oxygenxml.com/


----- Original Message -----
From: "SANWAL, ABHISHEK (HP-Houston)" <abhishek(_dot_)sanwal(_at_)hp(_dot_)com>
To: <XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Saturday, January 24, 2004 7:13 AM
Subject: [xsl] how to embed this complicated set of characters into the
result file via an XSL


I am attempting to embed the following TEXT into the HEAD of my resultant
HTML document that I am renaming to .DOC so that when word opens it TRACKING
is enabled. (I found that this markup allows you to create HTML-DOC files
that automatically enable and allow tracking).

This text must be put in the MAINHEAD.XSL file that I use for generating
the HEAD of my resultant HTML document.

The problem is that it has such a weird set of characters that my
attempted methods (tried and failed, as explained below) are not working.


<html xmlns="http://www.w3.org/TR/REC-html40";
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word">

<head>

 ************ TEXT NEEDED INSIDE THE HEAD: *************************

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta name="ProgId" content="Word.Document"/>
<meta name="Generator" content="Microsoft Word 10"/>
<meta name="Originator" content="Microsoft Word 10"/>
<title>Untitled Document</title>

<!--[if gte mso 9]>
<xml>
 <o:DocumentProperties>
  <o:Author>word</o:Author>
  <o:LastAuthor>word</o:LastAuthor>
  <o:Revision>0</o:Revision>
  <o:Created>2000-01-01T02:59:00Z</o:Created>
  <o:LastSaved>2000-01-01T02:59:00Z</o:LastSaved>
  <o:Company>HP</o:Company>
 </o:DocumentProperties>
</xml>
<![endif]-->

<!--[if gte mso 9]>
<xml>
 <w:WordDocument>
  <w:TrackRevisions/>
 </w:WordDocument>
</xml>
<![endif]-->
-->

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

</HEAD>

METHODS I HAVE TRIED AND FAILED:

METHOD 1:

Using a CDATA section:

<![CDATA[

<!--[if gte mso 9]>
<xml>
 <o:DocumentProperties>
  <o:Author>Luau Document Builder - Rendering Engine -
asanwal(_at_)mw2consulting(_dot_)com</o:Author>
  <o:LastAuthor>Luau Document Builder</o:LastAuthor>
  <o:Revision>0</o:Revision>
  <o:Created>2000-01-01T02:59:00Z</o:Created>
  <o:LastSaved>2000-01-01T02:59:00Z</o:LastSaved>
  <o:Company>MW2 Conulting</o:Company>
 </o:DocumentProperties>
</xml>
<![endif]-->

<!--[if gte mso 9]>
<xml>
 <w:WordDocument>
  <w:TrackRevisions/>
 </w:WordDocument>
</xml>
<![endif]-->

]]>


METHOD 2:

Using an external file where the given text is put with and without CDATA
sections.

<!DOCTYPE xsl:stylesheet [
<!ENTITY mswordmarkup SYSTEM "mswordmarkup.dat">
]>

I can never get the required output. The text does not get included or it
gets loaded with &lt; & &gt; stuff.

BTW - These are the XSL settings I have for the output etc.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:fo="http://www.w3.org/1999/XSL/Format";>
<xsl:output method="html" encoding="UTF-8" indent="yes"/>


Please suggest a way to get this done so that I can have in included into
my resulting HTML when I execute the XSLs.

(If you might be suggesting a break up of the given TEXT to allow
inclusion please SHOW me how I should break it up to have it included AS IT
IS NEEDED in the HTML)

Thanks,
_____________________________________________________

Abhishek Sanwal
HP - Houston Campus




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>