Problem with transform(source, result)

Dear gurus,
I have DOM document as source in my java program. The document has data for 1 record insert into a table.
The insert will be done on the database side with dbms_xmlsave.insertxml(insctx, xmldoc) where xmldoc is my document and has VARCHAR2 type.
I am looking for the correct syntax at the time when I do
transformer.transform(source, result);
so that I can pass 'result' to my database function that will do the insert with dbms_xmlsave.
Can I have 'result' as of type 'String'?
Thank you.
Anatoliy

Folks,
Never mind - I found an example, I am using
Writer outWriter = new StringWriter ( ) ;
StreamResult outResult = new StreamResult ( outWriter ) ;
transformer.transform ( source, outResult ) ;
String strResult = null;
strResult = outResult.getWriter ( ) .toString ( ) ;
but now the problem is with the first line of the xml doc which is
<?xml version = '1.0'?>
The CallableStatement doesn't like the single quotes! What should I do - get rid of the first line OR change single quote with douable quotes OR may be something else?
Thank you.
Anatoliy

Similar Messages

  • Problems with transforming special characters

    Hi,
    I develop a small educational application ( http://sourceforge.net/projects/pauker/ ). I work with JDK-1.4.0 on Mandrake Linux 8.2. At first I used serialized objects to save the lessons to a file. This worked well until I wanted to change some public members of the involved classes. That's why I switched over to the new and shiny XML. Now I have a different problem!
    Pauker saves its lessons in gziped XML files. Users from all over the world can create lessons containing very different characters. There are European characters like ������� and asian characters. Loading this lessons on a system with a different encoding works fine. Saving such a lesson on a system with a different encoding can destroy the lesson.
    Example:
    On a german system a user creates a lesson with the letter � on a card side and saves it. A different user working on an english system loads this lesson. The character "�" is displayed correctly. The english user saves the lesson. The character "�" will be replaced by a question mark in the xml file. Next time the english user loads the lesson she will not see "�" but "?" on the display.
    Here is a little example program that does the transformation in exactly the way Pauker does. Please test it out.
    import java.io.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import org.w3c.dom.*;
    public class XMLTest {
    public XMLTest() {
    try {
    // create document
    DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
    Document document = documentBuilder.newDocument();
    // fill document
    Element element = document.createElement("Element");
    document.appendChild(element);
    element.appendChild(document.createTextNode("�������"));
    // transform to XML
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    Transformer transformer = transformerFactory.newTransformer();
    //transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
    transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
    DOMSource source = new DOMSource(document);
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    StreamResult result = new StreamResult(outputStream);
    transformer.transform(source, result);
    System.out.println("original: �������");
    System.out.println(outputStream.toString());
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println();
    public static void main(String[] args) {
    new XMLTest();
    So what do I have to do to fix this problem? I have a lot of new features waiting in the CVS but this bug is still open and discussed. I dont want to release a new version with such a gaping hole in it...
    Thanks a lot!
    If you prefer to reply peronally, please use Ronny.Standtke at gmx.de

    I don't see how you can say that there's a problem with saving your XML files when the code you post doesn't actually save it to a file. Your transform is being written to a ByteArrayOutputStream, which isn't used except for this statement which I assume is for debugging:System.out.println(outputStream.toString());Of course that is useless for debugging the problem you describe, for two reasons:
    1. the toString() method uses your system's default encoding, which may be ISO-8859-1 but is definitely not UTF-8. You could write toString("UTF-8") but that is a waste of time because:
    2. You use System.out.println() to examine the data, which writes it to a console that also probably does not use UTF-8. I don't know what encoding it does use, but UTF-8 is unlikely.
    So, save your files using the UTF-8 encoding as robadmin suggested. And to test the result, make sure you use a tool that understands the UTF-8 encoding.

  • Problem with setting Source Level in Sun Studio 2

    I've got problem with setting Source Level to 1.5 in Sun Studio 2. When I try to set it to 1.5 in Project properties and click Ok everything seem to go well, but when I open Project Properties again Source Level is set to 1.4. I need this to work cause I started to lear Java recently and I want to use foreach loop.
    Please help

    I'm just citing an example using Date().
    In fact, whether I use DateFormat or Calendar, it shows the same result.
    When I set the date to 1 Jan 1950 0 hours 0 minutes 0 seconds,
    jdk1.4.2 will always return me 1 Jan 1950 0 hours 10 minutes 0 seconds.
    It works correctly under jdk1.3.1

  • Problem with transforming coordinate systems

    Hiho,
    i've got a problem with transforming coordinate systems.
    When I'm trying to transform a sdo_geometry object to another coordinate sytem and then back to the old system, the coordinates are not the same.
    Here's an example:
    StartSystem SRID is 8220 (Longitude / Latitude (DHDN))
    TargetSystem SRID is 8307 (Longitude / Latitude (WGS84))
    Original object:
    Polygon: {ExteriorRing: LineString: { (0.0, -90.0) (1.5, 0.0) (0.0, 90.0) (4.5, 0.0) (0.0, -90.0)} }
    Transformed object:
    Polygon: {ExteriorRing: LineString: { (0.0, -5156.620156177403) (85.94366926962347, 0.0) (0.0, 5156.620156177403) (257.8310078088704, 0.0) (0.0, -5156.620156177403)} }
    Transformed back to old system:
    Polygon: {ExteriorRing: LineString: { (0.0, -5156.620156177403) (4924.209525017614, 0.0) (0.0, 5156.620156177403) (14772.628575052844, 0.0) (0.0, -5156.620156177403)} }
    Any ideas what to do?
    Thanks for the help in advance.
    Dirk

    Hi Dirk
    Since the transform you are trying to do is just a datum conversion of lat./long. coordinates, even the first transform yields obvious rubbish. What you have provided here does not illustrate how you submitted your polygon to CS_TRANSFORM.
    Provide the syntax of your construction of the corresponding SDO_GEOMETRY object and your SQL select statement that gave these results.
    Bruce

  • Problems with transformation; infoobject not updated in DSO.

    Hi all,
    We are having some problems with one of our transformations between PSA and DSO.
    Suddenly some of the fields are not filled in the DSO. The mapping for field Sales order number worked fine, and then I added an infoObject in the DSO to hold the info for Sales order item. I also replaced the infoobject that was supposed to hold the sales order number. After this, none of the two fields has any data in DSO. I checked the PSA, and the data is available here. I tested the rule in ‘Rule details’ and for sales order number it gives the correct result, but for sales order item it gives a runtime error; assertion failed. I checked on SAP Notes, and found 929934. But the corrections are already added in our system.
    Has anyone got any ideas on what to do?
    BR,
    Linda

    Hi,
    There are a number of problems in Transformation when either a source field or target field is changed.
    This can lead to inconsistent transformation.
    You can raise a message to SAP or best thing is if possible delete the Transformation and create a new one.
    Regards,
    Nitin

  • Problem with java source procedure

    Hello everyone, I've set up a simple example that is supposed to create an fdf file on the server. I tested my program and it works fine.
    Now I'm trying to do the same thing except that I would like to have my java code in the database. Here's what I've done:
    # on database in opus schema
    create or replace and compile java source named testpdf as
    import java.io.*;
    import com.adobe.fdf.*;
    import com.adobe.fdf.exceptions.*;
    public class TestPDF
         public static void Test()
    try
         FDFDoc outputFDF = new FDFDoc();
         outputFDF.SetValue("status", "En traitement!");
         outputFDF.SetValue("Date", "01-01-2006");
         outputFDF.SetValue("Name", "Alexandre Folgueras");
         outputFDF.SetValue("Address", "12 Saratoga Ave");
         outputFDF.SetValue("City", "Saratoga");
         outputFDF.SetValue("State", "CA");
    outputFDF.SetFile("/tmp/java_pdf/GenerateFDF.pdf");
    outputFDF.Save("/tmp/java_pdf/alex.fdf");
    catch (Exception e)
    e.printStackTrace();
    create or replace procedure pdf_doc
    AS LANGUAGE JAVA
    NAME 'TestPDF.Test()';
    commit;
    Everything seems to be OK by when I run it, my file does not get created even though I don't get any errors.
    Anybody knows why?
    Thanks in advance!

    Hello,
    I'm also creating a class with static functions and putting it as a Java source in Oracle but I have problems with imports. In my case, I use MQSeries JAR files and when I put my code in Oracle, I have warnings "Java created with compilation errors". It's just about the lines where I create/use MQSeries objects, because when I comment them, I have no more errors.
    I see you also use specific imports with PDF, so I would like to know where you put the JAR files so that the Java source can be compiled correctly.
    Thanks in advance,

  • BW Procedure System Copy - Problemas with transformations and DTP

    Hello,
    My Administration system have done a BW production copy to a BW non-productive system. After that, I have created a transport order in BW production with the option "with the source-system-dependent objects". Before I transport this order to BW non-productive system, I have deleted, in this system, the ancient source-system assignment.
    When I have transported the order to BW non-productive system, the system I created transformation an DTP with another  ID. I was expected that the ID was the same and not another one. Is this normal? What will happen when i tranport the changes form BW non-productive system to BW productive system?
    Best regards.
    Sérgio Pinto

    Hello Raghavendra,
    But the BDLS report is not only for changing the logical name of the BW system? Is it possible to use this program in BW for changing the logical name of the source system than is assigned to the datasources?
    By changing ID I want to say that the DTP with the ID DTP_4EC3YB6B6DT0OIH1TMBB0F5VG is change to the ID DTP_4K1H1XZ38M1CLVJ2IA8KFDQYY in BW no-productive system, after transport from productive to non-productive system.
    Best regards.
    Sérgio Pinto

  • Software Installation Problems with Media Source and Nomad Explo

    Hello Creative Users,
    recently I had to reinstall my operating system on the PC. I have an IBM Thinkpad R30 with a Sitecom USB2.0 pccard. I am running WinXP Pro SP2 with all latest updates.
    I have a Nomad Jukebox Zen Xtra with Firmware .20.08 and an update harddri've of 80GB.
    As long as I was running the software on my previous installation everything worked fine.
    I installed the driver .26.02. This recognized the Jukebox. Musicmatch is able to communicate to the Jukebox and recognizes all files on it.
    When I installed Nomad Explorer I got an error ctregserv failed because ctin...dll is not found.
    When I tried to install Media Source from the original disk it showed an error after 30% Media Source not found. Install Media Source before continuing.
    This is what I received now with all verisons of Media Source and Noamd Explorer incl. .30.0.
    Can someone help me as synchronizing with Musicmatch is a pain.
    Thanks
    Rolf

    Hi everyone,
    as I saw many questions regarding installation problems with Mediasource or Nomad Explorer
    in this forum I will answer my own question right here. I was pointed to the answer by a friend with a similar problem on some other software.
    When trying to install the Creative software under WinXP SP2 I happens that the registration does not work. the reason are missing write attributes to the keys for
    Creative software. To correct that go to: Start, Run and enter regedit. Hit ok and you are in the registration editor.
    Find the Creative location unde HKEYS_SOFTWARE. Click right mouse button and choose
    properties.
    Check full access for your user as well the system user. click on advanced and mark both all the users you want to install from. Check the lower box below the user window sayin something about roghts being propagetd to lower folders etc. Cklick conform and ok, click confirm on previous screen and close regedit.
    Now you should be ok and able to install.
    Regards
    Rolf

  • Strange problem with Transformations Mapping

    Hi All,
    I am facing a strange problem with respect to the data loading to ods from data source.
    I have mapped a field,  Number of days which is the difference between posting date and payment date (field in ECC, length char 5) mapped to characteristic zdate_1 length 5 without alpha conversion. (Date difference is calculated in ECC)
    When I load data in production it is not fetching the records from PSA (Values exist for this  field in PSA).
    I have 90 fields in datasource whichbring data to PSA.
    Same is working perfectly in Quality and Dev servers.
    Where could the problem be?
    Please suggest a solution.
    Regards
    Joga

    Any Ideas...

  • Problem with my Bluetooth resulting in auto rebooting.

    I am having a problem with my bluetooth ever since I bought XPERIA mini st15i. The first time it occured, I took it to the customer care, they solved the problem. The problem did occur again after 2 weeks. So, I again took it to Service. They resolved it again. This problem has occured about 8 times. Ever since I tranfer some files through bluetooth from gallery or file explorer, the phone restatrs again and again. It shows the Xperia logo and then agin, it auto reboots until the battery dies off. I updated the phone yesterday and the problem is occuring today again. My warranty period is over,  so what can I do? In the warranty period, they changed my hardware but still the problem persists.
    I think it's some kind of bluetooth bug. Can it be fixed?

    download Sony Update Service and try this app http://www.sonymobile.com/ru/tools/update-service/ . Its helped me

  • Problem with transformations involving excel source or destination

    I am using SQL server 2008 R2.None of the transformations involving excel source or destination is working fine.What can be done?

    Hi Sapna,
    According to your description, you are
    experiencing the issue that transformations involving excel source or destination is working fine, right?
    It's hard to give you the exactly reason that cause this issue based on the limited information. Here are some articles that use Excel as the source or destination, please refer to the link below.
    http://www.mssqltips.com/sqlservertutorial/211/sql-server-integration-services-ssis-data-flow/
    http://www.sqlshack.com/using-ssis-packages-import-ms-excel-data-database/
    If the issue persists, please provide us more information about your issue, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Linkage and performance problems with "Additional source folders"

    Hello
    There seems to be a some problems when using "additional source folders" in Flash Builder 4.5 and 4.5.1 (links to folders outside a project see pic below). Hopefully I'm doing something wrong and some kind soul could point it out.
    I have a library project which is referenced from a Flex application. When I try to use the tools to go to any of the declarations in the library project from the flex application project, I get a "Code Navigation Error" insetad of seeing the source code in the library project:
    Typeing with code completion turned on is super-duper slow, characters take around half a second to appear.
    What would really help is to know if there's a way to tell Flash Builder how to locate the source files for library swc's, and if there was a way to improve the performance of the text editor.

    Thanks for replying.
    I didn't specifically embed the source. How would one do that? I tried the "-debug" additional compiler option (from here  http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7ad5.html) but I get an error saying "Option -debug cannot be used when compiling in Flash Builder":
    I also did add the common swc into the libraries path using "Add project" in the Flex Application project:
    The linked source folders are in the library project, however I still get the same problem wven when not using linkled source folders so I don't think that is the cause:

  • Problem with Data source- full load is not extracting where as delta can.

    Hi All,
    I have a problem in loading of the region values into BW.
    Data Source 0CRM_OPPT_I is used to fetch opportunities ( same as Sales Orders in ECC) from CRM system.Data source has a field 0CRM_TR which gives the values of region values pof the employee responsible. problem here is that CRM_TR value is not being fetched when the record was first created, but the value is being flown to BW in the delta run i.e. when a change happened in record.
    Please anyone help us out in resolving this issue.
    Regards,
    Haaris.

    Hi Hari.......
    Hav u done init........if yes........What u hav done....I mean.....init with or w/o data transfer.....?
    It has picked records or not? if yes...........after init.........hav u checked the Delta queue(RSA7) in the source system...........is the Total field is 0 or not.........if 0..then....
    Look if u r using Direct delta.then after init.any changes or new records will get recorded in the Delta queue(RSA7) directly..........but if the Update mode is Unserialized V3 update or Qued delta.then data will accumulated in the Update table and the Extraction Queue respectively...........in that case u hav to schedule V3 jobs to pull them in RSA7............otherwise delta load will pick 0 records only........
    Check the update mode of the Datasource in LBWE.......
    Check this..........it may help u........
    Steps to do init load from CRM
    Regards,
    Debjani.......

  • Problem with Transformer

    Hello!
    I have written an XSLT-Transformation-Script that works fine in my XML editor.
    When I transform a XML-file with the javax.xml.transform.Transformer I get a different output.
    All generated Elements, that schould have text and values in it, are empty.
    Here an example of my code:
    <error>
    <name/>
    <id/>
    <element>ref_section</element>
    <parent>model</parent>
    <errormessage>Refenenced section <xsl:value-of select="$ref"/> does not exist.</errormessage>
    </error>
    Example of the resulting XML-file:
    <error>
         <name/>
         <id/>
         <element>ref_section</element>
         <parent>model</parent>
         <errormessage>Refenenced section 4711 does not exist.</errormessage>
    </error>
    The same element generated by the Java-Transform-Class:
    <error>
    <name>
    </name>
    <id>
    </id>
    <element>
    ref_section
    </element>
    <parent>
    model
    </parent>
    <errormessage>
    </errormessage>
    </error>
    Thanx for help.

    Looks like your code is doing a default XSL transformation and not applying your XSL. There must be something wrong with your code.
    Posting your code might lead to a more helpful answer.

  • Performance problem with transformations

    Hi,
    I'm trying to make an animation with a perspective transformation. In each iterationof the loop, two points are altered.
    It works very well, but it is extremely slow. Is there a possibility to speed this up?
    while() {
                  i++;
                   PerspectiveTransform pt = new PerspectiveTransform().getQuadToQuad(
                            10, 10, 200, 0, 0, 190, 200, 200,
                            10-i,  10, 200, 0, 0, 190+1, 200, 200);
                    WarpPerspective wp = new WarpPerspective(pt);
                    RenderedOp rendOp = createWarpImage(bi, wp);
                    RenderedImage renImage = rendOp.createInstance();
                    AffineTransform at = new AffineTransform();
                    at.scale(0.5, 0.5);
                    at.translate(100, 100);
                    g2.drawRenderedImage(renImage, at);
            public RenderedOp createWarpImage(RenderedImage image, Warp warp) {
                ParameterBlock paramBlock = new ParameterBlock();
                paramBlock.addSource(image);
                paramBlock.add(warp);
                return JAI.create("warp", paramBlock);
            }

    Where is the while loop? direct in your paint method? If yes, here is your problem, because your holding the dispatcher thread. What you need is a render loop:
    MyClass implements Runnable
    int maxFPS ...
    public void run() {
    getCurrentMillis()...
    doTheBigTransform....
    EventQueue.invokeLater(new Runnable() { public void run(){ repaint()... } });
    getCurrentMillis() - prevMillis vs time to wait for fps, if > 0
    @override
    public void paintComponent(Graphics c)
    I need more details about your while loop
    Edited by: DeadlyPredator on Mar 16, 2009 8:23 AM

Maybe you are looking for

  • Shadow box not displaying in Captivate 5.0

    I have a client who is working with Captivate 5.0 and when she imports an image into her project the shadow box feature under the properties tab does not show up. Am I missing a setting to where the shadow feature can be turned on? I use Captivate 5.

  • Is it possible to generate PDF with "enable for commenting" from AI?

    I am using Illustrator CS5 and have Acrobat 9 Pro on a Mac. I would like to generate PDF's with "enabled for commenting" feature on. I was able generate a PDF from CS5 -> open it in Acrobat 9 Pro -> enable commenting -> Save as new PDF I prefer to sk

  • Replace keyboard for Macbook Pro

    Hi, I need a new keyboard for my Macbook Pro 15" with back lighting. It works fine, but I dropped my cigarette and it burned the "esc" key. Again the esc key works, but I have to push it hard, so I think I think that I need to replace the keyboard. I

  • Organizing music for iTunes/ipod- help

    Example, I have several Tom Petty songs. However, 3 songs are in one place, 1 song in another place, 7 songs in another place. SO.. when I go to play all my Tom Petty, and I hit the Tom Petty song that is in a separate folder it will auto stop after

  • HT1212 my home button is broken and i dont have find my iphone.. what to do to  restore

    MY home button is broken and my ipod is disabled cuzz i forgot the password how to restore it?