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

RE: Apache Xalan 2.2 for Java problems with Unicode

Subject: RE: Apache Xalan 2.2 for Java problems with Unicode
From: "Williams, Brad" <Bawilliams@xxxxxxxxxxx>
Date: Thu, 9 Aug 2001 08:43:50 -0700
xalan 2.2
I have two questions that I hope I can get answered:

1) Are there C libraries for Xalan, or is the only version a Java version?

2) This is an XML related issue rather than an XSLT issue: Can Xerces, or
most parsers on the market parse XML files that do NOT have .xml extensions?
I am having problems with my comm software delivering more than one file
with the same extension in the same batch. For example, I have a customer
that wants two XML files in one batch. Can I send one as a .xml file and one
as a .txt (or any arbitrary ext) and still have most software parse the
files as XML files?

Any help would be greatly appreciated.

Thanks,

Brad

-----Original Message-----
From: Jamie King [mailto:j.king@xxxxxxxxxxx]
Sent: Thursday, August 09, 2001 3:05 AM
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Apache Xalan 2.2 for Java problems with Unicode


I'm trying to transform an XML file (encoded in UTF-8) using Apache's Xalan
2.2 package for Java.  It gives me the following exception:

javax.xml.transform.TransformerException: An invalid XML character (Unicode:
0xfc) was found in the element content of the document.

Has anyone experienced this?  Unicode 0xFC is a lowercase 'u' with an umlaut
(ü).  It works fine when I remove those characters.  Is there a way to set
the encoding for the Transformer object in Java or something like that?

Here is the relevant Java code where intermediateFile is the XML file and
returnFile is a blank File object to which the HTML is written:

      System.out.println("Beginning XSL transformation of page
#"+pageID+".");
      TransformerFactory tFactory = TransformerFactory.newInstance();
	    Transformer transformer = tFactory.newTransformer(new
StreamSource("D:\\tempDirectory\\story.xsl"));
      StreamSource streamSource = new StreamSource(intermediateFile);
      StreamResult streamResult = new StreamResult(new
FileOutputStream(returnFile));
    	transformer.transform(streamSource, streamResult);
      streamResult.getOutputStream().close();
      System.out.println("XSL transformation of page #"+pageID+"
completed.");

Thanks in advance,

Jamie


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



 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.