XMLdom - saves only in UTF-8 :-(

Here is a sample, wich generates XML:
declare
p xmlparser.parser;
doc xmldom.DOMDocument;
main_node xmldom.DOMNode;
root_node xmldom.DOMNode;
root_elmt xmldom.DOMElement;
item_node xmldom.DOMNode;
item_elmt xmldom.DOMElement;
item_text xmldom.DOMText;
begin
p := xmlparser.newparser;
doc := xmldom.newDOMDocument;
main_node := xmldom.makeNode(doc);
root_elmt := xmldom.createElement(doc, 'DOCUMENT');
root_node := xmldom.appendChild(main_node, xmldom.makeNode(root_elmt));
item_text := xmldom.createTextNode(doc, 'РУССКИЙ ТЕКСТ (CYRILLIC)');
item_node := xmldom.appendChild(root_node, xmldom.makeNode(item_text));
xmldom.setcharset(doc, 'Windows-1251');
xmldom.setVersion(doc, '1.0');
xmldom.writeToFile(doc , '/u/doc4.xml');
xmldom.freeDocument(doc);
end;
Results:
<?xml version = '1.0'?><DOCUMENT>╨б╨г╨а</DOCUMENT>
Without a suggestion to use given charset. For some reason the package saves always in UTF-8...
How force the package to generate XML in given charset? It's desirable to show encoding directly in <?xml encoding="..."?>

Hi Vlad!
I have the same problem, but I know that parsing a non UTF8 XML works fine.
So here is a workaround.
This works on Oracle8i Enterprise Edition Release 8.1.6.3.0
with XDK_PLSQL_9_2_0_5_0
Regards,
Peter
p := xmlparser.newparser;
--doc := xmldom.newDOMDocument;
xmlparser.parsebuffer(p,'<?xml version="1.0" encoding="Windows-1251"?><DOCUMENT/>');
doc := xmlparser.getdocument(p);
--xmldom.setcharset(doc, 'Windows-1251');
--xmldom.setVersion(doc, '1.0');
main_node := xmldom.makeNode(doc);
--root_elmt := xmldom.createElement(doc, 'proba');
--root_node := xmldom.appendChild(main_node, xmldom.makeNode(root_elmt));
root_node := xmldom.makenode(xmldom.getdocumentelement(doc));
item_text := xmldom.createTextNode(doc, 'YOUR TEXT HERE');
item_node := xmldom.appendChild(root_node, xmldom.makeNode(item_text));
xmldom.writeToFile(doc , '/u/doc4.xml');
xmldom.freeDocument(doc);
end;
-----------------------------------------------------

Similar Messages

  • How can I save ONLY the bookmarks and extensions

    I am about to do a clean reinstall of Firefox. I want to save ONLY the Bookmarks and Extensions and NOTHING ELSE from the Firefox Profile. How can I do this please?
    Thank you,

    Both answers combined to help solve the problem. It would be good if more than one answer can be selected as "Chosen Solutions", because this situation occurs often in forums.
    Thank you to both of you!
    Kind regards.

  • How do I save only part of a PDF file?

    I have a PDF of a book layout, which is 176 pages. It's one big file. How can I save only selected pages as a separate PDF?
    Thanks
    David Heim

    Document>Extract pages but only if you have Adobe Acrobat (you haven't mentioned that as of yet) and only if there is no security preventing modifications and such.

  • [svn:fx-trunk] 7661: Change from charset=iso-8859-1" to charset=utf-8" and save file with utf-8 encoding.

    Revision: 7661
    Author:   [email protected]
    Date:     2009-06-08 17:50:12 -0700 (Mon, 08 Jun 2009)
    Log Message:
    Change from charset=iso-8859-1" to charset=utf-8" and save file with utf-8 encoding.
    QA Notes:
    Doc Notes:
    Bugs: SDK-21636
    Reviewers: Corey
    Ticket Links:
        http://bugs.adobe.com/jira/browse/iso-8859
        http://bugs.adobe.com/jira/browse/utf-8
        http://bugs.adobe.com/jira/browse/utf-8
        http://bugs.adobe.com/jira/browse/SDK-21636
    Modified Paths:
        flex/sdk/trunk/templates/swfobject/index.template.html

    same problem here with wl8.1
    have you sold it and if yes, how?
    thanks

  • Save only active artboard as PDF

    Hi all,
    I have a CS4 .ai file with about 90 artboards.  I would like to be able to save only the current artboard and related layers and artwork as a uniquely named PDF.  So far I have only been able to save a PDF with all artboards enumerated as different files, save the current artboard as an .eps but neither fit my need.  It would be great if I could get some help on the appropriate applescript to perform this task as well.
    Thanks!
    Tom

    I do understand that when you do a 'Save as' and select PDF that it auto-checks and disables the 'Use Artboards' box and then allows you to save all or a range of artboards.  However, since I am trying to build this into a script I was hoping for a way to save just the active artboard without having to know the artboard number.  In contrast is there a way that I can do the following in a applescript:
    - fetch the number of the current artboard
    - save as pdf with a range of 'insert that number here'
    thanks!
    tom

  • Save only authentication cookies and preferences in profile

    Is there a way to save only authentication cookies and browser/addon preferences by the end of a session?

    To help other users find solutions, please return to this Thread and '''Sign-in''' to the
    forum with your Username and Password:
    click on '''"Solved It"''' Next to the reply ABOVE that '''BEST''' solved your Question
    '''DO NOT click "Solved It" next to this reply

  • TimeMachine to save ONLY the current version of Apps? Not the older ones...

    Hi everyone!
    I update my apps a lot, or I modify them (XSlimmer, Trimmit, Monolingual, etc...)...
    Therefore, I have TimeMachine that saves me all the old (and heavy) versions of all my apps.
    Ho can I get TimeMachine to save only the current (last) version of the apps stored on my internal HD?
    Thank you!

    No no no!
    I ment, I have the lastest versions of my apps on my internal HD, but TimeMachine (on an external HD, obviously) saves ALL the versions of them (the older and bulkier ones too, which take space for nothing)...
    I'd like to know if I can tell TimeMachine to save only the latest versions of the apps (and not the older ones...)
    Thanks

  • Save only the bounding box region of image as png?

    Hi,
    I'd like to save each layer's item as png.
    If possible, i'd like save only the bounding box of image(of an item), and the corresponding bounding box's origin/size info(relative to artboard's origin) somewhere as text file.
    To do this,
    I need to be able to get a bounding box of an item.
    and possibly artboard's origin. (because I'm not sure where a bounding box's coordinate's origin is).
    Thank you in advance

    If I understand you correctly you have one table with a bunch of yes/no values (SA, SC, SS, etc.).  Then for each record in that table you want to output a string listing all the fields from the first table which = yes (i.e are checked).  Perhaps
    the following code would get you started:
    Sub JimNeal()
        Dim strProcedure_Value As String
        Dim rst As DAO.Recordset
        Dim rstOut As DAO.Recordset
        Set rst = DBEngine(0)(0).OpenRecordset("TableWithCheckboxes")
        Set rstOut = DBEngine(0)(0).OpenRecordset("OutputTable")
        Do Until rst.EOF
            strProcedure_Value = ""
            If rst!SA Then strProcedure_Value = strProcedure_Value & "Surface Area,"
            If rst!SC Then strProcedure_Value = strProcedure_Value & "Surface Contour,"
            '... etc
            If rst!SS Then strProcedure_Value = strProcedure_Value & "Steep Slope,"
            rst.MoveNext
            ' Strip off final comma
            If Len(strProcedure_Value) > 0 Then strProcedure_Value = Left(strProcedure_Value, Len(strProcedure_Value) - 1)
            ' Output the string to your output table
            rstOut.AddNew
            rstOut!Procedure_Value = strProcedure_Value
            rstOut.Update
        Loop
        rst.Close
        rstOut.Close
        Set rst = Nothing
        Set rstOut = Nothing
    End Sub
    -Bruce

  • Save Only The Artboard area into AI file

    Hi,
    Is it possible to save only the ARTBoard Area into a new AI document by using JSX.
    for example in the above image I want only the yellow marked drawing ,that is inside the artboard area, to be save in the new document [AI file] by using JSX.
    Thanks

    What you see in the document is what you will see when you save it.
    I recommend saving as a psd then if you really want to you can merge the layer or flatten (merge will leave the background transparent whereas flatten will give you a white backgound if there are any transparent areas in the document)
    (ctrl-e or ctrl-shift-e {windows} cmd-e or cmd-shift-e {Mac})
    Or you can leave the layers alone and create a composite (A new merge layer on top of the other layers)
    (ctrl-shift-alt-e {windows} cmd-shift-opt-e {mac})
    That said not all formats support layers or transparency. An example of that is jpg when you save with that format you will get a single flattened layer that will have a white background anyplace there was transparency.
    To recap:
    1)Always work on a duplicate file when doing destructive work so you can return later and undo what you did.
    2)When ever possible use non-destructive edits such as a composite layer.
    3)If you require layers or transparency it is required that you use a format that supports them like tiff or psd
    4)Use jpg as a file for sharing and never as the master file. Because the format is destructive and throws out data each time you open and save it.

  • Can't save file in UTF-8 encoding

    Hi,
    I've read everything I can find on this subject, from these forums to Google to newsgroups. Still no success.
    I am simply trying to save a file in UTF-8 format.
    This code depicts the methods I'm using:
    File file = new File("myFile");
    FileOutputStream fos = new FileOutputStream(file);
    OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");
    System.out.println("Encoding is " + osw.getEncoding());
    osw.write(myStringBuffer.toString());
    When this code is run, this is printed:
    Encoding is UTF8
    However, when I check the output file itself, it is ANSI 1252. I've tried compiling and running in both 1.4.2 and 1.5.0. Same results.
    Thanks for your help...

    I have checked it with two separate tools.
    1. I have opened up the file in TextPad and viewed the file properties. TextPad reports this: "code set: ANSI"
    2. I have a command-line utility that is bundled with a 3rd party application (commercial search engine). The command-line utility reports the character set and the language of a text file. The command-line utility reports this: "CHARSET: 1252"
    Is there something else to try?

  • How do I save only the VISIBLE objects in AI to Pdf or jpeg.

    I have multiple layers but only want to save the currently visible elements objects out in a PDF or JPEG,
    how do I do this without having to tediously double click each layer and choose "do not print" (layer).
    would be nice to have a preference in prefs to "not print hidden layers".

    You can choose to have your non-visable Illustrator layers preserved but invisible in your PDF, or removed completely. To remove them, select Acrobat 5 compatibility or earlier, or deselect the preserve layers option. If you include your invisible layers there is a possibility they will re-appear in some PDF viewers.
    http://forums.adobe.com/message/4964425#4964425

  • How do I save only an outline so I can layer ONLY black and white outlines?

    I am drawing cartoon outlines and then layer them in Photoshop Elements and color then in.  I want to save the file of each individual outline as ONLY the outline, not the outline and background.  Using the magnetic lasso to cut out the outline is very hard because it is complex.  I would rather just be able to save the outline with no background and I can then layer them.  Can anyone tell me if this is possible and what type of file do I use? TIFF? 

    Try making your drawing on a transparent layer. From Expert Mode choose:
    File >> New >> Blank File
    Set your document size (width & height) and choose a resolution of 72. Set background to white and click OK.
    Go to the menu and choose:
    Layer >> New >> Layer >> OK
    Now draw your cartoon on layer 1.
    When finished, highlight the background layer below layer 1 and click the trash can icon at the top of the layers pallet. Click OK to delete the layer.
    To save your drawing go to:
    File >> Save For Web
    From the dropdown list (near top right) choose PNG 24 which will preserve the transparency. Then click Save. Choose a file name & folder and click Save.
    You can now upload your drawing to any web page or send by email etc and the background page color will show through the transparency. Or it is ready to be colored in

  • Bookmarks save only in 'recently bookmarked' folder & can not be moved to other folders

    I can no longer save bookmarks to a designated folder - they go only to 'recently bookmarked' folder and can not to moved to other folders- when attempting to move them to another folder, they appear in the designated folder list but when I return to the main browser page, they are not listed. They are still in the 'recently bookmarked folder' only. I have attempted to save bookmarks many times since, with no success.

    Those bookmarks should be located in one of the root folders.
    If you click the star in the location bar then the page will be bookmarked in the "Unsorted Bookmarks" folder and the star turns yellow (blue on Mac) to show that.<br />
    If you use "Bookmarks > Bookmark This Page" then the bookmark will go to the "Bookmarks Menu" folder (you need to confirm that).
    "Most Visited" and "Recently Bookmarked" and "Recent Tags" are examples of so called [[Smart Bookmarks folders|Smart Bookmarks folders]] and are not real existing folders.
    * Such smart folders show a list created by a query of the places.sqlite database that stores the bookmarks and the history in Firefox.
    * Bookmarks or history items that show up in a smart folder list are stored elsewhere in another folder and any changes made are applied to the real bookmark or history item.

  • IMac Freezes Periodically During Screen Saver Only

    I own a late-2006 Intel-based iMac. Over the last few months, I've noticed that the iMac freezes when the screen saver is running. This doesn't happen all the time, and it doesn't matter what screen saver I use. (None of the screen savers is a third-party.) The iMac doesn't freeze at any other time.
    Any ideas?
    - Keith
    P.S. I'm running Snow Leopard right now, and it happens even with Snow Leopard, just as it did with plain ol' Leopard.

    Your iMac has a dedicated Graphic's chip (GPU), while some of the Late 2006 17" iMacs had a GMA 950 graphics processor with 64MB of DDR2 SDRAM that shared with the main memory. To check which Graphic's chip you have go to: Apple > About This Mac > More Info and in the Hardware section select Graphics/Display.
    If you would like to monitor the temperature of your GPU, CPU, HD and Memory check out the iStat Pro widget > http://www.islayer.com/apps/istatpro/
    The main reason I suspect the lack of RAM over an overheating GPU is because you only reported a problem with the Screen Saver and not with other intense graphic's like movies, videos or games.
    Please let us know how you make out with the RAM upgrade.
    Dennis

  • Saving report in Report Builder 10.1.2. saves only half of file

    Hi,
    I have problems with saving files in Report Builder 10.1.2. After saving a rdf-file it shows only half the size of the original file.
    When closing the report in Builder and opening it again it won't open. Also the temp-file is half the size of the original rdf-file during saving.
    Can someone help me to solve this? Auto-save in Preferences is turned off. Have tried to open and save files on the network and on the local pc.

    Hi,
    Did you used OUTER join?? if you have any suitable Outer join according to my understanding query should return Assignment data but with NULL value, then you can replace as you need it in Reports.
    Regards,
    Syed

Maybe you are looking for

  • Extend customer to multiple company codes and mutliple sales organisations

    Hi, Customers with only general info. are getting created from CRM system to SAP ECC. Now we extend the same customer to differnt company codes and different sales organisations. When I checked the BADI, CUSTOMER ADDDATA, in this S_KNA1, S_KNB1, S_KN

  • How to create an image slideshow?

    Hello, I am a beginner in web design and I need your help somewhere. Please look at the follwoing website: www.safaribig5.com Considering the image slideshow at the top of the home page, how do I add it to a webpage that I'm currently desiging in Dre

  • Trying to download and install Photoshop

    I previously had a free trial. I decided to buy the monthly photoshop. I uninstalled the original photoshop because it kept saying my trial was expired. i tried to download it again after the uninstall and it won't download, just takes me the to the

  • Vista 64 BIT, BB Storm Synch

    I have a storm and use Vista 64 Bit, I can not send Outlook calendar appointments to the BB, and when I try to synch I get an error that says windows has detected a problem and has ended the program. Does anyone know of a solution, Thank you.

  • Weblogic 12.1.1 increases threads with 'Retry rollback request for tx:' How to fix ?

    Hello, Weblogic 12.1.1 increases threads with 'Retry rollback request for tx:'  And in all threads Xid is identical For this reason, the server begins to work very slowly and ultimately it is necessary to restart. The problem is similar to the Doc ID