xml result after style sheet still showed as xml

xml result after style sheet still showed as xml

Post by Marc-andre Poupie » Sat, 09 Nov 2002 04:25:27



Hi NG

I have an xml template that query a sql 2000 server and the result is parsed
through an xsl file but still show as an XML result in IE.
It query the northwind databse if I remove the reference to sql:xsl it will
work properly displaying the xml result, when the xsl ref is there then is
show the good html result but my IE still think it's xml.

Im using IE6.0sp1 on windows xp sp1 and i have msde 2000 sp2.

xml template follow
----------------------------------------------8<----------------------------
--
<?xml version="1.0"?>
<catalog xmlns:sql="urn:schemas-microsoft-com:xml-sql"
sql:xsl="catalog.xsl">
  <sql:query>
    SELECT productid, productname, unitprice
    FROM products product
    FOR XML AUTO
  </sql:query>
</catalog>
----------------------------------------------8<----------------------------
--

xsl file follow
----------------------------------------------8<----------------------------
--
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  <xsl:template match="/">
<HTML>
  <TITLE>
    Catalog
  </TITLE>
  <BODY>
    <TABLE border='0'>
      <TR>
        <TD><B>Product ID</B></TD>
        <TD><B>Product Name</B></TD>
        <TD><B>Price</B></TD>
      </TR>
    <xsl:for-each select="catalog/product">
      <TR>



      </TR>
    </xsl:for-each>
    </TABLE>
  </BODY>
</HTML>
  </xsl:template>

</xsl:stylesheet>
----------------------------------------------8<----------------------------
--

Idea are welcome!

--
Marc-andre Poupier,MCSE,MCT,CCNA
Expert-Conseil / Consultant
www.maximiz.com

 
 
 

xml result after style sheet still showed as xml

Post by Simon Taylo » Sat, 09 Nov 2002 05:48:49


If I understand your problem correctly, you need to add the xsl:output
element to your xsl stylesheet right beneat the xsl:stylesheet tag.  E.g.:

 <xsl:output method="html"/>

This will allow the browser to interpret the stylesheet output as html.

HTH,

Simon Taylor
Resource Data, Inc.


> Hi NG

> I have an xml template that query a sql 2000 server and the result is
parsed
> through an xsl file but still show as an XML result in IE.
> It query the northwind databse if I remove the reference to sql:xsl it
will
> work properly displaying the xml result, when the xsl ref is there then is
> show the good html result but my IE still think it's xml.

> Im using IE6.0sp1 on windows xp sp1 and i have msde 2000 sp2.

> xml template follow
> ----------------------------------------------8<--------------------------
--
> --
> <?xml version="1.0"?>
> <catalog xmlns:sql="urn:schemas-microsoft-com:xml-sql"
> sql:xsl="catalog.xsl">
>   <sql:query>
>     SELECT productid, productname, unitprice
>     FROM products product
>     FOR XML AUTO
>   </sql:query>
> </catalog>
> ----------------------------------------------8<--------------------------
--
> --

> xsl file follow
> ----------------------------------------------8<--------------------------
--
> --
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
>   <xsl:template match="/">
> <HTML>
>   <TITLE>
>     Catalog
>   </TITLE>
>   <BODY>
>     <TABLE border='0'>
>       <TR>
>         <TD><B>Product ID</B></TD>
>         <TD><B>Product Name</B></TD>
>         <TD><B>Price</B></TD>
>       </TR>
>     <xsl:for-each select="catalog/product">
>       <TR>



>       </TR>
>     </xsl:for-each>
>     </TABLE>
>   </BODY>
> </HTML>
>   </xsl:template>

> </xsl:stylesheet>
> ----------------------------------------------8<--------------------------
--
> --

> Idea are welcome!

> --
> Marc-andre Poupier,MCSE,MCT,CCNA
> Expert-Conseil / Consultant
> www.maximiz.com



 
 
 

xml result after style sheet still showed as xml

Post by Marc-andre Poupie » Sat, 09 Nov 2002 06:21:26


Hi Simon

Thank you for your answer unfortunately it lead me into another error.

the Error follows see the output :
---------------------------------------8<-------------------------------
<xsl:stylesheet xmlns:xsl="http://localhost">
<xsl:output method="html" />
<xsl:template match="/">
<HTML>
<TITLE>
    Catalog
  </TITLE>
<BODY>
<TABLE border="0">
<TR>
<TD><B>Product ID</B></TD>
<TD><B>Product Name</B></TD>
<TD><B>Price</B></TD>
</TR>
<xsl:for-each select="catalog/product">
<TR>



</TR>
</xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>

---------------------------------------8<-------------------------------
it didn't ran the style sheet actualy

this is the begining of my stylesheet changed as you suggested.
---------------------------------------8<-------------------------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://localhost">
<xsl:output method="html"/>
  <xsl:template match="/">
---------------------------------------8<-------------------------------

Thank you again.

--
Marc-andre Poupier,MCSE,MCT,CCNA
Expert-Conseil / Consultant
www.maximiz.com


> If I understand your problem correctly, you need to add the xsl:output
> element to your xsl stylesheet right beneat the xsl:stylesheet tag.  E.g.:

>  <xsl:output method="html"/>

> This will allow the browser to interpret the stylesheet output as html.

> HTH,

> Simon Taylor
> Resource Data, Inc.



> > Hi NG

> > I have an xml template that query a sql 2000 server and the result is
> parsed
> > through an xsl file but still show as an XML result in IE.
> > It query the northwind databse if I remove the reference to sql:xsl it
> will
> > work properly displaying the xml result, when the xsl ref is there then
is
> > show the good html result but my IE still think it's xml.

> > Im using IE6.0sp1 on windows xp sp1 and i have msde 2000 sp2.

> > xml template follow

> ----------------------------------------------8<--------------------------
> --
> > --
> > <?xml version="1.0"?>
> > <catalog xmlns:sql="urn:schemas-microsoft-com:xml-sql"
> > sql:xsl="catalog.xsl">
> >   <sql:query>
> >     SELECT productid, productname, unitprice
> >     FROM products product
> >     FOR XML AUTO
> >   </sql:query>
> > </catalog>

> ----------------------------------------------8<--------------------------
> --
> > --

> > xsl file follow

> ----------------------------------------------8<--------------------------
> --
> > --
> > <?xml version="1.0"?>
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
> >   <xsl:template match="/">
> > <HTML>
> >   <TITLE>
> >     Catalog
> >   </TITLE>
> >   <BODY>
> >     <TABLE border='0'>
> >       <TR>
> >         <TD><B>Product ID</B></TD>
> >         <TD><B>Product Name</B></TD>
> >         <TD><B>Price</B></TD>
> >       </TR>
> >     <xsl:for-each select="catalog/product">
> >       <TR>



> >       </TR>
> >     </xsl:for-each>
> >     </TABLE>
> >   </BODY>
> > </HTML>
> >   </xsl:template>

> > </xsl:stylesheet>

> ----------------------------------------------8<--------------------------
> --
> > --

> > Idea are welcome!

> > --
> > Marc-andre Poupier,MCSE,MCT,CCNA
> > Expert-Conseil / Consultant
> > www.maximiz.com


 
 
 

xml result after style sheet still showed as xml

Post by Bryant Like » Sat, 09 Nov 2002 08:54:25



Quote:> Hi NG

> I have an xml template that query a sql 2000 server and the result is
parsed
> through an xsl file but still show as an XML result in IE.
> It query the northwind databse if I remove the reference to sql:xsl it
will
> work properly displaying the xml result, when the xsl ref is there then is
> show the good html result but my IE still think it's xml.

See this FAQ on the subject:
"Why does IE think my contentType is text/xml?"
http://www.sqlxml.org/faqs.aspx?faq=18

--
Bryant