Help in parsing the XML result with ksoap2

Hi, I have another problem. I used KSOAP2 to call a web service net but when I catch him to display the result with a selectionneret, it shows the following screen:

reading on the web, I didn't find a good way to analyze the result. Could you help me with this? Thanks in advance

Thanks, the problem here is that we use the same webservice for more devices and a web page in .NET) that's why we use this webservice. Anyway thanks for the help. I read a lot of posts and the only way is perhaps to save the XML document in the SD card

Tags: BlackBerry Developers

Similar Questions

  • Need help to parse the xml string to populate the drop-down list

    Here is my: problem

    I have a hidden text field that contains the text of an xml

    <>facilities
    < building >
    < name > Building A < / name >
    < name > building B < / name >
    < name > building C < / name >
    < name > building D < / name >
    < name > building E < / name >
    < name > building F < / name >
    < name > building G < / name >
    < name > building H < / name >
    < / build >
    < / facilities >

    My goal is to read this with JavaScript xml string to populate a drop-down list with values of element (name). Does anyone know how script that?

    Attached is a sample .xdp

    See you soon,.

    Jesse

    Here is an example of change. I put the code click on the button, so you can see it in operation... You can place this code in the event that makes sense for you. I also added another field to show the DOM (this is for debugging purposes and you can remove this field if you want).

    Paul

  • having a problem with parsing the XML file

    Hi all
    I am trying to get data from XML file
    I want to only 4-5 values in this XML file
    Here is an example of XML file
    -< transaction >
    -< TransCtx >
    > < pAMETranType > IRCVACAPPROVAL < / pAMETranType >
    > < / TransCtx >
    > < / transaction >

    I want to add value and to store this value in table
    I'm here, I want to "IRCVACAPPROVAL".
    the tag
    < pAMETranType >

    for this purpose


    I created a procedure

    CREATE OR REPLACE PROCEDURE insert_xml_emps (p_directory in varchar2,
    > p_filename in varchar2)
    (> vtableName in varchar2) as
    > v_filelocator BFILE.
    > v_cloblocator CLOB.
    > l_ctx DBMS_XMLSTORE. CTXTYPE;
    > l_rows NUMBER;
    > v_amount_to_load NUMBER;
    > dest_offset NUMBER: = 1;
    > offset NUMBER: = 1;
    > lang_context NUMBER: = DBMS_LOB. DEFAULT_LANG_CTX;
    > WARNING NUMBER;
    > START
    > dbms_lob.createtemporary (v_cloblocator, true);
    > v_filelocator: = bfilename (p_directory, p_filename);
    > dbms_lob.open (v_filelocator, dbms_lob.file_readonly);
    > v_amount_to_load: = DBMS_LOB.getlength (v_filelocator);
    >-* this line is changed * -.
    > DBMS_LOB. LOADCLOBFROMFILE (v_cloblocator,
    > v_filelocator.
    > v_amount_to_load.
    > dest_offset.
    > offset.
    > 0,
    > lang_context.
    (> warning);
    >
    > l_ctx: = DBMS_XMLSTORE.newContext (vTableName);
    > DBMS_XMLSTORE.setRowTag (l_ctx, 'TRANSACTION');
    > DBMS_XMLSTORE.setRowTag (l_ctx, 'TRANSCTX');
    >-clear the update settings
    > DBMS_XMLStore.clearUpdateColumnList (l_ctx);
    >-set the columns to update a list of values
    > DBMS_XMLStore.setUpdateColumn (l_ctx, 'PAMETRANTYPE');
    >
    >-now insert the doc.
    > l_rows: = DBMS_XMLSTORE.insertxml (l_ctx, v_cloblocator);
    > DBMS_XMLSTORE.closeContext (l_ctx);
    > dbms_output.put_line(l_rows ||) "... inserted rows. ») ;
    > dbms_lob.close (v_filelocator);
    > DBMS_LOB. FREETEMPORARY (v_cloblocator);
    > END;

    I also have on the table who get this value

    whenever I call that created the procedure
    it sometime gives an error or sometime run correctly but store null in the table


    But when I change the XML file
    as
    When convert all lowercase letters in the capital then it works fine

    Is tehre to other ways to parse the XML file with no change in the XML file?

    Did you use the same test (with the exception of file name and directory) case?

    What I posted is a copy/paste direct SQL * Plus, and it works on version 11.2.0.1.

  • Please help to read the XML with XMLTable

    Hi gurus,

    I'm not very familiar with XML parsing. It seems to me that it should be very easy to get the data. For some reason, I'm having a problem to get the data.

    SELECT *.
    OF e util.hlsr_online_entries,.
    XMLTABLE)
    XmlNamespaces)
       ' http://tempuri.org/ '    as "dt",
    ("urn: schemas-microsoft-com: XML-diffgram-v1" as "dg").

    "/ DataTable / dg:diffgram/DocumentElement/JrShowCustomerHeifers.
    PASSAGE XMLTYPE (e.entry_data)
    COLUMNS
    SeqNo TO the ORDINALITE,
    DocumentID NUMBER PATH "DocumentID",.
    PATH of VARCHAR2 (100) ClubName "ClubName") as test
    WHERE e.ref_id = 33422

    The query above does all the data for me. My hunts is the problem with the tab DocumentElement. I tried a different variant management.

    Please help me to resolve the application

    I have the XML document following the DotNet developer

    <? XML version = "1.0" encoding = "utf-8"? >

    " < DataTable xmlns =" http://tempuri.org/ ">

    < xs: Schema id = "NewDataSet" xmlns = "" "xmlns: XS =" " http://www.w3.org/2001/XMLSchema " "xmlns:msdata ="urn: schemas-microsoft-com: xml-msdata" >

    < xs: element name = "NewDataSet" msdata:IsDataSet = "true" msdata:MainDataTable = "JrShowCustomerHeifers" msdata:UseCurrentLocale = "true" >

    < xs: complexType >

    < xs: Choice minOccurs = "0" maxOccurs = "unbounded" >

    < xs: element name = "JrShowCustomerHeifers" >

    < xs: complexType >

    < xs: SEQUENCE >

    < xs: element name = "DocumentID" type = "xs: int" minOccurs = "0" / >

    < xs: element name = "ClubName" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "Name" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "FirstName" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "PreferredName" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "Email" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "Exhibitor" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "AnimalName" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "RegistryNo" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "DateofBirth" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "NameofSire" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "SireRegistryNo" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "NameofDam" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "DamRegistryNo" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "Tattoo" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "SecondaryTattoo" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "UniversalIDNumber" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "Tattoo_Location" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "Secondary_Tattoo_Location" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "OracleBreedID" type = "xs: int" minOccurs = "0" / >

    < xs: element name = "JrValidationBreedName" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "ValidationDate" type = "xs: DateTime" minOccurs = "0" / >

    < xs: element name = "ValidatedBy" type = "xs: String" minOccurs = "0" / >

    < xs: element name = "ValidationComment" type = "xs: String" minOccurs = "0" / >

    < / xs: SEQUENCE >

    < / xs: complexType >

    < / xs: element >

    < / xs: Choice >

    < / xs: complexType >

    < / xs: element >

    < / xs: Schema >

    < xmlns:msdata = diffgr:diffgram "" urn: schemas-microsoft-com: xml-msdata "xmlns:diffgr =" urn: schemas-microsoft-com: XML-diffgram-v1 ">"

    < DocumentElement xmlns = "" >

    < JrShowCustomerHeifers diffgr: ID = "JrShowCustomerHeifers1" msdata:rowOrder = "0" >

    < > 18442 DocumentID < / DocumentID >

    < ClubName > Perrin FFA < / ClubName >

    Hamman < name > < / LastName >

    < FirstName > Charles < / name >

    < email > [email protected] < / email >

    < setting > hammam, Charles < / Exhibitor >

    < > 113 AnimalName < / AnimalName >

    < RegistryNo > C1026447 < / RegistryNo >

    < DateofBirth > 14/01/2013 < / DateofBirth >

    < NameofSire > 808 808 DAYS of MATCH LH < / NameofSire >

    < SireRegistryNo > C961101 < / SireRegistryNo >

    SADIE 7/7 < NameofDam > < / NameofDam >

    < DamRegistryNo > C941067 < / DamRegistryNo >

    < > 113 tattoo < / tattoo >

    < SecondaryTattoo / >

    < UniversalIDNumber > 1194F020 < / UniversalIDNumber >

    < Tattoo_Location > TATTOO - left ear < / Tattoo_Location >

    < Secondary_Tattoo_Location / >

    < OracleBreedID > 6383 < / OracleBreedID >

    Beefmaster < JrValidationBreedName > < / JrValidationBreedName >

    < ValidationDate > 2014-11-25T 08: 39:00 - 06:00 < / ValidationDate >

    < ValidatedBy > laineyb < / ValidatedBy >

    < ValidationComment / >

    < / JrShowCustomerHeifers >

    < JrShowCustomerHeifers diffgr: ID = "JrShowCustomerHeifers2" msdata:rowOrder = "1" >

    < > 18473 DocumentID < / DocumentID >

    < ClubName > Perrin FFA < / ClubName >

    Hamman < name > < / LastName >

    < FirstName > Charles < / name >

    < email > [email protected] < / email >

    < setting > hammam, Charles < / Exhibitor >

    < AnimalName > PURPLE CORALEE 349 KPH < / AnimalName >

    < RegistryNo > P43461953 < / RegistryNo >

    < DateofBirth > 04/11/2013 < / DateofBirth >

    < NameofSire > PURPLE MOXY 22 X AND < / NameofSire >

    < SireRegistryNo > P43126458 < / SireRegistryNo >

    < NameofDam > TCC CORKY 6603 < / NameofDam >

    < DamRegistryNo > P42457119 < / DamRegistryNo >

    < > 349 tattoo < / tattoo >

    < SecondaryTattoo > km/h < / SecondaryTattoo >

    < UniversalIDNumber > 1194F021 < / UniversalIDNumber >

    < Tattoo_Location > TATTOO - left ear < / Tattoo_Location >

    < Secondary_Tattoo_Location > TATTOO - right ear < / Secondary_Tattoo_Location >

    < OracleBreedID > 6389 < / OracleBreedID >

    < JrValidationBreedName > Polled Hereford < / JrValidationBreedName >

    < ValidationDate > 2014 - 12-01 T 11: 55:00 - 06:00 < / ValidationDate >

    Hannah < ValidatedBy > < / ValidatedBy >

    < ValidationComment / >

    < / JrShowCustomerHeifers >

    < JrShowCustomerHeifers diffgr: ID = "JrShowCustomerHeifers3" msdata:rowOrder = "2" >

    < > 18474 DocumentID < / DocumentID >

    < ClubName > Perrin FFA < / ClubName >

    Hamman < name > < / LastName >

    < FirstName > Charles < / name >

    < email > [email protected] < / email >

    < setting > hammam, Charles < / Exhibitor >

    < AnimalName > LANGFORDS SWEET N SOUR 4107 < / AnimalName >

    < RegistryNo > 43504761 < / RegistryNo >

    < DateofBirth > 02/03/2014 < / DateofBirth >

    < NameofSire > LH TNT 1017 < / NameofSire >

    < SireRegistryNo > 43199794 < / SireRegistryNo >

    < NameofDam > LANGFORDS LADY 2206 AND < / NameofDam >

    < DamRegistryNo > 43315143 < / DamRegistryNo >

    < > 4107 tattoo < / tattoo >

    < SecondaryTattoo / >

    < UniversalIDNumber > 1194F018 < / UniversalIDNumber >

    < Tattoo_Location > TATTOO - left ear < / Tattoo_Location >

    < Secondary_Tattoo_Location / >

    < OracleBreedID > 6398 < / OracleBreedID >

    Hereford < JrValidationBreedName > < / JrValidationBreedName >

    < ValidationDate > 2014-11-24T 14:26:00 - 06:00 < / ValidationDate >

    Validator < ValidatedBy > < / ValidatedBy >

    < ValidationComment / >

    < / JrShowCustomerHeifers >

    < JrShowCustomerHeifers diffgr: ID = "JrShowCustomerHeifers4" msdata:rowOrder = "3" >

    < > 18475 DocumentID < / DocumentID >

    < ClubName > Perrin FFA < / ClubName >

    Hamman < name > < / LastName >

    < FirstName > Charles < / name >

    < email > [email protected] < / email >

    < setting > hammam, Charles < / Exhibitor >

    < AnimalName > PURPLE CCC 19A LYDIA < / AnimalName >

    < RegistryNo > P43406978 < / RegistryNo >

    < DateofBirth > 05/02/2013 < / DateofBirth >

    < NameofSire > PURPLE MB WOMANIZER 14UET < / NameofSire >

    < SireRegistryNo > P42945146 < / SireRegistryNo >

    < NameofDam > PURPLE CMCC NASTIA 9U < / NameofDam >

    < DamRegistryNo > P42927201 < / DamRegistryNo >

    < > 19A tattoo < / tattoo >

    < SecondaryTattoo / >

    < UniversalIDNumber > 1194F017 < / UniversalIDNumber >

    < Tattoo_Location > TATTOO - left ear < / Tattoo_Location >

    < Secondary_Tattoo_Location / >

    < OracleBreedID > 6389 < / OracleBreedID >

    < JrValidationBreedName > Polled Hereford < / JrValidationBreedName >

    < ValidationDate > 2014 - 12-01 T 11: 55:00 - 06:00 < / ValidationDate >

    Hannah < ValidatedBy > < / ValidatedBy >

    < ValidationComment / >

    < / JrShowCustomerHeifers >

    < JrShowCustomerHeifers diffgr: ID = "JrShowCustomerHeifers5" msdata:rowOrder = "4" >

    < > 18477 DocumentID < / DocumentID >

    < ClubName > Perrin FFA < / ClubName >

    Hamman < name > < / LastName >

    < FirstName > Charles < / name >

    < email > [email protected] < / email >

    < setting > hammam, Charles < / Exhibitor >

    < AnimalName > PURPLE SGW EDEN 12 b < / AnimalName >

    < RegistryNo > P43521932 < / RegistryNo >

    < DateofBirth > 02/04/2014 < / DateofBirth >

    < NameofSire > first TIME's a WASTINe 0124 < / NameofSire >

    < SireRegistryNo > 43123163 < / SireRegistryNo >

    < NameofDam > PURPLE SM WONDER WOMAN 160Y < / NameofDam >

    < DamRegistryNo > P43235169 < / DamRegistryNo >

    < tattoo > 12 b < / tattoo >

    < SecondaryTattoo > 12 b < / SecondaryTattoo >

    < UniversalIDNumber > 1194F015 < / UniversalIDNumber >

    < Tattoo_Location > TATTOO - left ear < / Tattoo_Location >

    < Secondary_Tattoo_Location > TATTOO - right ear < / Secondary_Tattoo_Location >

    < OracleBreedID > 6389 < / OracleBreedID >

    < JrValidationBreedName > Polled Hereford < / JrValidationBreedName >

    < ValidationDate > 2014 - 12-01 T 11: 56:00 - 06:00 < / ValidationDate >

    Hannah < ValidatedBy > < / ValidatedBy >

    < ValidationComment / >

    < / JrShowCustomerHeifers >

    < / DocumentElement >

    < / diffgr:diffgram >

    < / DataTable >

    user12021633 wrote:

    Regarding your suggestion, I've never used the syntax of FLWOR. I'll try to implement if I can make it work.

    "FLWOR is the abbreviation of ' for Let's where Order by Return" and refers to the full form of an XQuery query expression.

    Do you think it would be faster than the way I have the values?

    You have used a FLWOR expression (the 'for' + 'return' part of it) in this post: Re: Please help to read the XML with XMLTable

    And I have already said: do not use in this case.

    Faster or slower isn't the point. Oracle will evaluate the expression in the same way.

    But from a maintenance point of view, it's obviously much easier to use a simple XPath expression like this:

    /DT:GetJrShowCustomerHeifersResponse / dt:GetJrShowCustomerHeifersResult / dg:diffgram/DocumentElement/JrShowCustomerHeifers

  • How to parse the XML from the server BB10 Cascades development

    Hi all

    I'm new to BB10 development.

    I made the connection with my server that sends data to the XML Format. How to analyze.  Can someone help me with this.

    Also how to store data analysed in the Global Variable or ArrayList.

    Concerning

    Stephenson

    I thought you wanted to do stunts (qml).
    I use Qt

    QByteArray data = currentReply->readAll();
    xml.addData(data); //xml is a QXmlStreamReader
    

    to parse the xml, it is pretty simple if you look at the API.

    Here is a snippet of my code:

    while (!xml.atEnd()) {
        xml.readNext();
        /** start of an element **/
        if (xml.isStartElement()) {
            currentTag = xml.name().toString();
            if (xml.name() == "version") {
    

    the feed reader goes hierarchically, so you can simply call routines to analyze the different parts of the xml if the name() corresponds to a certain value.

  • Need examples of code to parse the xml using kxml2

    Hello world

    I am a beginner for Blackberry, I want to get the data from the xml file. I look and see the section use of kxml2 is a better choice.

    But I can't find an example code for it on the Blackberry.  Can someone share me?

    I open kxml2.jar, I see xmlParser and kxmlParser, whoever I'm use()?

    Anbody can help me contact how to use kxml2 clearly?

    Thank you very much. Sorry for the bad English.

    --------

    Binh - VietNam

    Ah yes, sorry, I assumed automatically kxml to be used with ksoap2.

    kxml is a j2me parser commonly you can find sources in other forums, for example
    http://www.developer.Nokia.com/community/wiki/How_to_parse_an_XML_file_in_Java_ME_with_kXML
    http://j2mesamples.blogspot.com/2009/04/XML-parsing-in-J2ME.html

  • How can I parse the XML file using the Oracle's Sql query.

    Hi all
    I have an XML file that must analyze and display the result according to the following example
    Can you please recommend me an approach to get the result.

    For example, here is my XML:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < xmlns:pi = "urn:com.workday / picof pi: Extract_Employees" >
    < IP: employee >
    < Additional_Information: pi > < pi: pi function: PriorValue = "" > Intern - masteri¿½s < / pi: function >
    < / pi: Additional_Information >
    < / pi: employee >
    < / pi: Extract_Employees >

    Databases:

    Oracle Database 10 g Enterprise Edition release 10.2.0.3.0 - production

    SQL > SELECT * FROM NLS_DATABASE_PARAMETERS;

    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS.,.
    WE8ISO8859P1 NLS_CHARACTERSET
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI. SSXFF AM
    NLS_TIMESTAMP_FORMAT-DD-MON-RR HH.MI. SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI. SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI. SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    BINARY NLS_COMP
    NLS_LENGTH_SEMANTICS BYTES
    NLS_NCHAR_CONV_EXCP FAKE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 10.2.0.3.0



    The Xml file above with UTF-8 character sets which is multi bytes.

    But in my character database is WE8ISO8859P1 for example ISO-8859-1 (single-byte character set)

    SQL > SELECT extractValue (Value (x) ', ' / pi:Employee/pi:Additional_Information/pi:Job_Title','xmlns:pi="urn:com.workday/picof ' ')
    TABLE (XMLSequence (extract (XMLType (bfilename('XMLDIR','XML_Issue_227176.xml'), nls_charset_id ('AL32UTF8')),'/ pi: Employee ',' xmlns:pi="urn:com.workday/picof"'))) x;)))


    which gives the following error:

    Error:
    ORA-31011: XML parsing failed
    ORA-19202: an error has occurred in the processing of XML
    LPX-00200: could not convert from UTF-8 encoding to ISO-8859-1
    Error on line 1
    ORA-06512: at "SYS." XMLTYPE", line 295
    ORA-06512: at line 1

    Also I tried with this
    SQL > SELECT convert (extractValue (Value (x), ' / pi:Employee/pi:Additional_Information/pi:Job_Title','xmlns:pi="urn:com.workday/picof"'),'WE8ISO8859P1 ', 'UTF8'))
    TABLE (XMLSequence (extract (XMLType (bfilename('XMLDIR','XML_Issue_227176.xml'), nls_charset_id ('AL32UTF8')),'/ pi: Employee ',' xmlns:pi="urn:com.workday/picof"'))) x;)))

    The same error is according to the above error message.

    Please help in this regard.

    Thank you and best regards,
    Sandrine

    You know the code of real character behind "" or you receive the file like that?

    For the record, "" is the wildcard of UTF-8 (0xEFBFBD), so that the original character of the means has already been replaced and that very probably the file was not coded properly in the first place.

    With respect to the resolution of the problem, try another method to read the file:

    SQL> select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET';
    
    VALUE
    ----------------------------------------
    WE8ISO8859P15
    
    SQL> SELECT x.*
      2  FROM XMLTable(
      3         XMLNamespaces(default 'urn:com.workday/picof')
      4       , '/Extract_Employees/Employee'
      5         passing xmltype(
      6                   dbms_xslprocessor.read2clob(
      7                     'COP_DIR'
      8                   , 'XML_Issue_227176.xml'
      9                   , nls_charset_id('AL32UTF8')
     10                   )
     11                 )
     12         columns job_title varchar2(30) path 'Additional_Information/Job_Title'
     13       ) x
     14  ;
    
    JOB_TITLE
    ------------------------------
    Intern -  Master¿s
     
    
  • Need help to read the xml file and place it in a table.

    Nice day!

    Here is the configuration. I have a xml file from another source which will call a stored procedure in my database (which I am supposed to create). This is a first for me, I've never done development pl/sql or worked with xml. :(

    That's what I hoped to accomplish, if there is a better way, that I am open to him.
    In short, to have a stored procedure that takes the xml file (transmitted by third parties via the call, no url must be a file), creates a temporary table and populates the two columns needed. Then, the SP will make a select join with the temporary table and other data available in another schema. Once the completed table selection will be truncated and dropped. SP farm.

    Details:
    DB: Oracle 11.2.0.1 RAC.
    Charset: AL32UTF8
    Example of XML: (nearly 10,000 lines like this in production)
    "< MerchantID report =" "#" name = 'Conversion detail report' ReportStartDate = '2011-09-27 12:00:00GMT' ReportEndDate = '2011-09-27 21:38:13GMT"Version ="1.1"> < Conversion = '1234567891234567 D' MerchantReferenceNumber Convertingdate =" 2011-09-27 13:39:02 "RequestID ="1234567891234567891234"> < OriginalDecision > REVIEW < / OriginalDecision > < NewDecision > ACCEPT < / NewDecision > < Reviewer > testusr < / examiner > < ReviewerComments > no reason to reject. < / ReviewerComments > < Notes > < Note Date = "2011-09-27 13:39:02" AddedBy = "testusr" comment = "Took possession" / > < / Notes > < queue > Digital Review < / queue > < profile > Digital orders QA < / profile > < / Conversion > "
    ...
    < / report >

    What I tried.
    I found a tutorial: http://it.toolbox.com/blogs/oracle-guide/oracle-and-xml-in-action-a-real-world-example-5319 I tried and was able to make it work. But I could not duplicate the results with my xml file. So I looked away and have had no success. :( I'm not a developer, so I'm really bad...

    I found a note of support: (how to load an XML file into a Database Table using DBMS_XMLSave unaided Bfile [227476.1 ID]) and couldn't make it work.

    I found some online then Odie son xml and tried these but slipped and couldn't get my versions of these great answers to work for me.

    Then... I'm here now and hoping that someone could walk me through this.


    I tinkered this SP (it doesn't have to be that way, the suggestions are greatly appreciated)

    create or replace procedure xml_to_table (call_1 call_2) as

    Start
    run immediately "CREATE GLOBAL TEMPORARY TABLE XMLType IMRPT
    --(clé primaire contrainte-imrpt_pk (MerchantReferenceNumber))
    XmlType store as xml binary basicfile
    -(high compression)
    virtual columns
    (MerchantReferenceNumber as (xmlcast (xmlquery ('/ Conversion/MerchantReferenceNumber ' from object_value content back) as VARCHAR2 (32))))
    , NewDecision as (xmlcast (xmlquery ('/ Conversion/NewDecision ' from object_value content back) as VARCHAR2 (10)))
    )
    -ON COMMIT PRESERVE ROWS

    run immediately 'save xml as a file on the local system?'

    insert into IMRPT (MerchantReferenceNumber, NewDecision)

    run immediately "join select statement.
    run immediately 'truncate table IMRPT.
    run immediately "drop table IMRTP.

    end;
    /

    On my last test, I tried to select just in the xml file using this:

    DECLARE
    indomdoc DBMS_XMLDOM. DOMDocument;
    innode DBMS_XMLDOM. DOMNode;
    myParser DBMS_XMLPARSER.parser;
    buf VARCHAR2 (2000);
    BEGIN
    myParser: = DBMS_XMLPARSER.newParser;

    DBMS_XMLPARSER.setBaseDir (myparser, 'XML_DIR');
    DBMS_XMLPARSER. Parse (myParser, "test.xml");

    indomdoc: = DBMS_XMLPARSER.getDocument (myParser);

    -just to test content
    innode: = DBMS_XMLDOM.makeNode (indomdoc);
    DBMS_XMLDOM.writeToBuffer (innode, buf);
    Dbms_output.put_line (BUF);

    dbms_xmldom.freeDocument (indomdoc);
    dbms_xmlparser.freeParser (myParser);
    END;
    /

    It was another accident and burn.

    Any help would be appreciated.

    Thank you

    Like I said:

    Here is an example using a REF CURSOR variable ( you will need to declare a plus for your actual procedure )

    Your procedure has two parameters, you must declare two variables to hold the two REF CURSOR ;)

    DECLARE
    
      v_filename      VARCHAR2(50) := 'DMReport.xml';
      v_rc1            SYS_REFCURSOR;
      v_rc2            SYS_REFCURSOR;
    
      v_order_name       VARCHAR2(100);
      v_reason_text      VARCHAR2(100);
    
    BEGIN
    
      xml2table(v_filename, v_rc1, v_rc2);
    
      commit;
    
      loop
        fetch v_rc1 into v_order_name;
        exit when v_rc1%notfound;
        dbms_output.put_line('ORDER_NAME='||v_order_name);
      end loop;
    
      close v_rc1;
    
      loop
        fetch v_rc2 into v_order_name, v_reason_text;
        exit when v_rc2%notfound;
        dbms_output.put_line('ORDER_NAME='||v_order_name||', REASON_TEXT='||v_reason_text);
      end loop;
    
      close v_rc2;
    
    END;
    /
    

    If you test this in SQL * Plus, do not forget to SET SERVEROUTPUT ON to see the result.

  • Unable to parse the XML because of malformed UTF-8

    When parsing a string xml (not a file!) I have a malfromed exception UTF-8. This is due to the fact that there are accents in (oau), but the chain says it utf-8 format. These umlauts or even some Chinese characters are allowed by the xml specification.

    You have an idea on how to make this work? the problem is that I can't just replace the characters with something else since I have to support any language.

    Sring xml ="" my name: oauRed535.

    DocumentBuilderFactory plant = DocumentBuilderFactory.newInstance ();

    DocumentBuilder builder = factory.newDocumentBuilder ();

    InputStream inputStream = new ByteArrayInputStream (xml.getBytes ());

    Document document = builder.parse (inputStream);

    Exception message when you call parse: Malformed UTF-8

    Any help welcome,

    Thank you

    Is the point of this item:

    my name: oau

    to test the transformation of accented characters?

    In any case, I'll try:

    xml.getBytes("UTF-8")

    to make sure that your string is encoded using UTF-8 and not ISO-8859-1 which is the default.

  • Need help to retrieve the XML file

    Hello

    I'm new to xml query and I need help badly. I have a file xml with the following content. I need help to extract data as:

    beginTimelocalDnmeasObjLdnhdlcRxErrAborthdlcRxErrCRChdlcRxErrLackOfBufs
    2015 07-28 T 14: 45:00 + 03:00ERSGSN01MagId.SlotId.E1/T1Trunk.FractionId=2.8.6.1240010200
    2015 07-28 T 14: 45:00 + 03:00ERSGSN01MagId.SlotId.E1/T1Trunk.FractionId=2.9.3.1000
    2015 07-28 T 14: 45:00 + 03:00ERSGSN01MagId.SlotId.E1/T1Trunk.FractionId=2.9.4.1000

    and the XML data I have are:

    <? XML version = "1.0" encoding = "UTF-8"? >

    <? XML-stylesheet type = "text/xsl" href = "MeasDataCollection.xsl"? >

    " < measCollecFile xmlns =" http://www.3GPP.org/FTP/specs/archive/32_series/32.435#measCollec ">

    < fileFormatVersion = "32.435 V9.0" fileHeader vendorName = "Ericsson" >

    < fileSender / >

    < measCollec beginTime = "2015-07 - 28 T 14: 45:00 + 03:00" / >

    < / fileHeader >

    < measData >

    < managedElement localDn = "ERSGSN01" / >

    < measInfo measInfoId = ' E1/T1, hdlc' >

    < job jobId = "Meas_E1T1_all" / >

    < duration granPeriod = "PT900S" endTime = "2015-07 - 28 T 15: 00:01 + 03:00" / >

    < duration repPeriod = "PT900S" / >

    < p measType = "1" > hdlcRxErrAbort < / measType >

    < p measType = "2" > hdlcRxErrCRC < / measType >

    < p measType = "3" > hdlcRxErrLackOfBufs < / measType >

    < p measType = "4" > hdlcRxErrMaxFrameLen < / measType >

    < p measType = "5" > hdlcRxErrNonOctetAlign < / measType >

    < p measType = "6" > hdlcRxErrQueue < / measType >

    < p measType = "7" > hdlcRxOK < / measType >

    < p measType = "8" > hdlcRxOctets < / measType >

    < p measType '9' = > hdlcTxOK < / measType >

    < p measType = "10" > hdlcTxOctets < / measType >

    < measValue measObjLdn="MagId.SlotId.E1/T1Trunk.FractionId=2.8.6.1" >

    < p r = "1" > 2400 / < r >

    < p r '2' = > 1020 / < r >

    < p r = "3" >/< r > 0

    < p r = "4" >/< r > 0

    < p r = "5" > </r > 0

    < p r = "6" >/< r > 0

    < p r = "7" >/< r > 0

    < p r = "8" > 0 </r >

    < p r '9' = > 295 / < r >

    < p r = "10" > 4130 / < r >

    < / measValue >

    < measValue measObjLdn="MagId.SlotId.E1/T1Trunk.FractionId=2.9.3.1" >

    < p r = '1' >/< r > 0

    < p r = "2" >/< r > 0

    < p r = "3" >/< r > 0

    < p r = "4" >/< r > 0

    < p r = "5" > </r > 0

    < p r = "6" >/< r > 0

    < p r = "7" >/< r > 0

    < p r = "8" > 0 </r >

    < p r '9' = > 295 / < r >

    < p r = "10" > 4130 / < r >

    < / measValue >

    < measValue measObjLdn="MagId.SlotId.E1/T1Trunk.FractionId=2.9.4.1" >

    < p r = '1' >/< r > 0

    < p r = "2" >/< r > 0

    < p r = "3" >/< r > 0

    < p r = "4" >/< r > 0

    < p r = "5" > </r > 0

    < p r = "6" >/< r > 0

    < p r = "7" >/< r > 0

    < p r = "8" > 0 </r >

    < p r '9' = > 295 / < r >

    < p r = "10" > 4130 / < r >

    < / measValue >

    < / measInfo >

    < / measData >

    < fileFooter >

    < measCollec = endTime "2015-07 - 28 T 15: 00:01 + 03:00" / >

    < / fileFooter >

    < / measCollecFile >

    Help, please. I tried to select a value using the following xml query which does not lead to any output:

    WITH t AS (SELECT xmltype (bfilename('SGSN_STAT_ERICSSON', 'A20150728.1445+0300-20150728.1500+0300_Meas_E1T1_all.52'), nls_charset_id('UTF-8')) FROM dual xmlcol)

    SELECT beginTime, localDn, measObjLdn, hdlcRxErrAbort, hdlcRxErrCRC, hdlcRxErrLackOfBufs

    T, XMLTABLE

    (XMLNAMESPACES ('http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec' as 'ns1'), )

    ' / measCollecFile'

    passage xmlcol

    columns

    beginTime PATH VARCHAR2 (32) ' / measCollec/@beginTime',

    localDn PATH VARCHAR2 (32) ' / measData/managedElement@localDn',

    measObjLdn PATH VARCHAR2 (32) ' / measData/measInfo/measValue@measObjLdn',

    ["hdlcRxErrAbort PATH VARCHAR2 (32) ' / measData/measInfo/measValue/r[@p="1 ']',

    ["hdlcRxErrCRC PATH VARCHAR2 (32) ' / measData/measInfo/measValue/r[@p="2 ']',

    "[" hdlcRxErrLackOfBufs PATH VARCHAR2 (32) ' / measData/measInfo/measValue/r[@p="3 ']"

    )

    Sincere greetings

    Either way, using an XQuery FLWOR expression:

    select x.*
    from xmltable(
           xmlnamespaces(default 'http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec')
         , 'for $h in /measCollecFile
              , $v in $h/measData/measInfo/measValue
            return element row {
              $h/fileHeader/measCollec/@beginTime
            , $h/measData/managedElement/@localDn
            , $v/@measObjLdn
            , element r1 {$v/r[@p="1"]}
            , element r2 {$v/r[@p="2"]}
            , element r3 {$v/r[@p="3"]}
            }'
           passing xmltype(bfilename('TEST_DIR', 'test.xml'), nls_charset_id('AL32UTF8'))
           columns beginTime           timestamp with time zone path '@beginTime'
                 , localDn             varchar2(32)             path '@localDn'
                 , measObjLdn          varchar2(80)             path '@measObjLdn'
                 , hdlcRxErrAbort      number                   path 'r1'
                 , hdlcRxErrCRC        number                   path 'r2'
                 , hdlcRxErrLackOfBufs number                   path 'r3'
         ) x ;
    
  • Need help to understand the query result

    Hi gurus

    I was reading one of the question here in this forum and its link is below:

    Query required for scenario

    I had some confusion related to this code and don't understand the logic of the out put, see query below:

    Query

    with sub_services as

    (

    Select su_seq 12323, 'HLR1' so_id, 1 seq Union double all the

    Select su_seq 12323, "HLR2' so_id, seq 2 Union double all the

    Select su_seq 12323, "A09" so_id, seq 3 of all the double union

    Select su_seq 12333, "MO1" so_id, seq 4 Union double all the

    Select su_seq 12333, "MO2' so_id, seq 5 Union double all the

    Select su_seq 12333, "A09" so_id, 6 seq in union double all the

    Select su_seq 12333, 'M0CR' so_id, seq 7 Union double all the

    Select su_seq 12999, "LOL1' so_id, seq 8 Union double all the

    Select su_seq 12999, "LOL2' so_id, seq 9 double

    )

    Select *.

    of sub_services b

    where exists (select 1 from sub_services

    where su_seq = b.su_seq

    and so_id = 'A09.

    )

    order by 2;

    The query result

    12323 A09 3

    12333 6 A09

    12323 HLR1 1

    12323 HLR2 2

    12333 M0CR 7

    12333 4 MO1

    12333 5 MO2

    According to my understanding, the above query should return records in red only because of her is below command

    It exists (select 1 from sub_services

    where su_seq = b.su_seq

    and so_id = 'A09.

    but don't know why he's back 7 files, can someone help me understand the result...

    It is query is functionally identical to the PL/SQL block, but much more effective.

    declare

    number of l_res;

    Start

    for line (select *)

    sub_services) loop

    Start

    Select 1 from l_res

    of sub_services

    where su_seq = row.su_seq and

    so_id = "A09" and

    rownum = 1;

    exception when

    NO_DATA_FOUND then

    null;

    end;

    end loop;

    end;

    Essentially every row in the outer query are tested against him exists query.  Given the correlation between two requests is based only on su_seq each line with a su_seq value returned by him is returned in the output.

    Another way to think he uses instead a join condition.  This query is equivalent to the query to exist

    Select the main

    of main sub_services

    Join select (separate su_seq

    of sub_services

    where so_id = "A09") cond

    We main.su_seq = cond.su_seq;

    John

  • Parse the XML file and extract data

    I want to parse a XML file and get the data as columns.

    Input country.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <MAS Action="Insert">
    <Country ObjectId="100000000000000009" VersionId="8"><Id>1</Id><NlTexts><Name Language="de">Land1</Name><Name Language="en">Country1</Name></NlTexts></Country>
    <Country ObjectId="100000000000000033" VersionId="2"><Id>2</Id><NlTexts><Name Language="de">Land2</Name><Name Language="en">Country1</Name></NlTexts></Country>
    </MAS>
    
    

    I would like to analyze the xmlfile to get the following result

    Required result:

    col1        col2           col3
    1            Land1        Country1
    2            Land2        Country2
    

    or alternatively

    col1  col2       
    1            Land1       
    1            Country1
    2            Land2       
    2            Country2
    

    I tried the extract function

    select extract((XMLTYPE(BFILENAME('XML_DAT_DIR', 'country.xml'),
               NLS_CHARSET_ID('AL32UTF8'))) , '/*/*/Id') as "xdata"
    from dual;
    
    xdata
    ------------------------
    <Id>1</Id><Id>2</Id>
    

    and XMLTABLE (but how can I add countries now)

    SELECT *
        FROM XMLTABLE('/*/*/Id'
               PASSING XMLTYPE(BFILENAME('XML_DAT_DIR', 'country.xml'),
               NLS_CHARSET_ID('AL32UTF8'))
           )
      ;
    COLUMN_VALUE
    ------------------------
    <Id>1</Id>
    <Id>2</Id>
    

    DB version 11.2.0.3 on Windows 64-bit

    Thank you

    Tim

    Here are a few examples.

    For your output required:

    SELECT *.

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , col2 varchar2 (30) path "NlTexts/name [1].

    , col3 varchar2 (30) path "NlTexts/name [2]»

    )

    ;

    or, if the Language attribute is significant:

    SELECT *.

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    col2 varchar2 (30) path "NlTexts/Name[@Language="de"]"

    col3 varchar2 (30) path "NlTexts/Name[@Language="en"]"

    )

    ;

    For your alternate exit:

    SELECT x1.col1

    x2.col2

    -, x2.col3

    FROM XMLTable)

    "/ MAS/country".

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , path of xmltype names ' NlTexts/name '.

    ) x 1

    XMLTable)

    "/ Name".

    in passing x1.names

    path of column col2 varchar2 (30) '.'

    -, col3 to ordinalite

    ) x 2

    ;

    (uncomment col3 to see what he does)

    or in a shorter way:

    SELECT *.

    FROM XMLTable)

    ' for $i/MAS/country

    , $j in $ NlTexts/i/name

    Returns the r element {$i / Id, $j}'

    from XMLType (bfilename ('TEST_DIR', 'country.xml'), nls_charset_id ('AL32UTF8'))

    number of columns col1 way "Id".

    , col2 varchar2 (30) path 'name '.

    ) ;

  • Static load of the XML file with the list of choices

    Hello

    So let me explain my problem:

    -J' have XML files: (in my < fx:Declaration >)
    < fx:XML id = "flexang" source = "xml/flex - ang.xml" / >
    < fx:XML id = "flexastro" source = "xml/flex - astro.xml" / >
    < fx:XML id = "flexber" source = "xml/flex - ber.xml" / >

    -J' have a list constructed as follows:

    (in my < fx:Declaration >)

    < fx: Model id = "anim" >
    States <>
    < label State = data="animations/flex-ang.swf"/ "Anguinéa" >
    < label State = "Retrograde motion" data="animations/flex-astro.swf"/ >
    < label State = "Rod of Bérard" data="animations/flex-ber.swf"/ >
    < / states >
    < / fx: Model >


    (and then)

    < mx:List id = 'source' width = '100% ', color = 'blue '.
    dataProvider = "{anim.state}" "
    change = "selectedListItem .selectedItem = list (event.currentTarget);" / > "

    (with public var selectedListItem:Object ;)


    My list is designed to load dynamicaly some SWF files

    < mx:SWFLoader id = "animation".
    source = "{selectedListItem.Data}" "
    autoLoad = 'true '.
    Width="100%"/ >

    -But now I want to display the correspondent. So I tried to build the string to the XML of the selectedListItem.data id:

    private void xmlFile(swf:String):String
    {
    var pref:String;
    var tab = swf.split (".", 2);
    Tab = Tab [0]. Split("/",2);
    Pref = tab [1];
    Pref pref =. Split("-"). Join("");
    return of pref;
    }

    This gives me, for example, "flexang" of "animations/flex - ang.swf. But my problem is that I want to put my XML file in my region RichText:

    < s:RichEditableText id = 'codeView' editable = textFlow = "{TextFlowUtil.importFromXML (xmlFile (selectedListItem.data)) 'false'}" / > "

    But xmlFile returns a string! and I don't know how to specify that it is an XML ID.

    I hope I am clear enough.

    Thank you if you try to help me

    Wait, that wasn't fair.  Try:

    TextFlow = "{TextFlowUtil.importFromXML (this [xmlFile (selectedListItem.data)])}

    "

  • Inability to parse the XML file

    Podcasts connect tells me that it cannot parse the following URL.  You can determine why?  The URL http://www.nudge.online/Protest/Podcasts/hungerstriker.xml

    I followed, as far as possible, the advice provided by PodcastConnect

    Line 18 of your food

    < height > 144 < / height >

    The misspelling has given rise to the 'height' never closed and thus invalidate the rest of the food.

  • Loading the XML file with the missing elements dynamically by ODI

    Hi guys,.

    I have the XML with two nodes Employee and address below. On a daily basis, sometimes the address element might not come from the source xml file, but my interface has columns mapped to the elements of the address, and that is why it may fail because of the source element is not found in the file or data could not get charged because the State 'and' in the sql query that is generated between the employee and address elements.  Is there a way where I can load the data dynamically where I can search in the file only for items (used) present and dynamically loading data only for these items?

    XML file:

    <? XML version = "1.0" encoding = "UTF-8"? >

    < EMP >

    < Empsch >

    < employee >

    < EmployeeID 12345 > < / EmployeeID >

    < original > t < / initials >

    John < name > < / LastName >

    DOE < FirstName > < / name >

    < / employee >

    < address >

    < > 12345 as WorkPhone < / as WorkPhone >

    < WorkAddress > test 234 < / WorkAddress >

    < / address >

    < / Empsch >

    < / EMP >

    Thank you

    Fabien Tambisetty

    I managed to solve it by using left outer joins, and in referring to the structure of the table of the XSD

Maybe you are looking for