IF_IXML : How can i add encoding with value UTF-8 to the document object??

Hi
i want to create a xml file with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://...."> 
</OpenSearchDescription>
i did this with the if_ixml interface and rendered the content in a file 'D:\usr\sap\IFD\DVEBMGS01\log\TEST_out.xml
<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://...."> 
</OpenSearchDescription>
BUT the document attribut(?) encoding="UTF-8"?> is missing!
How can i add encoding with value UTF-8 to the document object?? it should look like:
<?xml version="1.0" encoding="UTF-8"?>
*here is my coding.
TYPE-POOLS: ixml.
CLASS cl_ixml DEFINITION LOAD.
DATA: lo_ixml           TYPE REF TO if_ixml,
      lo_streamfactory  TYPE REF TO if_ixml_stream_factory,
      lo_document       TYPE REF TO if_ixml_document,
      lo_parent         TYPE REF TO if_ixml_element,
      lo_ostream        TYPE REF TO if_ixml_ostream,
      lo_renderer       TYPE REF TO if_ixml_renderer,
     lv_rc           TYPE i.
lo_ixml = cl_ixml=>create( ).
lo_streamfactory = lo_ixml->create_stream_factory( ).
lo_document = lo_ixml->create_document( ).
lo_parent = lo_document->create_simple_element( name   = 'OpenSearchDescription'  "root node
                                                parent = lo_document ).
lo_parent->set_attribute_ns( name   =  'xmlns'
                             value  = 'http://....' ).
*rausrendern in file
lo_ostream = lo_streamfactory->create_ostream_uri( system_id = 'D:\usr\sap\IFD\DVEBMGS01\log\TEST_out.xml' ).
lo_renderer = lo_ixml->create_renderer( ostream  = lo_ostream
                                        document = lo_document ).
lv_rc = lo_renderer->render( ).
Thanks for help
Britta

Use the following code:
set an document encoding
  l_encoding = l_ixml->create_encoding( character_set = 'UTF-8'
                                        byte_order = if_ixml_encoding=>co_none ).
  l_success  = l_ostream->set_encoding( encoding = l_encoding ).
create a xml renderer
  l_renderer = l_ixml->create_renderer( document = l_doc ostream  = l_ostream ).

Similar Messages

  • How can I add a blank value in a standard drop down list

    Hello,
    I have a requirement to add a blank value into the standard drop down list of for i.e. the search criteria
    "created on" -> (values are: yesterday/today/last week etc).
    The problem is, that this field has always the default value "yesterday" but our customer wants to have a blank field as default.
    Can anybody provide me steps how can I add this blank value ?
    Many thanks in advance

    Hi Bernard,
    thanks for your reply.
    Its for quotation.
    Could you give me still some further detail steps, please ?
    Many thanks
    Andreas

  • How can I add "Edit with Photoshop CS5" to the Edit With options?

    How can I add "Edit with Photoshop CS5" to the Edit With options?

    I think it has something to do with the order in which the PSE and PS are installed on your machine.
    For me, I can see option for editing in photoshop both in edit menu and from the action bar. I probably had Photoshop installed on my system before PSE

  • How can I add photos to a video without interrupting the sound of the original video?

    In PE11, How can I add photos to a video without interrupting the sound of the original video?

    RLHeflin
    Thanks for getting your details posted. Good job.
    You further explained
    I am simply wanting to “overlay” a new visual element without disturbing the underlying audio.
    A classical way to do a Premiere Elements Overlay is to hold down the Ctrl key of the computer main keyboard and drag the new clip over the area of the one you want to replace on the Timeline. That should not do anything but replace one portion of the video on the Timeline. No change in duration video or audio track if you are dealing with video linked to audio.
    If you hold down the Alt key of the computer main keyboard, I am envising a scenario where you want to add to (not replace) some Timeline content.
    A just in case note, if you have video on Video 1 and 2 and the video in 2 does not have transparent areas in it, then all you will see is the Video 2 content. I believe that Hunt eluded to that concept as a possible technique for what you might be doing.
    Another just in case, if you have not seen the following Adobe documentation on arranging clips, you might be interested in the following link
    http://help.adobe.com/en_US/premiereelements/using/WS9B8F8208-EAE8-4b49-A79B-9479B46A8981. html
    Please update us on your progress when you get a chance.
    Thank you.
    ATR

  • How can you add a 2nd i Tunes account on the same computer?

    How can you add a 2nd i Tunes account to the same computer?

    I had an application where I spawned (= ran with Start Asynchronous Call) multiple (reentrant) copies of VIs, and would occasionally "lose control" of them.  I needed a way to find all VIs that were running "Top Level" and stop them (so I didn't have to log off from Windows).
    I used the Application Property "All VIs in Memory" to get an array of (wait for it ...) All VIs in Memory.  I took each name, opened a VI reference to it (simply wire the name string in, as the VI is, by definition, "in memory"), looked at its VI Execution State, and if it was Run Top Level, Invoked the FP.Close and Abort VI Methods.  [To prevent the VI that did all this from "committing Suicide", I compared the name string with the current Call Chain, and did nothing if there was a match].
    I think you could adopt this idea to do what you need.
    BS

  • How can I add/change art work to albums where the art work isn't available at iTunes?

    How can I add/change art work to albums where the art work isn't available at iTunes?

    Go to google and search for the artwork.  When you find it, save it to your computer.  Right click the album and select get info.  Drag the image you saved to the empty box for album art.

  • How can I add a fade or other transitions to the pages of my website?

    How can I add a fade or other transitions to the pages of my website?

    like this :
    http://www.onextrapixel.com/2010/02/23/how-to-use-jquery-to-make-slick-page-transitions/
    Cheer up !

  • How can I add sites to my 'Reading List' from the desktop version?

    Kindle has this add-on to Firefox desktop version called 'Send to Kindle', where I simply hit Ctrl+K and then I would have the current webpage stored on my Kindle. Very handy when I am commuting to work without connectivity.
    How can I achieve this with my tablet and Firefox for Android's Reading List feature?

    We don't have this feature at the moment. We may add it as part of the New Sync that we are working on.

  • How can I add form field value to the file name in save as dialog box

    I do not want the form to be saved automatically, just want the form to auto populate the "file name" only.
    A little background on the forms I want to use:  My company has 70 retail outlets, I'll use one of our pdf forms called an "Incident Report" as an example.  I would like for a store manager to be able to complete the form, then email the form to the main office (I already have javascript to add field values and form name to the email subject line), once the main office receives it, I want for them to be able to file the pdf electronically on our server.  We have mutliple forms that we use so I do not want any of the forms to automatically save anywhere, (at this time anyway) I just want the office personnel to be able to click "save as" (or whatever they will need to click) and the form automatically add certain field values from the pdf they have received, of which will be different each time the form is sent to the office (Date, store #, employee name etc.) in addition to the name of the form in the "File name" of the "Save As" dialog box.  The main office employees will decide into which server file the pdf should be saved.
    I'm using Acrobat 8 professional, the stores and office personnel use Adobe reader.
    One little note:  We currently print and file a lot of paper on a daily bases, as soon as I can get this to work, we are going green.
    Me and a lot of trees in this will really apprecitate any help you can give with this!  :-)

    You might want to take a look at the document "Developing Acrobat Applications Using JavaScript" (js_developer_guide.pdf) which is part of the Adobe Acrobat SDK, which can be downloaded here. Read the "Privileged versus non-privileged context" (p. 45ff.). You will find an example for "Executing privileged methods in a non-privileged context". Should be almost exactly what you are looking for.
    Small Outline: For security reasons ("the user always has to know what's going on") you are not allowed to use the "Doc.saveAs"-method without the user permission (--> in a non-privileged context). In order to reach the goal of a privileged context you can use a trusted function. You do this by creating a JavaScript file (*.js) in either the Application-JavaScript-Folder (default location on Windows systems: "%ProgramFiles%\Adobe\Acrobat 10.0\Acrobat\Javascripts") or the User-JavaScript-Folder (default location on Windows systems: "%AppData%\Adobe\Acrobat\10.0\JavaScripts"). Add the following content to the new file:
    myTrustedBrowseForDoc = app.trustedFunction( function ( oArgs ) {
         app.beginPriv();
              var myTrustedRetn = app.browseForDoc( oArgs );
         app.endPriv();
         return myTrustedRetn;
    myTrustedSaveAs = app.trustedFunction( function ( doc, oArgs ) {
         app.beginPriv();
              var myTrustedRetn = doc.saveAs( oArgs );
         app.endPriv();
         return myTrustedRetn;
    The developer guide actually wants you to add this content to the existing "config.js" file. I recommend creating a new file, since its easier to deploy in a network. Either way, every client/user who needs to be able to save documents this way, needs this JavaScript Code in his Application/User-JavaScript-Folder.
    Within the Acrobat Document, which you want to obtain a certain file name, you can now use the trusted functions "myTrustedBrowseForDoc" and "myTrustedSaveAs" to store the file. To call the trusted functions and deliver the file name you can either you use a form field (button) or you add a new menu item. Add the following JavaScript Action to the button/menu item and change "Roller Coaster" to the name of the field which contains the value which you want to become the new file name:
    var fileName = this.getField("Roller Coaster").valueAsString;
    try {
         var oRetn = myTrustedBrowseForDoc({bSave: true, cFilenameInit: fileName + ".pdf"});
         try {
              myTrustedSaveAs(this, { cPath: oRetn.cPath, cFS:oRetn.cFS });
         catch(e) {
              console.println("Save not allowed, perhaps readonly.");
    catch(e) {
    console.println("User cancelled Save As dialog box");
    Good Luck!

  • How can I add a True value to position (0,1) in a 2*2 boolean array?

    Hi everyone, let's say I have a 2*2 boolean array (Indicator), how can I let the element in position (0,1) for example be true??
    Thanks.
    T. A.
    Solved!
    Go to Solution.

    Hi T.A.,
    1) ReplaceArraySubset with indices 0&1 and element=TRUE.
    2) OR Array with an array constant of [(F,T),(F,F)]
    Message Edited by GerdW on 11-23-2009 03:22 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How can i read every"number" value and not only the 1st?

    in the vi only the first "number" value(from the data acquisition)is read in the small loop.how can i make every value to be read?every value must be compared with the "numeric" constant,and,if greater the led must turn on.afterwards,when a value which is less than the "numeric" is found the led must turn off.please answer or send mail to [email protected]
    Attachments:
    oximet5.vi ‏152 KB

    The more I look at your program, the less I understand it.
    Why are you setting number = number in a case if SO2 = ""? number always equals number.
    In your sequence frames 1 and 4, you have no control over which write (date or time) happens first. Just placing one function to the left of another doesn't make it happen first if your wiring doesn't create data dependency. Review the section on Data Dependency in chapter 5 of the LabView User's Manual.
    It looks you're writing to and reading from the same file using Write File and Read Lines from File.vi. Why read back data you just wrote? You have the data on your diagram. If you want to convert it from string to numeric, use a Sring/Number Conversion function from the String palette.
    On Read Lines from File.vi (which I'm not sure you even need), you should use a shift register for the start of read offset rather than a local variable for mark after read (chars.). With a shift register, you can initialize it to 0 when the VI starts. Using a local, if you restart the VI, it will try to startup from where you left off the last time, but you just opened the file for create or replace.
    In your sequence frames 2 and 3, why do you wait for the number to be less than the numeric before writing a carriage return to the file? Also, LabView has a End of Line constant which adapts to the expected value for the operating system. That's generally more flexible than a Carriage Return.
    It looks to me like you're overusing control refnums. You don't need to use a control refnum and a property node to set or read a control's value if you can wire directly to the control's terminal.
    I really don't understand what you're doing with pause and variants. I may be missing the point, but it looks like you made this much more complicated than it needs to be. Why not keep it a boolean?
    For your pause-path, you open the file but never close it. You can lose data that way. You also open it using open function 3, create new file. You'll get an error if the file already exists.
    On a general note, your diagram would be easier to read if you were more selective in how you routed your wires: you have wires on top of wires, wires running under sub-VIs, wires running in the frame of a while loop, wires running under labels.
    I think there's a temptation to overuse sequences. I don't think you need one here. As I mentioned in my earlier message, case structures and shift registers will be more useful to you.

  • How can I record narration with no video or beyond the end of my video in iMovie?

    I have a question about recording narration in iMovie.
    I wrote a script to read as the narration for a movie I'm making. My thought was I could record the narration first, then add video to match the spoken words.
    I've done this before in Sony Vegas on my PC and it worked out well, better than trying to speak to what was going on in the video after I record the video.
    Unfortunately, if I try to record narration in iMovie without any video being there yet, it won't record. It appears I need to put a video clip on the timeline first.
    If I put a short clip in and try to record narration beyond the end of it, iMovie quits recording at the end of the video clip.
    So I went to quicktime and recorded my narration there and have 10 audio files (since I just don't seem to be able to read this whole script without making mistakes).
    I then tried to add all 10 to my movie and I think it made me add a video clip first, but after I did, iMovie overlayed all 10 audio files on top of each other.
    If I try to drag them over one at a time, I still can't get them to go sequentially unless I add more video to my movie.
    There must be a way to add audio files or create narration without having to create a video file longer than your audio first.  Isn't there?
    I just can't seem to find a way to get the audio files layed out one after another without more video.  Very frustrating.
    At this point, I really want to know how to add audio files beyond the end of my video since I have them all recorded.
    But I'd also like to know how to record narration beyond the end of the video too for future projects.
    Thanks!
    Brad

    You could insert a bunch of placeholders in the timeline before doing the voiceover.
    You can find a range of placeholders (they are actually templates used in iMovie Trailers) in the Maps, Backgrounds & Animatics browser. This is the last browser at the end of the centre toolbar, after the Titles and Transitions browsers. Click on it and scroll down to see all the animatics (aka placholders or templates). Drag a number of these into your project timeline - as many as you think you need to cover your audio.
    When you've finished the voiceover, drag photos directly onto the animatics and select Replace from the pop-up menu. Adjust the timing by using the Inspector (double-click a photo to open the Inspector, then change the duration).
    John
    EDIT: Sorry, beaten by Bengt (again)!
    Message was edited by: John Cogdell

  • How Can I do it with to different ipod on the same computer ?

    I have and ipod(1GB) and my daughter has another ipod(4GB), how can we work with the same computer and itune for 2 different ipods ?
    iPod(1GB) and a second iPod(4GB)   Windows XP   2 different iPods on the same computer

    this document might be of some help with that:
    How to use multiple iPods with one computer
    if you decide on a multiple-user-account strategy, this document might also be useful:
    iTunes: How to share music between different accounts on a single computer

  • How can I add an audio media file to my Pages document

    I have created a Pages document on my iPad.  I can add photos but not audio (there is only a Photos option)  So I emailed the document to my desktop and went onto iCloud via Safari.  Now i don't see the Media icon (I am in Pages beta if this is relevant).  Any suggestions?

    I knew about the comment possibility, but as you have said...users would need instruction.  This is intended for a controlled environment where I know that everyone will have a device with a microphone.  However, the users of the form would have very little experience as this is meant for patients.

  • How can I add more options of alternate languages to the "Spec Name" translations?

    The options should appear on a GSM specification when I click on the little globe besides Spec Name, ShortName, Description, and other fields. But I cannot find where to configure that list of languages so that I can add the ones I need for proactive translations.

    You can definitely add more languages.   
    1. Check out the configuration guide: Multi-Language Support for Proactive Translations section.   It will tell you how to activate them in the database. 
    2. Once activated, you will need to assign them to the users that can add translations.  You do this in UGM on the user profile.
    3.  Once languages have been added to the user, the user will see the language options in the proactive language popup.   
    Hope this helps.  Let me know if you have any further questions.
    Kelly
    Just as a reference, in addition to our National Language Support packs we support the following languages for proactive translations:
    Spanish
    Portuguese
    Italian
    German
    Dutch
    Polish
    SpanishMexico
    SpanishCostaRica
    SpanishVenezuela
    Japanese
    Indonesian
    Thai
    Russian
    Finish
    FrenchBelgium
    DutchBelgium
    Danish
    Swedish
    Norwegian
    Czech
    Slovak
    GermanGermany
    GermanSwitzerland
    GermanAustria
    Catalan

Maybe you are looking for

  • How to create an ASD bootable partition

    Can someone tell me how I can create an ASD boot partition. In my ACMT class we had a USB drive with multiple partitions each being an ASD bootable partition.  I have a drive broken up into 16 partitions and would like to have each one a boot ASD. On

  • BUG IN CS4 API

    Just wanted to let everyone know. The StandardGetDirectoryDialog function in the sADMBasic suite does not function correctly. Adobe confirmed this to me when I filed a help request with them. Right now it just gives you back "parent-of-directory-you-

  • Unable to perform Bluetooth operation

    when I try to switch on my bluetooth module . it says that unable to perform th bluetooth operation. Please help I tried resetting the phone it didn't worked. please provide me a solution for the problem I am facing I am totally **bleep** off by givi

  • To disply month on selection screen

    Hi all,         i'm modifying one report which contains date field on selection screen i need to replace date field by month field( jan, feb..) , how to do this. Is there any function modules available Regards Suprith

  • IPhone 3G not Syncing with Outlook Calendar 2007

    Can anyone help, since updating iTunes to version 8.1.0.52 my iPhone will not sync with Outlook Calendar 2007. I have deleted itunes and re-installed as per Apples instructions and this has no effect. Everything was fine up to the point of updating i