Have XML data in a string, can't extract it to the XML bean class

Hi All, I have a string that contains XML data, for example,
string str has "<one>1<\one><two>2<\two>". i have the XML beans classes,
but i am unable to get this data out of the string and add it to the xml bean
classes.
I anybody has a clue as to how to code this, please help ASAP.
Thanks,
kuneev

Hi Kunnev,
Lets say I have an xsd
<?xml version="1.0"?>
<xs:schema
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     xmlns:bea="http://www.bea.com/xmlbeans/Sample.xsd"
     targetNamespace="http://www.bea.com/xmlbeans/Sample.xsd"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified">
<xs:element name="Person">
<xs:complexType>
<xs:sequence>
<xs:element name="FirstName" type="xs:string" />
<xs:element name="LastName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Now after I compile this I would get XMLBean classes
Like Person is a xmlBean class. The code snippet below shows how I can convert
a string into a xmlbean of type Person.
XmlOptions xopt = new XmlOptions();
xopt.setDocumentType(Person.type);
Person x0 = (Person) XmlObject.Factory.parse(
"<xml-fragment>" +
"<FirstName>desc---1</FirstName>" +
"<LastName>desc---2</LastName>" +
"</xml-fragment>", xopt);
Person pp = (Person)x0;
Now pp is a XMLBean object which can be added to the tree.
Let me know if you have any questions.
Thanks a lot,
Vimala
"kuneev" <[email protected]> wrote:
>
Hi All, I have a string that contains XML data, for example,
string str has "<one>1<\one><two>2<\two>". i have the XML beans classes,
but i am unable to get this data out of the string and add it to the
xml bean
classes.
I anybody has a clue as to how to code this, please help ASAP.
Thanks,
kuneev

Similar Messages

  • Converting hexadecimal XML data to a string

    Hello!
    Until now I generated XML data with the FM 'SDIXML_DOM_TO_XML'.
    After that I did a loop over the xml_as_table in which I was casting each line of that table to a string.
    ASSIGN <line> TO <line_c> CASTING.
    After the inftroduction of unicode in our system I get a error:
    In the current program an error occured when setting the field symbol <LINE_C> with ASSIGN or ASSIGNING (maybe in combination with the CASTING addition).
    When converting the base entry of the field symbol <LINE_C> (number in base table: 32776), it was found that the target type requests a memory alignment of 2
    What does it mean? Does somebody have a solution.
    I need this function for sending this XML data as string over a simple old CPIC connection.
    Best regards
    Martin

    Hello Martin
    Perhaps my sample report ZUS_SDN_XML_XSTRING_TO_STRING provides a solution for your problem.
    *& Report  ZUS_SDN_XML_XSTRING_TO_STRING
    *& Thread: Converting hexadecimal XML data to a string
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1029652"></a>
    REPORT  zus_sdn_xml_xstring_to_string.
    *-- data
    *-- read the XML document from the frontend machine
    TYPES: BEGIN OF xml_line,
            data(256) TYPE x,
          END OF xml_line.
    DATA: xml_table TYPE TABLE OF xml_line.
    DATA: go_xml_doc       TYPE REF TO cl_xml_document,
          gd_xml_string    TYPE string,
          gd_rc            TYPE i.
    PARAMETERS:
      p_file  TYPE localfile  DEFAULT 'C:payload_idoc.xml'.
    START-OF-SELECTION.
      CREATE OBJECT go_xml_doc.
      " Load XML file from PC and get XML itab
      CALL METHOD go_xml_doc->import_from_file
        EXPORTING
          filename = p_file
        RECEIVING
          retcode  = gd_rc.
      CALL METHOD go_xml_doc->get_as_table
        IMPORTING
          table   = xml_table
    *      size    =
    *      retcode =
    " NOTE: simulate creation of XML itab
      go_xml_doc->display( ).
      create object go_xml_doc.
      CALL METHOD go_xml_doc->parse_table
        EXPORTING
          table   = xml_table
    *      size    = 0
        receiving
          retcode = gd_rc.
      CALL METHOD go_xml_doc->render_2_string
    *    EXPORTING
    *      pretty_print = 'X'
        IMPORTING
          retcode      = gd_rc
          stream       = gd_xml_string
    *      size         =
      write: / gd_xml_string.
    END-OF-SELECTION.
    Regards
      Uwe

  • How to generate XML data from Lotus Notes to migrate to SharePoint by passing XML to SharePoint.?

    How to generate XML data from Lotus Notes to migrate to SharePoint by passing XML to SharePoint.?
    Ramesh S

    You could use XMLQuery to return the data from your tables as XML, that would give you a CLOB.
    An example using the SCOTT schema might be like this:
    SELECT XMLQuery(
             'for $i in ora:view("DEPT")/ROW
              return <Department dname="{$i/DNAME}">
                     <Employee>
                       {for $j in ora:view("EMP")/ROW
                        where $j/DEPTNO eq $i/DEPTNO
                        return ($j/ENAME, $j/JOB, $j/SAL)}
                     </Employee>
                     </Department>'
             RETURNING CONTENT) FROM DUAL;In the docs you can find more information about its use:
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb_xquery.htm

  • I have a ipod touch and I can't put anything on the events there is no   in the right corner Like my sons

    I have an ipod touch and I can't put anything on the events there is no + sign in the corner like my sons ipod.

    I'm guessing you are referencing the Calendar app.
    Try resetting:
    Hold the home and power buttons at the same time until the Apple boot logo appears. No data will be lost.

  • Hi! I have an iPhone 4S with iOS 6.1.3 and I have iTunes 11.1.3.8. on my Windows 8. Now I can't sync my iPhone, because the device is not recognised by iTunes. Somebody have any idea why, or what can I do (except refresh the iPhone software) ?

    Hi! I have an iPhone 4S with iOS 6.1.3 and I have iTunes 11.1.3.8. on my Windows 8. Now I can't sync my iPhone, because the device is not recognised by iTunes. Somebody have any idea why, or what can I do (except refresh the iPhone software) ?

    Hi Drazse,
    Thanks for visiting Apple Support Communities.
    If your iPhone is not recognized by iTunes for Windows, the troubleshooting steps in this article may help:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Cheers,
    Jeremy

  • My phone was stolen, but I had no data left and so can't locate it till the person who has it tries to use the internet. I backed up all my photos on iCloud, and want to get them on my PC. I installed iCloud onto the PC and still can't find my pictures?

    My phone was stolen, but I had no data left and so can't locate it till the person who has it tries to use the internet. I backed up all my photos on iCloud, and want to get them on my PC. I installed iCloud onto the PC and  followed the instructions and still can't find my pictures, says my photostream folder is empty, but it shows on iCloud that i've used most of my storage which is true, so they must be there somewhere?
    Any ideas? I'd really appreciate the help! Thanks

    Yes, I filed police report, but there is nothing they can do until I get back to them on the tracking. It's been offline. I'm sure the whoever took it can find a way around breaking in the ipad..i really was hoping to get my pictures and videos of my kids back

  • In Aperture 3, how can I easily move entire projects out of my main Ap Library into other libraries?  My Ap library is running super slow because it's overloaded l so I have created two new libraries, but can't seem to move the projects into them

    In Aperture 3, how can I easily move entire projects out of my main Ap Library into other libraries?  My Ap library is running super slow because it's overloaded, so I have created two new libraries, but can't seem to move the projects into them?

    Hello Annabel,
    To move entire projects export them as Aperture Libraries, and then import those Libraries into the other Aperture Library:
    Select the Project in the Inspector, then
    File -> Export -> Project as Library
    In the other Library do:
    File -> Import  -> Library/ Project
    But I am not quite convinced, that the size of your current Aperture Library is responsible for the slowness of Aperture - Aperture is designed to cope with huge libraries.
    You may want to post your hardware setup and details of your library, and some of the hardware experts here may help you to find the reason for the slowness.
    A huge library should only be a problem, if the projects are too big, and if you have many, many smart albums at the root level of your library.
    So keep the projects small, and try to move some of your smart albums to lower levels in your folder structure (then Aperture does not need to scan all of your images to build the smart album).
    Other reasons for Aperture's slowness may be, e.g.
    An overfull system drive and/or external drive (keep at least 20% of your drives empty)
    lack of RAM
    a corrupted Aperture Library, that needs repairing
    Have you checked those options, before you split your library? It would be a pity to split it, for you would loose the ability to browse all parts at the same time, to use all your images in the Media Browser, etc.
    Regards
    Léonie

  • HT201363 Good evening ...  I have an account in appel and I have purchased a card  But I can not buy applications because the applications you want to push it under the answers to security questions and I forgot the answers to these questions  How can I c

    Good evening ...
    I have an account in appel and I have purchased a card
    But I can not buy applications because the applications you want to push it under the answers to security questions and I forgot the answers to these questions
    How can I change my answers to security questions??

    Hello, yazanalmasri0.
    If you need to reset your security questions and have a rescue email attached to your Apple ID, this article will help you with this issue.
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312
    If you are still unable to reset your security questions or do not have a rescue email associated with your account, you will need to reach out to our account security team. 
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Cheers,
    Jason H.

  • HT1222 Last time I did an update...I lost most of my music...thousands of songs and had to reinstall them!!!!  I am scared as **** to do another update!!  I have radio shows to do and can't afford to spend the time with this.  Help anyone?

    Last time I did an update...I lost most of my music...thousands of songs and had to reinstall them!!!!  I am scared as **** to do another update!!  I have radio shows to do and can't afford to spend the time with this.  Help anyone?

    A bit late for this advice now, but hopefully you'll know what to do next time.
    Empty/corrupt library after upgrade/crash
    Hopefully it's not been too long since you last upgraded iTunes, in fact if you get an empty/incomplete library immediately after upgrading then with the following steps you shouldn't lose a thing or need to do any further housekeeping. In the Previous iTunes Libraries folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library.itl as iTunes Library (Corrupt).itl and then rename the restored file as iTunes Library.itl. Start iTunes. Should all be good, bar any recent additions to or deletions from your library.
    See iTunes Folder Watch for a tool to catch up with any changes since the backup file was created.
    When you get it all working make a backup!
    tt2

  • I'm running Snow Leopard, do I have to upgrade to maverick or can I just upgrade to the new one?

    I'm running Snow Leopard, do I have to upgrade to maverick or can I just upgrade to the new one?

    If your Mac's compatible with Yosemite, you can upgrade directly to it.
    (116191)

  • I have downloaded adobe digital editions but can't open or launch the program

    I have downloaded Adobe Digital editions but can't open or launch the program.

    What operating system.
    If Vista, read http://helpx.adobe.com/digital-editions/kb/installing-digital-editions-20-windows.html
    If XP, quite a few people have problems.  One resolution is to install the older 1.7.2 version instead (which also avoids various other bugs).
    Version 1.7.2 is a little difficult to find,
    I found it for PC at http://www.tucows.com/preview/853736/Adobe-Digital-Edition-For-EBooks
    I'm not sure where there is a Mac version.

  • HT203128 iTunes 12.1.050 - Rollback: Updated from 12.01, now I cant't change track numbers and add additional data fields. How can I roll back to the previous version? @Apple, I want a $100 gift card for the inconvenience.

    iTunes 12.1.050 - Rollback: Updated from 12.01, now I cant't change track numbers and add additional data fields. How can I roll back to the previous version? @Apple, I want a $100 gift card for the inconvenience.
    - it's all said in the title. I can't understand why the developers turn things bad ... risking loosing Apples valuable customers.
    More examples needed? (check out the communities and the reviews)
    - OSX: Maverick to Yosemite = not recommended (check it out > http://roaringapps.com/apps)
    - iPad: older versions as iPad2 should not upgrade to iOS7/8 (it's not supporting its hardware accordingly, it's designed for the latest hardware)
    - iTunes (it's possible to rollback to 10.7 - 11.4, but you need to breech OSX system security framework)
    - Pages (was a real alternative for many of us, each update reduced features and created incompatibility to older work files)
    The list could easily extend to ...

    You can offer Apple feedback here: http://www.apple.com/feedback/
    as for "
      "@Apple, I want a $100 gift card for the inconvenience"
    dream on.

  • IMovie was removed from my macbook pro after I downloaded OS X Yosemite, I had it before and have used it, but now I can only get it through the app store

    iMovie was removed from my macbook pro after I downloaded OS X Yosemite, I had it before and have used it, but now I can only get it through the app store. I can't pay for it so I would really appreciate the help.

    Look in your applications folder for the installer - Install OS X Yosemite. Delete it. Then go back to the App Store purchases tab and see if you can download it. You might have to re-index Spotlight.
    Spotlight – Re-index

  • Hello, I have a Mac OS X, and can't seem to install the creative cloud, I get this pop-up message when I try Er is geen programma ingesteld om de URL 'aam://?passPhrase=QDdPo8BTHv975B1B1f0x3anMggUxp4allBf lsm629RgGXV22ocIlQfI9TMW5vkteaQquFNIFB1uDwU18Z268e

    Hello, I have a Mac OS X, and can't seem to install the creative cloud, I get this pop-up message when I try
    Er is geen programma ingesteld om de URL 'aam://?passPhrase=QDdPo8BTHv975B1B1f0x3anMggUxp4allBf lsm629RgGXV22ocIlQfI9TMW5vkteaQquFNIFB1uDwU18Z268e69Er6M8XCttQjvdYYdLJ9biyCRQF931 MyMPR0rGvrenZ0e2iougs4l9mlOAHDsfQEDOaqfVInflnZ9 FZSMc=' te openen. 
    So basically it said that I don't have a program to open it? I already had a trial version on my mac, but deleted it..

    YasmineH your web browser is blocking the installation of the AAM Detect plug-in.  I would recommend using a different web browser or installing through the Creative Cloud Desktop application.  You can find additional details on how to install the Adobe Creative applications included with your membership at Install and update apps - https://helpx.adobe.com/creative-cloud/help/install-apps.html.

  • I have downloaded Firefox 4 but now can't open it, get the message that it isn't supported on this archtecture

    I have downloaded Firefox 4 but now can't open it, get the message that it isn't supported on this architecture. This is the message:
    You cannot open the application “Firefox” because it is not supported on this architecture.

    Firefox 4 doesn't run on a PowerPC Mac.
    Firefox 4 requires at least OS X 10.5 and an Intel Mac.
    * http://www.mozilla.com/firefox/4.0/system-requirements/
    For a Firefox 4 compatible version that runs on Mac OS X 10.4.11 or Mac OS X 10.5.8 (PPC) you can look at:
    * http://www.floodgap.com/software/tenfourfox/
    Firefox 3.6.x (Mac OS X 10.4 and later) can be found here:
    * http://www.mozilla.com/en-US/firefox/all-older.html

Maybe you are looking for

  • Weird problem with GDB (it tries to execute /bin/baxh)

    Hello! I've installed gdb (v7.3.1) on my desktop and it doesn't work for me... Output: [goofy@goofy-desktop projekt-czk]$ gdb MapaDASR GNU gdb (GDB) 7.3.1 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <h

  • Document Number Range for Sales Documents

    Hi, Can we maintain Same number range at company code level? eg. client 800 company code:- X(Sales order no 1001) company code:- Y(Sales order no 1001) Regards, Amol.

  • Re install ichat

    my daughter somehow managed to delete ichat form her 900mhz g3 ibook. the computer has tiger installed. When i try to reinstall ichat with the ichat.pkg i can only get as far as choosing which drive to install it to, it then continues breifly then st

  • Paper Capture Recognition Service

    I have a user, using a HP Scanjet N8460 series scanner. We are trying to put our documents into PDF for storage, and so have a lot to do. She reported to me that out of 50 scans, 15 times, she got the following error: "Unable to process the page beca

  • IOS 5 froze my iphone

    my iphone is now frozen aftet the iOS 5 update, what do i do??