Displaying a XSLT result in a JTextArea Using the Proper Encoding

Hi!
I'm trying to output the result of my xslt into a JTextArea however I can't seem to output it in its proper encoding.
I have this code to transform my xml:
Source source = new StreamSource(xmlFilePath);
source.setSystemId(new File(xmlFilePath).toURL().toExternalForm());
StreamResult result = new StreamResult(System.out);
transformer.transform(source, result);
And I'm using this to redirect System.out to the JTextArea:
textAreaPrintStream = new TextAreaPrintStream(OutputTextArea, System.out);
System.setOut(textAreaPrintStream);
With TextAreaPrintStream as:
package ati.xslt.transformer.gui;
import java.io.*;
import javax.swing.*;
public class TextAreaPrintStream extends PrintStream {
private JTextArea textArea;
private final static String newline = "\n";
public TextAreaPrintStream(JTextArea area, OutputStream out){
super(out);
textArea = area;
public void println(String string) {
textArea.append(string + newline);
textArea.setCaretPosition(textArea.getText().length());
public void print(String string) {
textArea.append(string);
textArea.setCaretPosition(textArea.getText().length());
public void write(byte[] buf, int off, int len) {
super.write(buf, off, len);
textArea.append(new String(buf, off, len));
textArea.setCaretPosition(textArea.getText().length());
public void write(byte[] b) throws IOException {
super.write(b);
textArea.append(new String(b));
textArea.setCaretPosition(textArea.getText().length());
If I set result as file and not the System.out, my output xml is correct.
Can someone help me with this?
-- Jeff

you can use AJAX for this.. google maps is using ajax for rendering their maps..

Similar Messages

  • How to use the character encoding model to use ' �'  in java

    hi
    I have to use the special characters like '�' using java.but when '�' character is transferred to data base or is displayed in my form,it is shown as '?'.but i need to display the original characters in the form of what it is.
    what can i do as i expects the result .i needs it very urgently.so reply to me as soon as possible.
    advance thank you
    rgds
    Oasisdeserts

    Java stores all characters as 16 bit UNICODE (which has plenty of room far more exotic characters than Greek). Every time character data is brought into, or stored from the Java environment it passes through a specific character encoding. If you don't state the encoding explicitly it uses the default encoding of the machine it's running on (which is typically oriented to the language set in the locale.).
    With a database the database driver is supposed to do any necessary translation. The non-latin character could be stored wrongly, the database could be returning it wrongly or whatever's creating your form could be interpretting it wrongly, or lack the capacity to display the character.
    If it's, say, a JSP try setting the page encoding to UTF-8. Try dumping the characters read from the database in HEX and look them up at www.unicode.org.
    Take a look at the database setup information, some have an option of storing characters as UNICODE or ASCII.
    The "?" is substituted whenever a codec can't make sense of the codes it's translating, either the byte array is invalid or the UNICODE character can't be represented.

  • Iphoto does not use the proper display profile

    Hello.
    I just bought a 20' Apple Cinema display and connected it to my Macbook. I have noticed a very strange behavior of iPhoto and Preview.
    I will first describe the expected (right behaviour).
    When I drag an image opened in Adobe LG or Aperture from the Macbook display to the Cinema display (or the opposite) after a very small delay the color of the image adapts to the color profile of the display where it was dragged. Which is the correct the behavior.
    With Preview or iPhoto this adaptation does not happen and the image is displayed with the right profile only on one of the 2 display. Besides being a very annoying issue, the very strange thing is how you can choose on which one of the displays the image gets displayed with the right display color profile:
    - With Preview, the display color profile used (for both displays) is selected based on which is the default display in ColorSync display settings.
    - With iPhoto, the display color profile used (for both displays) is selected based on which display the munu bar is (!!!). That is, if you want to have your image displayed with the right display profile on your cinema display, then you MUST have the menu bar on that display. If the menu bar is on the Macbook display the image on the cinema display will be displayed with the display profile of the Macbook display. Crazy!
    You can try all of the above remembering that after any change you need to quit and reopen iphoto or preview or ColorSync for the settings to apply.
    My question is: why neither iPhoto nor Preview act in the right way like Aperture or Adobe LG? Or at least, why iPhoto does not behave like Preview allowing me to choose where I want the menu bar without having this choice affecting the display color profile used to display my images?
    Thank you,
    Marco

    Welcome to the Apple Discussions.
    why iPhoto does not behave like Preview allowing me to choose where I want the menu bar without having this choice affecting the display color profile used to display my images?
    Make a feature request at http://www.apple.com/feedback/iphoto.html
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • "Saved Result Sets" message when using the raplace wizard in the Admin Tool

    Hi,
    I'm just trying to replace an existing Essbase source with a new one in my Business Model using the replace wizard. )It's a cube with > 1.5k account members so I'm really not looking forward to doing that manually).
    So far all migrations have worked fine, but somehow this time after specifying which tables to use for the replace, instead of showing me a list of columns which will be changed, the wizard throws a "Saved Result Sets" message and just hangs. Every time I hit "Finish" the message appears again.
    Here's a screenshot .
    Anyone ever came across this?
    PS: what's up with the links these days? Jive acting up again?
    Edited by: Christian Berg on Feb 10, 2010 2:57 PM

    Update: looks like the wizard is really overwhelmed with big cubes (1.5k accounts, 20 dims @ approx 10 generations each) and just breaks.
    I haven't figured out the exact limit, but I'm able to migrate pack of about 8 dims at a time as long as I leave the accounts dim out and do that on itself.
    Cheers,
    C.

  • Displaying error page when not entitled to use the portal

    Hi,
    We are using BEA Portal 8.1 and would like to display an error page to a user
    who is authenticated but not entitled to view any of the portal resources. Does
    anyone know how to do this?
    Here are more details:
    Users are authenticated by Netegrity Siteminder when they logon to the LAN. An
    authenticated user may or may not be entitled to use the portal site depending
    on attributes passed in the header by netegrity. These attributes values are stored
    as user profile properties. Visitor entitlements have been created based on these
    properties and pages/portlets are then entitled through these visitor entitlement
    roles.
    If a user is not a member of any roles, then they should be redirected to a page
    indicating that they do not have permission to access the portal. Howe can this
    be implemented?
    Thanks.

    Hi Lilybiri,
    Thanks for your quick response. I followed your suggestion and verified my Adobe ID on acrobat.com.
    Now I can enter the collaborate function. However, everytime when I tried to send it to myself (for test purpose) I got another error message "You need to enter a valid emaill address". I saw someone else on this forum has met the same problem. Do you have any suggestion on what is the possible reason for this to happen?
    Again, thanks for the fast response. You have been helping me and other ppl so much.

  • I have an iMac that has no connectivity with the mouse.  I have replaced the batteries in the mouse.  As a result, we can not use the computer as the mouse won't move

    I have an iMac which the mouse has lost connectivity.  Batteries on mouse have been replaced and green light on mouse is on.
    I can now use the computer as it does not respond to mouse or it appears to the keyboard.  Just not sure if it is a problem with the computer its self?
    Thanks

    I would highly recommend you run a test by trying another mouse with the iMac and see if that fixes it.  That would tell you the problem is Not with the iMac itself.
    Hope this helps

  • Using the Soap Encoding schema within an XSD

    Hi,
    I am trying to create some XSDs based on the types from the auto-generated WSDLs in JDeveloper. However, I find that while the Array type works fine in the WSDL, I cannot seem to get it validate correctly in my XML schemas, possibly due to some namespace error.
    The current code in the XSD is given as:
    <xsd:schema
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
    <xsd:complexType name="VesselQueryResult">
    <xsd:all>
    <xsd:element name="vesselNames" type="ArrayOfjava_lang_String"/>
    </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="ArrayOfjava_lang_String">
    <xsd:complexContent>
    <xsd:restriction base="SOAP-ENC:Array">
    <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/>
    </xsd:restriction>
    </xsd:complexContent>
    </xsd:complexType>
    When I tried to add this XSD using as a user schema, however, below validation error is being displayed:
    Error: Line 0, Column 0: Invalid reference: 'http://schemas.xmlsoap.org/soap/encoding/:Array'
    I tried to qualify the SOAP-ENC namespace with the schemaLocation, but another error was displayed:
    <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"
    schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>
    oracle.xml.parser.schema.XSDException: Server returned HTTP response code: 407 for URL: http://schemas.xmlsoap.org/soap/encoding/
    I am wondering how JDeveloper supports the SOAP-ENC schema for use in XSDs. Do I need to add the Soap Encoding schema as a user schema, or is there a way I might reference it similar to the way that auto-generated WSDLs seem to deal with it? Any information regarding this would be greatly appreciated.
    Thank you and regards.

    I deleted the two lines of coding below:
    utl_http.set_proxy('www-proxy', NULL);
    utl_http.set_persistent_conn_support(TRUE);
    and then I set the utl_http.set_persistent_conn_support() to False to get that error message. Seems like the website in question doesnt have the webservice anymore because the error has to do with the parsing of the WSDL file.... which probrably doesnt exist.
    Im just trying to get a working example of using a third party webservice to return a value to be displayed in the database.... know of any good examples? The ones im using seem to be pretty out dated... the barnes and nobles example just times out....

  • Subreport as a reportparam not using the proper query

    I am trying to use a report with a subreport, normally works fine, but I want to pass a query to the subreport, not let it use its internal query.  This works fine if I call the sub report by itself and hand it the query.  AS a report it runs fine.   When I use it as a reportparam it ignores the query.  Very very frustrating.

    HI Martin,
    i am not realy sure what you want!?!?
    i think you want to display only a part of the values you read from XYZ
    so what you can do:
    write all the values in an array.
    the size of the array is the max. value of the slide bar
    now you can select a part of the array (e.g. values from 100 to 200) and display this with a graph
    the other option is to use the history function of the graphes
    regards
    timo

  • Does iDVD and DVD Studio Pro use the same encoder?

    I have a video I shot in 1080p and it looks great on screen. When I use iDVD to make a quick playable DVD of it (as i have done with many other projects) I'm not happy with the results. It is only about 8 minutes long so there shouldn't be issues with extra compression to get it to fit on the disc.
    So I'm thinking of redoing it in DVD Studio Pro, but won't bother if they both use the same MPEG-2 encoding methods. Any thoughts?
    Thanks in advance,
    Mark

    Videodude, Compressor isn't necessary since iDVD will do the compression for you. But I wasn't happy with the standard def quality I was getting so Mish recommended using manual settings in Compressor and exporting the MPEG2 files needed to burn to DVD. Since Compressor created the files I used DVD Studio Pro to master my DVD.
    You should be able to burn a HD disc through iDVD if you have a BlueRay burner. But keep in mind that not everyone has BlueRay and the discs aren't cheap. Be a shame if you handed out discs that no one could use.
    As a side note, I used Mish's advice and am really happy with the quality of video I'm getting now. I can only guess that iDVD over compressed the video so it could squeeze two hours on a DVD, even though my video was only 10 min.
    Mark

  • How can I make the browser use the proper filename during a forced save, using CFCONTENT/CFHEADER

    We have a client using CF8 Server for a site and I am using the CFHEADER/CFCONTENT method to force a file to save to the end-user's computer.
    The dialogue comes up as expected, but regardless of what is found in the CFHEADER for a filename, it tries to save the file as the CFM page name.
    i.e. The CFM page is signature.cfm. I am trying to make it save a TXT file to the user's computer, which it seems to be trying to do, but the instead of using "sig.txt" as the filename as outlined in the CFHEADER, it is defaulting to "signature.cfm"
    While I know that I could change the name and extension and the content in the file would be correct, the mass majority of end-users will not know that they can do that, and the client does not want it to become more complicated than necessary.
    Is there a way to make the file change to the proper name in the SAVE AS dialogue?
    Thanks in advance.
    Code so far is pretty straight forward ...
    <CFHEADER name="Content-Disposition" value="attachment; filename=sig.txt">
    <CFCONTENT type="application/unknown" file="#xf#">

    I'm guessing the type="application/unknown" is interfering. Try type="text/plain".

  • Playback issues from files compressed using the Divx Encoder

    Hey there,
    As the title implies, Im trying to edit Hypercam screen capture footage that was compressed with the Divx encoder it comes with.
    The footage then gets exported to an .avi format, and in windows it plays fine, HOWEVER, when I import the footage into premiere, all manner of horrible things happen, I have imported different footage encoded to the same format with no issues however. Has anyone else had an issue similar to this?
    the Rig:
    2.4 quad core
    3 gbyte of ram
    nvidia 8800 gts driver vers 182.xx
    Thanks

    If it is possible to NOT use the DivX CODEC, jump at that opportunity. It is a delivery format, pure and simple, and is not meant to edit, and does not edit well.
    Eddie's links will cover converting, but quality will be very poor.
    When faced with this CODEC, I use DigitalMedia Converter (~US$50), and it handles it fine. It just does not improve the quality, one iota. If there is no way around DivX (or Xvid), I can recommend the above. One must have the DivX CODEC (free) installed, but it sounds like you do. BTW, per Eddie's link, you WILL want to convert to DV-AVI Type II with PCM/WAV 48KHz 16-bit Audio. Again, you will need the MS DV CODEC installed, but most systems have this already.
    Good luck,
    Hunt

  • How to use the external encoder

    Can someone please tell me how to open the external encoder so i can copy and paste links into it to use my web cam?
    Thanks

    Find a forum for whatever product this involves and post your question there.
    Here is a link to a page that has links to all Adobe forums...
    Forum links page:
    https://forums.adobe.com/welcome

  • I have changed my Apple ID so that it would reflect my new email address. My Apple devices and icloud info do not display my new ID, even though I use the new one to log into iTunes, etc.  How can I get this problem resolved so that I might feel confident

    After changing my Apple ID I do not seem to be able to recognize it as my proper ID. It does work properly for an iTunes login and password, but, it is not displayed that way on my device when I look at my iCloud settings and other "system level" settings.
    How do I correct this to be confident that I can use a feature, such as "Find My iPhone" and know that the functions and contact info is correct?

    To change the iCloud ID on your device you have to go to Settings>iCloud, tap Delete Account, provide the password to turn off Find My iPhone when prompted, then sign back in with the ID you wish to use.

  • I have a Thunderbolt iMac 27" with a Thunderbolt Display attached.  I would like to use the iMac and Thunderbolt display in Target Display Mode for my new Thunderbolt MacBook Pro.  So far, it seems I can only use the iMac screen itself.  How do I do this?

    When I press the Command + F2, the iMac screen becomes a secondary for the MacBook Pro, and the Thunderbolt Display becomes the primary screen for the iMac.  I was hoping that both screens would become secondaries for the MacBook Pro.  Does anyone know how I should proceed?  I have tried to connect the Thunderbolt display directly to the MacBook Pro, and the iMac to the Thunderbolt Display via the separate Thunderbolt cable, but there was no difference.  And since the MacBook Pro only has the one Thunderbolt port, I'm not sure how to proceed.

    Yes, eww, the language definitely states two thunderbolt displays, but I can understand the confusion and was siding with how they could make the mistake to think it would work like they want it to. My appologies for not being clear on that point, but I think you make it clear that the language in the ad says nothing about an imac.
    Having said that all the language about TB would suggest that this would be possible. http://www.apple.com/thunderbolt/
    High performance on display.
    Thunderbolt I/O technology provides native support for the Apple Thunderbolt Display and Mini DisplayPort displays. It also supports DisplayPort, DVI, HDMI, and VGA displays through the use of existing adapters. So you can connect your Apple LED Cinema Display or other display, along with multiple high-speed devices, all from a single port.

  • Display User Selection Results on Cover Sheet of the Crystal Report

    How do you display the result of a multi-level dynamic parameter that the user has selected on the cover sheet of the crystal report.
    Or Display the Start & Ending selection results from a dynamic parameter on the cover sheet of the crystal report.

    Replace the code with:
    stringvar selection;
    stringVar array arr1;
    numberVar i;
    redim preserve arr1[count({?ProductID})];
    for i := 1 to count({?ProductID}) step 1 do
    arr1<i> := {?ProductID};
    selection:= 'ProductID is : ' & chr(39) & join(arr1,",") & chr(39);
    This should hopefully fix the error, but I don't think it will solve your problem as it might keep assigning the same product id to each element of the array.
    Have you tried just join({?parameter},', ') as suggested by RG?
    Edited by: Sanjay Kodidine on Jul 1, 2009 10:22 AM

Maybe you are looking for