RE: [xsl] Malformed META tag

Subject: RE: [xsl] Malformed META tag
From: "Snow, Corey" <CSNOW@xxxxxxxxx>
Date: Wed, 6 Feb 2002 10:21:42 -0800
I believe that if you use transformNodeToObject(), the object receiving the
transformed data expects it to be a well-formed XML document. Since an HTML
document is generally not well-formed, the receiving object doesn't like it
much. The <xsl:output method="html" encoding="utf-8"/> element could be
changed to <xsl:output method="xml" encoding="utf-8"> and it would probably
work, but the results would no longer be HTML, but rather XHTML (or close to
it.).

If your goal is simply to produce an HTML document, you could use the
transformNode() method, or you could use an IXSLProcessor object to do your
transformations (assuming you're using MSXML 4). Neither of these mechansims
allow you to transform a node to an object, however.

Regards,

Corey Snow

> -----Original Message-----
> From: Gautam Sabba [mailto:gautams@xxxxxxxxxxxxxx]
> Sent: Wednesday, February 06, 2002 3:33 AM
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Malformed META tag
> 
> 
> Hi All,
>             I'm a greenhorn at XSLT so please be gentle :). 
> I'm working
> with MSXML 4 and VC++. I'm just trying to do a very simple x-formation
> (the customary Hello World!). The result of this x-formation i need as
> an object so i use the transformNodeToObject() method. Here it fails
> stating that the resulting DOM object is not in proper shape...the
> culprit being the <META> tag that get added to the x-formation result
> 
> <META http-equiv="Content-Type" content="text/html; charset=UTF-16">
> 
> ...it has no tag closure. This occurs only if I have a <HEAD> tag
> defined as part of my xsl file.
> 
> Is there some work-around for this ? Or am I going about this in the
> right way ?
> 
> thanks in advance,
> 
> gautam
> 
> The XSL file :
> 
> <?xml version="1.0"?>
> <xsl:stylesheet
>       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
>  <xsl:output method="html" encoding="utf-8"/>
>  <xsl:template match="/hello-world">
>  <HTML>
>   <HEAD>
>    <TITLE> This is the title </TITLE>
>   </HEAD>
>   <BODY>
>    <H1><xsl:value-of select="greeting"/></H1>
>    <xsl:apply-templates select="greeter"/>
>   </BODY>
>  </HTML>
>  </xsl:template>
>  <xsl:template match="greeter">
>     <DIV>from
>      <I><xsl:value-of select="."/></I>
>     </DIV>
>  </xsl:template>
> </xsl:stylesheet>
> 
> The XML file:
> 
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="hello.xsl"?>
> <hello-world>
>    <greeter>An XSLT Programmer</greeter>
>    <greeting>Hello, World!</greeting>
> </hello-world>
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

#########################################################
The information contained in this e-mail and subsequent attachments may be privileged, 
confidential and protected from disclosure.  This transmission is intended for the sole 
use of the individual and entity to whom it is addressed.  If you are not the intended 
recipient, any dissemination, distribution or copying is strictly prohibited.  If you 
think that you have received this message in error, please e-mail the sender at the above 
e-mail address.
#########################################################

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


Current Thread