BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
XALAN
org.apache.xml.serializer.DOMSerializer Interface
org.apache.xml.dtm.DTMManager Class
org.apache.xalan.xslt.Process Class
org.apache.xalan.xslt.EnvironmentCheck Class
org.apache.xalan.xsltc.trax.TransformerFactoryImpl Class
org.apache.xalan.xsltc.trax.TemplatesImpl Class
org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl Class
org.apache.xalan.xsltc.trax.DOM2SAX Class
org.apache.xalan.transformer.XalanProperties Class
org.apache.xalan.transformer.TrAXFilter Class
org.apache.xalan.transformer.TransformerIdentityImpl Class
org.apache.xalan.processor.TransformerFactoryImpl Class
org.apache.xalan.lib.sql.XConnection Class
javax.xml.transform.sax.TemplatesHandler Class
XALAN Getting Started with XSLTC
The Usage of XALAN
Overview of XALAN - Java
<< WCF, WS, SOAP
XHTML >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :526

 

Xalan: The org.apache.xml.serializer.Encodings Class

Sub Interfaces: java.lang.Object

Members

Signature

Public methods

static java.lang.String

convertJava2MimeEncoding(java.lang.String encoding)

static java.lang.String

convertMime2JavaEncoding(java.lang.String encoding)

static java.lang.Object

getCharToByteConverter(java.lang.String encoding)

static int

getLastPrintable()

static int

getLastPrintable(java.lang.String encoding)

static java.lang.String

getMimeEncoding(java.lang.String encoding)

static java.io.Writer

getWriter(java.io.OutputStream output, java.lang.String encoding)

Overview

This class provides information about encodings. Depends on the Java runtime to provide writers for the different encodings, but can be used to override encoding names and provide the last printable character for each encoding.

Sometimes we need to override the current encoding type. This class helps to provide different to encoding types.

Method Overviews

Most of the methods in this class are static. So you can use method in this class without creating an instance of this class. It is the job of java runtime to convert to different encoding type. Most of the times, I have used  convertJava2MimeEncoding() method to convert a string into Mime type.

Example of convertJava2MimeEncoding(java.lang.String encoding):

Try the best we can to convert a Java encoding to a XML-style encoding. It takes parameters a non-null reference to encoding string, java style and returns ISO-style encoding string.

        String needstobeMimeType="Your string to be enoded into mime type";

        String newText = Encodings.convertJava2MimeEncoding(needstobeMimeType); In the above example, I have used created a Properties object using 

Example of convertMime2JavaEncoding(java.lang.String encoding):

This method does opposite to the above method. It converts mime type encoding to java type encoding.

String needstobeJavaType="Your string to be enoded into Java type";

        String newText1 = Encodings.convertMime2JavaEncoding(needstobeMimeType);

Example of getWriter(java.io.OutputStream output,                                       java.lang.String encoding)throws java.io.UnsupportedEncodingException:

Returns a writer for the specified encoding based on an output stream. If you want a Writer instance with a specified encoding type the use this method. This method helps a lot for internationalization where you will be dealing with different encoding types.

try{

            java.io.Writer writes = Encodings.getWriter(System.out, "UTF-8");

        }catch(Exception e){

            e.printStackTrace();

        }

In my above example, I have used System.out as OutputStream and encoding UTF-8.


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

A great opportunity to Digital Vide
here is a greate opportunity as a S
A great opportunity as a Network En
A Greate Opportunituy as a SQL Deve
An immediate job opportunity as a B

View all Jobs (Add yours)
View all CV (Add yours)



chicago web site design
conference call
Host Department NOLIMIT Web Hosting
Domain Names
Bvlgari sunglasses
PA Pool Contractor
answering service
help desk support
swimming pool contractor
MSN
sunglasses


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP