[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to read the encoding of an XML document

Subject: Re: How to read the encoding of an XML document
From: James Garriss <jpgarriss@xxxxxxxx>
Date: Thu, 25 Oct 2001 09:44:12 -0400
read processing instruction encoding attribute
At 05:41 PM 10/24/2001 -0400, Wendell Piez wrote:

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

What XSL do I use to read the value of the encoding attribute?

You can't. It's not an attribute. (And it's not in a processing instruction. It's in the XML declaration, which is formally not part of the document, but only helps the parser know what to expect.)

Well, that would explain my failure to extract the data. :-)


Why do you want to know the encoding? Someone might have another approach to the problem.

I am getting XML documents from multiple European countries. I am expecting that some or all of them will use different encoding sets, depending upon their language. I would like to use XSL to transform the documents, both to XML and HTML.


In XML, I was planning to have the same encoding set that was found in the original document.

In HTML, I was planning to use the same encoding set in the META tag, so the browser knows how to display it.

< HEAD >
< META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" >
< /HEAD >

--James Garriss


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.