Help:displaying Arabic characters using XSL

How do I display static Arabic characters using XSL in a HTML page, from within a JSP?
I need to display a HTML page wherein static Arabic characters have to be shown. I use the following XSL document with static Arabic characters inside:
<?xml version = '1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<HTML>
<HEAD/>
<xsl:apply-templates/>
</HTML>
</xsl:template>
<!-- document xsl:template -->
<xsl:template match="booklist">
<BODY BGCOLOR="#CCFFFF">
<H1>^GFcI cSGZOI
</H1>
<P> This will illustrate the transformation of XML file containing list of books to a HTML table form
</P>
<xsl:apply-templates/>
</BODY>
</xsl:template>
<xsl:template match="booklist/book">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="booklist/book/title">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="booklist/book/author">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="booklist/book/publisher"/>
<xsl:template match="booklist/book/price"> Price: $
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
When I try to read the XSL document using an IO stream, like this,
InputStream is = getClass().getResourceAsStream("myXSLDocument.xsl");
XSLStylesheet stylesheet = new XSLStylesheet(inputStream, null);
from within a JSP, I get a null pointer exception as shown below:
java.lang.NullPointerException:
at oracle.xml.parser.v2.XSLStylesheet.<init>(XSLStylesheet.java:175)
at mip.portlets._cardvalidaterportlet._cardentry._jspService(_cardentry.java:143)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java)
at oracle.jsp.JspServlet.internalService(JspServlet.java, Compiled Code)
at oracle.jsp.JspServlet.service(JspServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at oracle.portal.provider.v1.http.JspRenderer.renderBody(JspRenderer.java:133)
at oracle.portal.provider.v1.RenderManager.render(RenderManager.java:164)
at oracle.portal.provider.v1.http.ServletProviderResponse.showPortlet(ServletProviderResponse.java:510)
at oracle.portal.provider.v1.http.HttpProvider.dispatchProviderAction(HttpProvider.java:647)
at oracle.portal.provider.v1.http.HttpProvider.service(HttpProvider.java:383)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java, Compiled Code)
at org.apache.jserv.JServConnection.run(JServConnection.java, Compiled Code)
at java.lang.Thread.run(Thread.java:479)
I have no problems parsing the same XSL containing static Arabic text using Transviewer beans' XSLTransformPanelSample class. This means that my XSL has no errors in it.
null

You need to use the correct and the same character encoding (charset) thorough the complete process.
Whenever you get question marks, then it means that the charset used does not recognize the bytes (which on its turn are apparently encoded by a different charset).
This is an important read, read it from top to bottom, preferably twice: [http://www.joelonsoftware.com/articles/Unicode.html].

Similar Messages

  • Problem displaying Arabic characters in PDF using Java APIs

    We are experiencing a problem when attempting to display Arabic characters within a PDF document using the Java APIs.
    The relevant Java code is as follows:
    RTFProcessor processor = new RTFProcessor("example.rtf" );
    processor.setOutput( “example.xsl” );
    processor.setExtractXLIFF(true);
    processor.process();
    ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
    DataProcessor dataProcessor = new DataProcessor();
    dataProcessor.setDataTemplate( example.xdt" );
    if( parameterValues != null && parameterValues.length > 0 )
    setReportParameters( dataProcessor, parameterValues ); // method to set any report parameters from the parameterValues list.
    dataProcessor.setConnection( jdbcConnection );
    dataProcessor.setOutput(dataOut);
    dataProcessor.processData();
    FOProcessor foProcessor = new FOProcessor();
    foProcessor.setLocale( locale );
    foProcessor.setData( new ByteArrayInputStream( dataOut.toByteArray() ) );
    foProcessor.setTemplate( “example.xsl” );
    String xliffFileNameAndPath = getXLIFFFile( “example”, locale );
    if( xliffFileNameAndPath != null )
    foProcessor.setXLIFF( xliffFileNameAndPath );
    foProcessor.setOutput( "example.pdf" );
    foProcessor.setOutputFormat(
    outputFormat == PDF_FORMAT ? FOProcessor.FORMAT_PDF : FOProcessor.FORMAT_HTML );
    foProcessor.generate();
    The method getXLIFFFile( ) gets the relevant XLIFF file for the supplied report locale (if it exists) – the three test files that we used were Italian (example_it_IT.xlf), Spanish (example_es_ES.xlf) and Arabic (example_ar_AE.xlf).
    I imported the following JAR files from the XML Publisher release (version 5.6.2) into my Java application: collections.jar, i18nAPI_v3.jar, versioninfo.jar, xdocore.jar and xmlparserv2.jar.
    The output is OK for all three translations in HTML format, using a charset of UTF-8, and for Italian and Spanish in PDF format. However, the Arabic characters display as question marks in PDF format. The same issue occurs if I stream the output as a byte array straight to the HTTP response rather than save within a file.
    Note that the same RTF, XDT and XLIFF files produce the correct output in both HTML and PDF when executed within XMLPublisher.
    Thank you

    Hi
    I had a similar issue with arabic chars. With PDF layout, chars were appearing properly when preveiwd on local m/c, but as I implement file on server, it was displayed as ?????. I had raised a TAR 5798348.993 with oracle about this and they suggested to apply patch 4028294 Oracle Sourcing J Rollup and then patch 4182914. But later my users changed requirement and i cud not apply the patch to test if it works fine.
    But here, you have suggested that installing fonts would do. Is it really that simple? If yes, dont know what is that patch for which I was told to apply.
    Regards
    Varun

  • Transformation of german characters using xsl

    Hi,
    I have an xml which contains german characters .. i apply an xsl on the xml to get an html output using xalan. and the german character is converted to "?". When i try converting this using a stand alone java client class it successfully transforms it and am able to see the german character but when the same code is deployed within the application server all the german characters are converted to "?" on the browser. can anyone help me out on this ? i am using an oracle application server (OC4J)
    Pointers on how to move ahead for solving the issue would be real helpful.
    Thanks in advance,

    I'm doing this, and my XSL files include other XSLs. Here's the line of code I use:Templates t =
    factory.newTemplates(new StreamSource(new File(getServletContext().getRealPath(xslFile))));where the String variable xslFile contains something like "Callers.xsl" and my Callers.xsl file is in the web application root. I don't doubt it would work just as well creating a Transformer.

  • Help displaying an image using the canvas!!!!!!!!

    Hey guys
    I don't know whether I am not grasping some concepts well.I have been going mad trying to get the code working
    Here is the code
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import java.io.*;
    * @author Administrator
    * @version
    public class MyMIDlet extends javax.microedition.midlet.MIDlet implements CommandListener{
    private Display display;
    private MyCanvas canvas;
    private Command exitcommand = new Command("Exit",Command.SCREEN,1);
    private Image source;
    public MyMIDlet() {
    protected void startApp() throws MIDletStateChangeException{
    if (display == null){
    initMIDlet();
    protected void pauseApp() {
    protected void destroyApp(boolean unconditional)throws MIDletStateChangeException {
    exitMIDlet();
    public void commandAction(Command c, Displayable d) {
    if (c == exitcommand){
    exitMIDlet();
    protected void initMIDlet() {
    display = Display.getDisplay(this);
    canvas = new MyCanvas(this);
    System.err.println("Canvas instiated succesfully");
    canvas.addCommand(exitcommand);
    canvas.setCommandListener(this);
    display.setCurrent(canvas);
    public void exitMIDlet() {
    notifyDestroyed();
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import java.io.*;
    public class MyCanvas extends Canvas implements Runnable {
    private MIDlet midlet;
    private Image offscreen;
    private Image currentimage;
    private Graphics g;
    //MID profile application
    /** Creates a new instance of MyCanvas */
    public MyCanvas(MIDlet midlet) {
    this.midlet = midlet;
    try{
    currentimage = Image.createImage("/bird0.png");
    }catch(IOException e){
    System.err.println(e.getMessage());
    if (currentimage!= null){
    System.err.println("Image create successfully");
    }else{
    System.err.println("Image not created");
    try{
    Thread t = new Thread(this);
    t.start();
    }catch(Execption e){}
    protected void paint(Graphics g){
    Graphics saved = g;
    int x = getWidth();
    int y = getHeight();
    g.setColor(255,255,255);
    g.drawImage(currentimage,x,y,g.TOP|g.VCENTER);
    public void run() {
    repaint();
    I know for a fact that the Canvas class 's paint method is called by the system and not the application. This poses a problem for me because I am not sure how to pass the image to the piant method, so that it can be painted.
    When I run the program(using J2ME wtk04), this is the outcome.
    Image created succesfully
    Canvas instiatiated successfully
    null
    Here are my questions
    1) when is the paint method precisely called by the system?after a reference to the canvas class is created?
    2) is it wise to create the image when instiating the canvas class?( initially created the image using a separate thread)-when sould the image be created?
    3)how to let the application know when to use the image when painting the display area?
    I am just trying the logistics here. It is very crucial to me to understand the bolts of this as the core f my project fouses on the man machine interface development.(For the project, the cilent application is quering for the map using HTTP)
    I use a png file of size 161 bytes. Is that too big for testing purposes.
    I would all the help that I can get. thanks in advance

    1) when is the paint method precisely called by the system?after a reference to the canvas class is created?
    After the canvas is set as the current display, and after that, after the repaint() is called.
    2) is it wise to create the image when instiating the canvas class?( initially created the image using a separate thread)-when sould the image be created?
    It's better to create the image in the very begining of the program e.g. in the midlet initialization. You can call the created image as often as you like later on
    3)how to let the application know when to use the image when painting the display area?
    you have to tell it :))
    you can use if-then, switch, or anything else
    and you can use clipping too

  • Help-XML report which uses XSL-FO and XSL-FO contains OAF VO

    Hello All,
    I want to know functionality of one XML report developed by Oracle.
    From one oracle form after clicking one button, it is populating PDF file output of report to open.
    Here is what Oracle has done to achieve this:
    On the click of button on oracle form, it is calling one OAF form. (fnd_function.execute(function_name=> 'ONT_PRINT').
    This OAF form contains nothing on its layout. One CO (File is attached) and AM is attached to this OAF page.
    In CO, may be it is somehow it is calling RTF file.
    I got the RTF file from XML publisher, RTF imports one XSL-FO (ONTBSAEXSL is a Template of XSL-FO type in Oracle apps in XMP Publisher administrator responsibility) file using <?import:xdo://ONT.ONTBSAEXSL.en.00/?>
    In the XSL file, OAF View Objects has been used like,
    <xsl:variable name="LinesVO" select="/*/HeaderVO/HeaderVORow/LinesVO/LinesVORow"/>
    What is the meaning of " /*/HeaderVO/HeaderVORow/LinesVO "? Does it mean LinesVO is getting called by HeadersVO. But in OAF this never happens.
    I want to add some columns in the RTF from LinesVO. But "Unit price" is not available in LinesVO.
    Do I need to extend this VO in JDeveloper and upload the .JPX and extended VO files?
    I have done extending the VO, but no use..
    So,
    In short my question is,
    If I extend the VO LinesVO by XXLinesVO, then will this <xsl:variable name="LinesVO" select="/*/HeaderVO/HeaderVORow/LinesVO/LinesVORow"/>
    statement in XSL-FO use my XXLinesVO or LinesVO?
    Regards,
    Parag

    I want to customize one RTF template by adding some columns. This RTF imports one XSL-FO stylesheet.
    RTF has tags like <?for-each:/*/HeaderVO/HeaderVORow/LinesVO/LinesVORow?>
    and XSL file has tags like <xsl:variable name="InternalOrgName" select="/*/HeaderVO/HeaderVORow/InternalOrgVO/InternalOrgVORow/Name"/>
    If I want to add one colun in LinesVO, what are all things I need to do?
    I customized it by adding the new columns through JDeveloper and extending the VO's and substituting them, importing JPX and bounced apache.
    But the XSL-FO file is very strange (attached herewith). Those changes are not reflecting in report even after extension.

  • Report displaying Arabic characters in output as junk characters

    Hi
    We have few Arabic reports which are giving output as junk characters. Below are version details
    EBS Version : 11.5.10
    Reports : Oracle 6i
    Database : 10g
    Any pointers how to resolve this issue
    Thank You
    Arjun

    may be font is not available in client side
    or
    database is not configured unicode
    thanks
    mostafiz mitul
    Dhaka Bangladesh

  • Arabic Characters not displaying properly in SQL+ Enviorment

    Hi,
    I have Oracle 8i ,I am able to insert and view arabic characters properly from asp and asp.net application but whenever i tried to run sql scripts to fetch arabic data it displays only reverse'?'sign in place of all characters .....
    Is there any particular setting to be ..... If yes please also mention the steps.
    Bye

    May I assume since you're using ASP that you're on Windows? The only way I'm aware to be able to display Arabic characters on Windows would be to set your Windows language to Arabic. This will be somewhere in the Control Panel, but without knowing what version of Windows you're on, it's hard to be more specific.
    In general, SQL*Plus is not a wonderful tool for viewing non-English data.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Arabic Characters Displaying as ?????????????????????

    Hi all,
    We are facing problems in displaying arabic characters on some pages while loading data from database with AR locale settings.
    When UTF-8 did not work as the data in database was stored using encoding WINDOWS-1256.
    After changing to WINDOWS-1256, it did work on most of the pages by adding following two lines, but one page still has problems and data is displayed as ????????????????
    <%@ page contentType="text/html;charset=windows-1256"%>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1256"/>The .jsp page with problem, has one extra following LINE, if that can be a problem during its initialization etc.:
    <%@ page extends="com.retailer.web.ParentJsp"%>And ParentJsp.java extends com.orionserver.http.OrionHttpJspPage
    Beside above things, what are chances that the FONT-FAMILY used from .css as styleClass attribute with web control, can create problems...
    Thanx in advance...
    Edited by: ghussain on May 18, 2009 5:00 PM

    Use UTF-8 all the way.
    Carefully read this: [http://balusc.blogspot.com/2009/05/unicode-how-to-get-characters-right.html].
    Please keep in mind that using a Windows proprietary encoding on the both sides requires (yes, requires) that both the server machine and the client machine runs Windows. Why would you tight couple your server environment that much and why would you exlude non-Windows users from your webapp? This is almost the most foolish you can do.

  • Arabic characters are no longer displaying properly in NB 6.7

    Hello all -
    Up until NB 6.5.1, my GUI displayed Arabic characters properly as typed. As I shifted to NB 6.7 Beta today, all those Arabic characters are shown as funny binary-looking characters! But, this only occurs when I am running from within the NB space. When I run the application by clicking the jar files, the characters print OK.
    Questions:
    - Is this happening because it is a beta version may be?
    - Is there a way or a place where I have to set some properties to display the Unicode characters correctly?
    For example, I thought all I had to do was right-click the project --> Properties --> Source --> Encoding: UTF-8
    Thank you for any help.
    PS: I am posting this problem in the Internationalization forums.

    PS: I am posting this problem in the Internationalization forums.A more appropriate place might be a NetBeans forum.
    db

  • Problem in displaying Arabic Character in Paper Layout

    Hi
    I am facing problem while displaying arabic characters.
    In Web layout i am able to get it by changing the character set to ISO-8259-6.
    I had changed the NLS parameters in registry as suggested in the help. But still i am unable to get. Please can anyone send the brief steps to fix this.
    Thanks in Advance
    Ranganath

    Ranganath,
    That means subsetting is not happening. If subsetting had been successful, you would have seen in "Font properties", the type of font as Type 3 and name of the font as Fx, where x could be 0,1 etc.
    The things I suspect are: 1) your report definition has some other font associated which is not Arial.
    2) You are not specifying correctly the subset information in uifont.ali.
    Open your report in builder and check again, what font you are using to display the data. Open the report in paper layout and click on the data field and check in the font box, the font name that is displayed.
    In your uifont.ali, make sure that under [PDF:Subset] section, you specify (if you are using Arial font)
    Arial = "arial.ttf".
    If you have any other entry regarding Arial in other sections of uifont.ali, comment those for the time being by putting # before those.
    Let me know the font properties after these steps.

  • Arabic characters not rendering properly

    My code is here.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" backgroundAlpha="1" backgroundColor="white">
    <mx:Label text="البريدا إللكتروني" fontSize="36"/>
    </mx:Application>
    And its output is here (Note the Arabic rendering issues).
    Can someone assist me to fix this issue in a quick way?
    Many thanks for any suggestions.
    Nith

    May I assume since you're using ASP that you're on Windows? The only way I'm aware to be able to display Arabic characters on Windows would be to set your Windows language to Arabic. This will be somewhere in the Control Panel, but without knowing what version of Windows you're on, it's hard to be more specific.
    In general, SQL*Plus is not a wonderful tool for viewing non-English data.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Hi, am trying to display chinese characters

    hi,..i have problem displaying chinese characters using the reporting tools. i even changed the .jsp to use UTF8 encoding but the jsp doesnt display the correct chinese characters. Anyone can help ?

    Hi Teo Kai Liang,
    In order to display UTF-8 characters in the web output of your report, when it is deployed using the JSP engine (instead of rwservlet), you would need to add the following tag to its JSP web source in Reports Builder, between the <HEAD> and </HEAD> tags:
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    This will tell the browser to display text using the specified character set. I have verified this using a report containing some static Simplified Chinese text in its web source.
    Thanks,
    The Oracle Reports Team.

  • How to display Chinese characters in Oracle?

    I am using Oracle 8i with Language settings as AMERICA.
    I am displaying records which is contain Chinese characters.
    But it is not displayed properly in Oralce.
    How to change the settings to display Chinese characters?
    Thanks

    It could be possible to display Chinese characters using SQL Developer without any specific NLS_LANG setting because SQL Developer is using JDBC which doesn't use NLS_LANG setting according to When is NLS_LANG used ?.
    For example, I'm able to display the following Chinese character in SQL Developer 1.2.0 on Windows XP Pro with French Windows setting and NLS_LANG set in Windows registry to FRENCH_FRANCE.WE8ISO8859P1.
    select unistr('\8349') from dual;

    [pre]
    Message was edited by:
            Pierre  Forstmann                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Arabic characters are not getting displayed in oracle pdf output

    Hi,
    I am trying to print arabic characters in report output but junk characters are getting displayed in output.
    Using 10g report builder, added the arabic labels in report layout.
    Followed below steps:
    1. Set NLS_LANG=ARABIC_United Arab Emirates.AR8MSWIN1256
    2.Set REPORTS_PATH to the system font directoy such as C:\SYSROOT\Fonts
    3.transferred the arialbd.ttf to $ORACLE_HOME/guicommon/tk/admin/AFM
    4.Open uifont.ali under$ORACLE_HOME/guicommon/tk/admin, set the font alias
    entries at [PDF:Subset] section.
    [PDF:Subset]
    Arial...Bold.. = "arialbd.ttf"
    5. open datap462.ppd under $ORACLE_HOME/guicommon/tk/admin/ppd, set the font information like
    *Font Arial-Bold: Standard "(001.001)" Standard ROM
    6.added following entries:
    Add this under the following section
    ## setting for Reports Runtime
    REPORTS_PATH=$ORACLE_HOME/reports/templates:$ORACLE_HOME/reports/samples/demo:$ORACLE_HOME/reports/integ:$ORACLE_HOME/reports/printers:$ORACLE_HOME/
    guicommon/tk/admin/AFM:${REPORTS_PATH};
    export REPORTS_PATH
    b) Add this in the end of the Reports.sh file
    PRINTER=dds62; export PRINTER
    tk90_PRINTER=dds62; export tk90_PRINTER
    tk90_PRINT_STATUS=echo; export tk90_PRINT_STATUS
    =======================================
    After having all these steps, still my report output is coming with junk characters.
    Please help me on this and this is very urgent requirement for me and i am trying on this since 3 days.
    Thanks,
    Harini

    Hello,
    Try to set the Font Subsetting like below in the file uifont.ali
    [PDF:Subset]
    * = "arialbd.ttf"
    If it works after this modification, the problem will be related to the Font Aliasing
    Troubleshooting Guide for Font Aliasing / Font Subsetting / Font Embedding Issues (Doc ID 350971.1)
    Regards

  • Data Integrator: Arabic characters are not correctly displayed

    Hi,
    I'm trying to load Arabic text via an UTF8 flat file into an Oracle database.
    I've read several topics and set the correct code page settings (also during install) for the datastore and flat file.
    Already in flat file preview (see attached screenshot), the wrong characters are displayed. The characters as they are displayed, are inserted in the database. So I think that if I get the flat file preview correctly, the text is inserted correctly into the database.
    On the other hand: When i copy the contents of the flat file, via a bodi job, to another flat file, the target flat file does contain the correct characters (when opened in a utf8 file reader).
    I tried several solutions and also went through the Code Page help topic on the BODI site.
    Does anyone know a solution to my problem or know this is a BODI bug or something?
    I'm using Designer version 11.5.3.9 (I went through fix notes of versions after 11.5.3.9, but saw nothing mentioned about my problem). The Oracle database does support arabic characters as I can insert them via e.g. SQL Developer.
    Thanks a lot in advance!
    Picture of the flat file settings and data preview:
    [flat file settings and data preview|http://img169.imageshack.us/my.php?image=arabcharyx3.jpg]
    Edited by: Willem van Opzeeland on Jul 23, 2008 2:13 PM: added info

    Hé Amr, thanks a lot! This sounds good.
    I indeed saw a kind of this solution somewhere else. What I did not is restarting the computer, since it is a shared server. Maybe that was why it didn't solve my problem.
    Before I restart an additional question: I need to convert some files with Turkish characters as well.
    Have you got a value which I can put in NLS_LANG, which supports these characters and Arabic characters both at the same time?

Maybe you are looking for

  • Macintosh IIsi won't output video

    I recently got my hands on a Macintosh IIsi that refuses to boot, I get the startup tone, the hard drive spins, and the indecator lights light up but it won't output video. I have tried multiple monitors and different display adapters without success

  • Quiery for Financial Period

    Hi All I have some doubts which my client encountered. pls give your valauble suggestions on this. We have just closed our Dec08 a/c. Normally, we have to perform balance carry forward  and carry forward customer vendor balance before we start the 20

  • Loaded from text cd. will not run samples from same cd

    I have adopted Delmar text Electronic Devices: Systems & Applications and intended to use the copies of multisim 2001 that we own.  When I discovered that the text includes a limited copy of Multisim textbook edition, that seemed even better; it inst

  • I have activation issues in 3GS after move to iOS5

    Hi I cannot activate my 3GS after upgrade to iOS5, it says the activation server is temporarily unavailable, what can I do? Non of my friends in the office had this problem, just me

  • Newby with a T430 and T420

    Hi all I am hoping this forum will help me. I have a Lenovo T420 and aT430 T420 I7 2640M cpu @ 2.8ghz8g ram T430 I7 3520 cpu @ 2.9ghz16gb ramssd 840 evo 120gb for startup I have put 750gb black HD in both of these in the dvd player using a caddy, the