Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 9th, 2006, 11:23 PM
Registered User
 
Join Date: Feb 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSL error

I am trying to open a simple XSL and XMl that i have created in IE 6.0.2900
but i get the follwoing error

Switch from current encoding to specified encoding not supported. Error processing resource 'file:///C:/Documents and Setti...

<?xml version="1.0" encoding="ISO-8859-1"?>

What encoding should i use to remove the error



 
Old February 10th, 2006, 11:09 AM
Registered User
 
Join Date: Feb 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Any idea guys

 
Old February 10th, 2006, 11:32 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If you want answers it's better to give some details about the scenario and what code you are using.

If this is a server-side transform it is because you start with one character set and then switch, often because of using Response.Write in ASP or similar which is bad practice.

If client side it's often because the encoding stated at the top of the file does not match the real encoding.

Show us how you are transforming etc.

--

Joe (Microsoft MVP - XML)
 
Old February 10th, 2006, 11:50 AM
Registered User
 
Join Date: Feb 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i have created this two files
cdcatalog.xsl
<?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/">
  <html>
  <body>
    <h2>My CD Collection</h2>
    <table border="1">
    <tr bgcolor="#9acd32">
      <th align="left">Title</th>
      <th align="left">Artist</th>
    </tr>
    <xsl:for-each select="catalog/cd">
    <tr>
      <td><xsl:value-of select="title"/></td>
      <td><xsl:value-of select="artist"/></td>
    </tr>
    </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template></xsl:stylesheet>


cdcatalog.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
<catalog>
  <cd>
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <price>10.90</price>
    <year>1985</year>
  </cd>
</catalog>

and when i try to open any of this files in my Internet Explorer , i get the error mentioned in the first post..

 
Old February 10th, 2006, 12:11 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Well they work for me if saved in the ISO-8859-1 format so it maybe that they're incorrectly encoded on your machine.

Try removing the encoding "attribute" from the declarations.

You can always open in Notepad and save as UTF-8.

How were the files originally created?

--

Joe (Microsoft MVP - XML)
 
Old February 10th, 2006, 12:22 PM
Registered User
 
Join Date: Feb 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i tried to open it in my office machine it works..but when i tried to open it in my laptop it did not work...

To create this files
I opened an Webpage->View Source
Then i pasted my xml files here and then clicked on Save as and saved the file for XML..with xml extension
similar thing i did for XSL file with, xsl extension..

both the files were saved correctly on both the machines, because windows gives a typical icon for XML and XSL files..

i am not understanding why it is not opening in my Internet explorer at my laptop

any help






Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL ERROR -Regarding the global variable ashokRasainiya XSLT 4 November 28th, 2007 10:07 AM
Pass link values as xsl:parameter to php5 then xsl pauljr8 XSLT 1 July 2nd, 2007 10:32 PM
Exception Error While Running XSL.Files RICHBIRD XSLT 1 June 15th, 2006 02:58 AM
struts - xsl -> pdf - error opening file with IE ruchi XSLT 0 June 15th, 2005 07:45 AM
XSL Transform with xsl string NOT xsl file skin XSLT 0 June 16th, 2003 07:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.