How to map xml to a fixed length string?

Hi All,
I have a requirement to map request xml to a string of fixed length and format:
For eg,
Source:
<Person>
<Name>George</Name>
<Age>21</Age>
</Person>
Target:
String of format
Name : 8 chars
Age : 2chars.
so the required mapping should result in
"George 21".
Note: 2 blanks after "George" to allow for 8 characters. Is this kind of mapping possible using ALSB xquery? I have tried to create a MFL representation for the string , and used it in the xquery as the targer but it is generating
"George21".Only data present in source is getting mapped :(

My advice would be to use MFL transformation for that.
Documentation about MFL can be found at edocs: http://edocs.bea.com/alsb/docs26/fbhelp/index.html
Find tips and tricks about ALSB at my blog: http://dev2dev.bea.com/blog/jordinho/

Similar Messages

  • How to map XML File input to VO (eventually to update table) upon fileupld

    Reqirement: I am downloading an XML File (basically name-value pair) from user using OAMessageFileUploadBean. I need to take this file and update to an existing record in the table (cs_incidents_all). XML File schema is well-known in advance.
    Approach: Don't know what is the best, but I'm thinking if there is an OAF way to map the XML File (Blobdomain) to VO and get the rowIMPL.getColumn1Value to fetch all the datavalues then loop thru all the columns (xml-tags) and finally call plsql APIs which will update/insert into table (cs_incidents_all)
    Is this possible in OAF? If so please shed some light as to how to map XML File to VO.
    If this is not possible then please let me know the other way. I have to do this inside the oaf.
    Thank you,

    Can someone please let me know if this is possible in OAF?

  • How to define a schema for fixed length consisting of multiple records of different types having header detail and footer at positions 22 and 23 namely having 10 for header 20 for detail and 30 for footer

    how to define a schema for fixed length consisting of multiple records of different types having header detail and footer at positions 22 and 23 namely having 10 for header ,20 for detail and 30 for footer.
    here is the sample file
    DDWTYBILL13092502572 1000000112\\NHLSFS\ORACLE\ORACLE\BILLING\VERIFY\            2013/09/25 01:19:08 BILLEND     
    DDWTYBILL13092502572 2000000212PRIVATE             PRIVATE             STY5572142     010700         INV                              12STYD000789                  02-AUG-20130000010472      STY       STY       1100611006MGIT                91  NNM    DIMPHANA,CN,CELESTE NERINA                                                                                                        09-JAN-1964                              TYG       A2        DR DU PREEZ                                                                                         5602181             63301345       TB731543                                           Suspect TB ?CA, (L) EMPIEEM                                           Ward A2                                           TYGERBERG HOSPITAL                                                                                  Z03.0                                                       Z03.9                                                          05-AUG-201305-AUG-201324-SEP-2013FEND    113.60
    DDWTYBILL13092502572 2000000312PRIVATE             PRIVATE             STY5572149     010700         INV                              12STYD000789                  02-AUG-20130000010472      STY       STY       1100611006MGIT                91  NNM    DIMPHANA,CN,CELESTE NERINA                                                                                                        09-JAN-1964                              TYG       A2        DR DU PREEZ                                                                                         5602181             63301345       TB731548                                           Empyema BPF                                                           Ward A2                                           TYGERBERG HOSPITAL                                                                                  Z03.9                                                       Z03.9                                                          05-AUG-201305-AUG-201324-SEP-2013FEND    113.60
    DDWTYBILL13092502572 2000000412PRIVATE             PRIVATE             STY5572351     010700         INV                              12STYD000789                  02-AUG-20130000010472      STY       STY       1100611006MGIT                91  NNM    DIMPHANA,CN,CELESTE NERINA                                                                                                        09-JAN-1964                              TYG       A2        DR DU PREEZ                                                                                         5602181             63301345       TB731584                                           Suspect TB ?EMPIEEM, ?CA                                              Ward A2                                           TYGERBERG HOSPITAL                                                                                  Z03.0                                                       Z03.9                                                          05-AUG-201305-AUG-201324-SEP-2013FEND    113.60
    DDWTYBILL13092502572 2000000512PRIVATE             PRIVATE             STY5572352     010700         INV                              12STYD000789                  02-AUG-20130000010472      STY       STY       1100611006MGIT                91  NNM    DIMPHANA,CN,CELESTE NERINA                                                                                                        09-JAN-1964                              TYG       A2        DR DU PREEZ                                                                                         5602181             63301345       TB731585                                           Suspect TB ?EMPIEEM, ?CA                                              Ward A2                                           TYGERBERG HOSPITAL                                                                                  Z03.0                                                       Z03.9                                                          05-AUG-201305-AUG-201324-SEP-2013FEND    113.60
    DDWTYBILL13092502572 2000000612MAJOR               MAJOR               STY5577530     010700         INV                              12ZTYG000009                  02-AUG-20130000010472      STY       STY       1100611006MGIT                91  NNS    ZOZI,S,SIYAMBONGA                                                                                                                 27-MAR-2010                              TYG       D3        DR MAHOMED                                                                                          5602181             113799662      TB731663                                           Lymphadenitis                                                         Ward D3                                           TYGERBERG HOSPITAL                                                                                  I88.9                                                       Z03.9                                                       H1 07-AUG-201307-AUG-201324-SEP-2013MEND     58.52
    DDWTYBILL13092502572 2000000712MAJOR               MAJOR               STY5577537     010700         INV                              12ZTYG000009                  06-AUG-20130000010472      STY       STY       1100611006MGIT                91  NNS    DLAMINI,N,NTLANTLA                                                                                                                09-OCT-1976                              TYG       F1        DR WZESE                                                                                            5602181             135524676      TB731666                                           Suspect TB                                                            Ward F1                                           TYGERBERG HOSPITAL                                                                                  Z03.0                                                       Z03.9                                                       H1 07-AUG-201314-AUG-201324-SEP-2013MEND     58.52
    DDWTYBILL13092502572 30003034120000003032END

    You can create an nXSD using Native Format Builder and use lookAhead attribute to read values at specific position and use that as the choice. You can find an example here
    http://docs.oracle.com/cd/E11036_01/integrate.1013/b28994/nfb.htm#BGBBAJFD

  • A better way of building the fixed-length String

    I created the following code to build a fixed length string. I checked other posts for the same topic, but I found mine is better. The code below converts a double numeric value to a fixed length string with padding of white spaces (or other types):
    Line 15 initializes the char array to while space; line 13 creates a character array; lines 17, 18 copy the array created in line 13 to the one initialized in line 15.
    Any comment is welcomed.
    1. import java.text.*;
    2.
    3. public class jformat {
    4.
    5. public static void main(String[] args) {
    6.
    7. char[] fb=new char[14];
    8. char[] tb;
    9. int c, f;
    10. DecimalFormat fmt=new DecimalFormat("########0.00");
    11. double dbl=12345.66;
    12.
    13. tb=fmt.format(dbl).toCharArray();
    14.
    15. for(c=0; c<fb.length; c++) fb[c]=' ';// this line is not required in JDK 1.5
    16.
    17. for(c=tb.length-1, f=fb.length-1; c>=0; c--, f--){
    18.     fb[f]=tb[c];
    19. }
    20. System.out.println(new String(fb));
    21.
    22. }
    23.
    24. }

    Here's a couple of alternatives. One uses a StringBuffer and the second, for Java 5 only, uses the Formatter capabilities.
    import java.text.DecimalFormat;
    public class jformat
        public static void main(String[] args)
            int fieldSize = 14;
            double dbl = 12345.66;
            String dblString = new DecimalFormat("0.00").format(dbl);
            StringBuffer sb = new StringBuffer();
            for (int j = 0; j < fieldSize - dblString.length(); j++)
                sb = sb.append(' ');
            System.out.println(sb.append(dblString).toString());
             *  The above code works in Java versions 1.3, 1.4, and 1.5.
             *  However, 1.5 provides the Formatter class, and the single
             *  line below can replace the preceeding code.
            System.out.printf("%14.2f%n", dbl);
    }

  • ABPA  code to compress table into a table of fixed-length strings

    Hi all,
    I need to compress a large, sparse table into a table of fixed-length strings in my ABAP code, and then uncompress it.  Is there a standard format or facility to do this?  I seem to remember a function that does this, but any other hints would be appreciated.
    Thank you in advance,
    Sunny

    For example, given a table like:
    Column0    Column1    Column2
    abc            C               !@#&@
                     P
    def                              $*(
    Compress it into a table consisting of one column of fixed-length strings, like:
    Column0
    0abc1C2
    !@#&@01
    P20def1
    2$*(
    ..and then uncompress it back out to the original table.
    Sunny

  • How to build a fixed-length string representing an integer

    Hi,
    I would like know how can I use the API to get a String representing an int with fixed length. I mean, I would like something similar to Integer.parseInt(), but I need to set the length of that String in such a way that, for instance, if I need the String to be 5 character long, and the int is 37, the String would be 00037
    Thanks in advance and best regards,
    Miguel ?ngel

    I wrote pad() methods in my string helper that can be used for this purpose.
    In particular, you want to prepad with '0' to a length of 5:
    com.Ostermiller.StringHelper.prePad(Integer.toString(37), 5, '0');
    http://ostermiller.org/utils/StringHelper.html

  • Fixed Length Strings.

    Hi ,
       I have to download a longtext from SAP.
       The length of the longtext has to be fixed 5000 ie...Even if the length of the longtext from SAP is 1000 remaining 4000 spaces should get appended.
      I am moving the long text into a variable l_line which I have declared in the following way L_LINE(5000).
       But after moving the longtext into this variable it still shows the actual length of the longtext whereas I need 5000 fixed length.
      How to solve it.
    Thanks,

    Hi Renu Raj,
    Just WRITE the LONG TEXT again in to the variable with RIGHT
    JUSTIFIED. It will prefixes SPACEs and STRLEN will return 5000.
    i.e. as follows,
      WRITE : L_LINE TO L_LINE RIGHT-JUSTIFIED.
      CNT_LEN = STRLEN( L_LINE ).
    Now the CNT_LEn will have '5000'.
    While you process the LONG TEXT, just CONDENSE it and go ahead. It will remove LEADING SPACEs.
    i.e. as follows,
      CONDENSE L_LINE.
      CNT_LEN = STRLEN( L_LINE ).
    Now CNT_LEN will have an actual length.
    Regards,
    R.Nagarajan.
    We can -

  • How to map an array to fixed fields using Biztalk mapper

    I need to remap an array of objects like this:
        <Root>
          <ListOfObjs>
            <Obj>
              <Attr1>0000</Attr1>
              <Attr2>Hello!</Attr2>
            </Obj>
            <Obj>
              <Attr1>1111</Attr1>
              <Attr2>Hello1!</Attr2>
            </Obj>
          </ListOfObjs>
        </Root>
    in an output like this:
            <Root>
                <Obj1_Attr1>0000</Obj1_Attr1>
                <Obj1_Attr2>Hello!</Obj1_Attr2>
                <Obj2_Attr1>1111</Obj2_Attr1>
                <Obj2_Attr2>Hello1!</Obj2_Attr2>
            </Root>
    So in my XSD schema I have something like this:
    Schema Input
                               <xs:element name="Root">
                                <xs:complexType>
                                 <xs:sequence>
                                  <xs:element name="ListOfObjs">
                                   <xs:complexType>
                                    <xs:sequence>
                                     <xs:element name="Obj">
                                      <xs:complexType>
                                       <xs:sequence>
                                        <xs:element name="Attr1">
                                         <xs:simpleType>
                                          <xs:restriction base="xs:string">
                                           <xs:minLength value="1"/>
                                           <xs:maxLength value="50"/>
                                          </xs:restriction>
                                         </xs:simpleType>
                                        </xs:element>
                                       <xs:element name="Attr2">
                                        <xs:simpleType>
                                          <xs:restriction base="xs:string">
                                           <xs:minLength value="1"/>
                                           <xs:maxLength value="50"/>
                                          </xs:restriction>
                                         </xs:simpleType>
                                        </xs:element>
                                       </xs:sequence>
                                      </xs:complexType>
                                     </xs:element>
                                    </xs:sequence>
                                   </xs:complexType>
                                  </xs:element>
    Schema output
                                     <xs:element name="Root">
                                      <xs:complexType>
                                       <xs:sequence>
                                        <xs:element name="Obj1_Attr1">
                                         <xs:simpleType>
                                          <xs:restriction base="xs:string">
                                           <xs:minLength value="1"/>
                                           <xs:maxLength value="50"/>
                                          </xs:restriction>
                                         </xs:simpleType>
                                        </xs:element>
                                       <xs:element name="Obj1_Attr2">
                                        <xs:simpleType>
                                          <xs:restriction base="xs:string">
                                           <xs:minLength value="1"/>
                                           <xs:maxLength value="50"/>
                                          </xs:restriction>
                                         </xs:simpleType>
                                        </xs:element>
                                        <xs:element name="Obj2_Attr1">
                                        <xs:simpleType>
                                          <xs:restriction base="xs:string">
                                           <xs:minLength value="1"/>
                                           <xs:maxLength value="50"/>
                                          </xs:restriction>
                                         </xs:simpleType>
                                        </xs:element>
                                        <xs:element name="Obj2_Attr2">
                                        <xs:simpleType>
                                          <xs:restriction base="xs:string">
                                           <xs:minLength value="1"/>
                                           <xs:maxLength value="50"/>
                                          </xs:restriction>
                                         </xs:simpleType>
                                        </xs:element>
                                       </xs:sequence>
                                      </xs:complexType>
                                     </xs:element>
    In addiction I have to evaluate every single value because when I found some conditions (like if value=0000 output should be NULL).
    What would be the best way to do it? I'm thinking to develop a custom functoid but I'm not sure it would be the best way, probably it could be done even using XSLT inline transforms, can you point me in the best direction?
    Thank you

    Hi,
    You cannot directly map an array output to any single field in BizTalk mapper.
    Couple of options :
    1) create
    the Xslt or inline C# code
    Refer: 
    http://seroter.wordpress.com/2008/10/07/splitting-delimited-values-in-biztalk-maps/
    2) Shankycheil has
    provided a solution to similar requirement in the below link, u can also refer that.
    https://social.msdn.microsoft.com/Forums/en-US/55ec472d-4f34-4057-b1c6-0e50740f0f6e/how-to-itterate-string-array-values-in-biztalk-mapper?forum=biztalkgeneral
    Rachit
    Thank you, I already seen both posts, but I'm not sure they are what I need or I can't understand well how to use them.
    Speaking about the first solution, as I told before, in the example I should have an array already formed and delimited by a char (something like "obj1attr1-obj1attr2-ob2attr1-obj2attr2". In this situation probably this example could be a good
    point to start from, but how to transform my complex input object in a similar formatted string?
    About the second I don't understand well what is the working solution that they have adopted. Is the 4 steps solution suggested by  Shankycheil? If yes, how can I loop between all array elements and extract all their values?

  • How to map XML to Web Dynpro context nodes?

    Hi All,
    Could anyone tell how xml string can be bound to context nodes ? In my requirement i need to serialize context nodes value to string and deserialize it back to nodes for implementing back naviagtion between views.
    I didnt see much threads achieving this giving details on class cl_wdr_xml_convert_util and methods if_wd_client_conversion_util~string_to_struct.
    I am using wd_context->to_xml to convert into xml.
    From this format, i want to bind it back to context  node.
    When i use this below approch i get short dumb.
    Serialization to xml:
    lv_data_string = wd_context->to_xml( ).
    Deserialization:
      DATA lv_typedescr           TYPE REF TO cl_abap_typedescr.
      FIELD-SYMBOLS:
                     <fs_data>    TYPE ANY TABLE.
      CALL METHOD cl_abap_typedescr=>describe_by_object_ref
        EXPORTING
          p_object_ref         = wd_context
        RECEIVING
          p_descr_ref          = lv_typedescr
        EXCEPTIONS
          reference_is_initial = 1
          OTHERS               = 2.
       try.
      CALL METHOD cl_wdr_xml_convert_util=>if_wd_client_conversion_util~string_to_struct
        EXPORTING
          in            = lv_data_string
          typedescr = lv_typedescr
        IMPORTING
          data      =  <fs_data>
      CATCH cx_wdr_conversion_exception into lo_err .
      lv_exp = lo_err->get_text( ).
    ENDTRY.
      wd_context->bind_table( values = <fs-data>.
    Using this way, i get a short dumb as assert statement is failed as value for  typedescr->type_kind is '*'.
    method if_wd_client_conversion_util~string_to_struct.
      assert typedescr->type_kind = cl_abap_typedescr=>typekind_struct1
          or typedescr->type_kind = cl_abap_typedescr=>typekind_struct2.
      raise exception type cx_wdr_conversion_exception
        exporting textid = cx_wdr_conversion_exception=>illegal_type.
    On debugging changing this value to required also made no difference, as no value could be assigned to the field symbol.
    Suggest a soution to do this.

    Hi Thomas,
    Thanks for your replies.
    I have corrected it, but the field symbol is empty and while debugging it says data type is incorrect.
    code:
      FIELD-SYMBOLS:
                     <fs_data>    TYPE ANY TABLE.
    data:       lsbp type ZXBPCENTRAL,
                   go_ref type ref to data.
    CALL METHOD cl_abap_typedescr=>describe_by_data " ( before it was describe_by_object_ref)
    EXPORTING
    p_data = lsbp
    receiving
    p_descr_ref = lv_typedescr.
    try.
    CALL METHOD cl_wdr_xml_convert_util=>if_wd_client_conversion_util~string_to_struct
    EXPORTING
    in = lv_data_string
    typedescr = lv_typedescr
    IMPORTING
    data = go_ref "<fs_data>
    CATCH cx_wdr_conversion_exception into lo_err .
    lv_exp = lo_err->get_text( ).------> Here the error says " Invalid data type and hence, there is no data.
    ENDTRY.
    assign go_ref->* to <fs_data>.
    I am still looking for solution and thanks a lot ....

  • How to map XML file to various of object in the RFC

    hello
    I recieve XML file (not devided to elements, but XML file)'
    and I would like to map it to a RFC that has various object.
    I there a way to do it?
    if it involve a java code, does any one has a written code example?
    THX
    Kfir

    thanks for the reply
    my source XML response will be looking something like this (it will be reponsed in a long string):
    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    <SOAP-ENV:Header>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <status>
    <retCode>00</retCode>
    <retCodeDesc>OK</retCodeDesc>
    <rRobjectId>09002347802d2981</rRobjectId>
    <rFileSize>7</rFileSize>
    <rTotalPages>1</rTotalPages>
    </status>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    my RFC is:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:sap-com:document:sap:rfc:functions" targetNamespace="urn:sap-com:document:sap:rfc:functions">
    <xsd:element name="ZRFC_SET_DOCUMENT.Response">
    <xsd:complexType>
    <xsd:all>
    <xsd:element name="RETCODE" type="xsd:string" minOccurs="0" />
    <xsd:element name="RETCODEDESC" type="xsd:string" minOccurs="0" />
    <xsd:element name="RFILESIZE" type="xsd:string" minOccurs="0" />
    <xsd:element name="RROJECTID" type="xsd:string" minOccurs="0" />
    <xsd:element name="RTOTALPAGES" type="xsd:string" minOccurs="0" />
    </xsd:all>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

  • How to render h:outputText of fixed length inside h:panelGrid

    Hi,
    I am using h:outputText inside h:panelGrid.
    But while renderring output text, whatever is the text length , the width of the h:outPutText should be same.
    I am getting the results diplayed as below if length varies.
    xxxxx     126612 AAAAAAA
    yyyyy     214 BBBBBB
    zz 1234 CCCC
    Pls help me...

    sorry it's not working...
    Here is my code snippet...
    <h:dataTable id="list1" var="row" value="#{loanAccountDTOList}"
    columnClasses="table-column-left2" width="100%" rendered="#{!empty loanAccountDTOList}" >
         <h:column>
    <h:panelGrid columns="7" columnClasses="bs1,bs2,bs3,bs4,bs5,bs6,bs7" width="100%">
              <h:outputText value="#{row.sortCode}"/>
              <h:outputText value="#{row.accountNumber}" style="bs11" />
              <h:outputText value="CAP"/>
              <h:outputText value="13005678900111D"/>
              <h:outputText value="111111111111300"/>
              <h:outputText value="51,1111111500Normal"/>
              <h:outputText value="30062007"/>
         </h:panelGrid>
         <h:panelGrid columns="1" width="90%">
              <h:outputText value="ForeCastBalance : 10,000D"/>
         </h:panelGrid>                    
         </h:column>
    </h:dataTable>
    here bs1, bs2 are the styles applied for the output text.If i change the widths in the respective style, it's not reflecting...What might be the mistake....
    I am facing lot of problems with formatting ..Pls help me out..
    This is how i am able to display data....
    300006 12345678 CLAIRS .....
    300008 123 CAP.....
    300009 123456789999 CAP...
    I need to format it properly asbelow.
    300006 12345678 CLAIRS
    300008 123 CAP
    300009 123456789999 CAP

  • How to Map XML data with XSD Schema in JAXB

    Hello,
    I am very much new to JAXB.
    I am in need of someone help to go further in my dev.
    I am having an XSD and i could able to do marshall and unmarshall using JAXB.
    My problem is...
    Consider followings are my Schema...
    - <person id="general" help="USER.DOM.HELP.GENERAL" label="USER.DOM.LABEL.GENERAL" access="READWRITE">
    <attribute id="Name" mandatory="true" type="STRING" access="READONLY" widget="NONE" />
    <attribute id="login" label="USER.LABEL.LOGIN" help="USER.HELP.LOGIN" regexp="[A-a]" type="STRING" summary="true" access="WCREATE_RUPDATE" widget="TEXTFIELD" />
    <attribute id="firstname" summary="true" label="USER.LABEL.FIRSTNAME" help="USER.HELP.FIRSTNAME" type="STRING" regexp="[A-a]" access="READWRITE" widget="TEXTFIELD" />
    In this example a person contains set of attributes... some are mandatory(Name)...
    In my application i will unmarshall the the schema file and show in GUI as a set of attributes when the operator want to create a person. And its very well working.
    Now say for example, i am requesting my server to show all the created persons and its showing. when i click on the particular person the GUI will place the request to the server to get the corresponding date for the selected person.
    But the response contains only the mandatory attribute.. i mean Name.... this may be because of the way my server working. So now i want to show the operator all the set of attributes for that person with the Name.
    I mean i need to merge the schema with me resultant data and show it in the GUI.
    My result is in the form of xml stream. And i will convert my schema also in the form of XML...
    Now i need to merge both of this XMl and need to present in the GUI...
    Any help please...
    Thank You!!!

    Still i am not getting any reply :(

  • How to Map XML Summary comments/tags from OpenScript into OTM through Java

    Hi,
    I would like to know if there is a possibility of copying the XML Summary comments/tags of a test case method in Openscript as test action and expected results of a test case in OTM
    The goal/reason is have to all the test case steps/actions and expected results and the corresponding automation code at one place so that maintenance is easy.
    Something like a testcase method below from openscript
    <Summary>
    <testproperties>
    <testcaseTiltle =" Automation of Expense Bill ">
    </testcaseTitle>
    <testcaseId>
    </testcaseId>
    <testAction>
    Click Menu -> Main Menu -> Expense
    </test action>
    <expectedResult>
    Expense form should be opened successfully
    </expectedResult>
    <testAction>
    Enter the Expense Amount and Date
    Click Save
    </testAction>
    <expectedResult>
    Expense for a given date should be submitted successfully
    </expectedResult>
    </testproperties>
    </Summary>
    {{@TestCaseMethod}}
    public void submitExpense()
    ....... automation code......
    }

    Did you find a way?? I need to do the same thing!!

  • How to map XML to database object ?

    Hello,
    We are trying to convert XML file into XMLType object and then to our custom object type using registered XSD definition. So we doing this : clob with xml -> XMLObject -> our MMS_T object.
    The problem we experienced with transfering values of "type" and "status" attributes to object values MMS_T.TYPE and MMS_T.STATUS. Note that types MMS_T and ERROR_T are automatically created during schema
    (XSD) registration. See and try Listing 1.
    The second Listing contains anonymous pl/sql block with our testcase, please run it after registering schema. The output You will get should look like this one :
    Schema based
    Well-formed
    <?xml version="1.0" encoding="UTF-8"?>
    <mms-provisioning xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xdb="http://xmlns.oracle.com/xdb" type="subscription"
    status="error">
    <error code="1">Some error</error>
    <serviceID>iDnes</ser
    Type:,Status:,Error:1-Some error,ServiceID:iDnes,Method:SMS,MSISDN:+420602609903
    The problem is visible on the last line, where "Type" and "Status" object attributes should have its values that should come from XML, but they haven't. Where we were wrong ?
    Please help,
    Thanks & Regards,
    Radim.
    Note
    ====
    When we are trying to do xml.schemaValidate() in our example, it raises folowong errors :
    ORA-31154: invalid XML document
    ORA-19202: Error occurred in XML processing
    LSX-00310: local element or attribute should be namespace qualified
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 27
    Listing 1
    =========
    declare
    xsd clob:=
    '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    xdb:mapStringToNCHAR="false"
    xdb:mapUnboundedStringToLob="false"
    xdb:storeVarrayAsTable="false"
    >
    <xs:element name="mms-provisioning" xdb:SQLType="MMS_T">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="error" minOccurs="0" xdb:SQLName="ERROR" xdb:SQLType="ERROR_T">
    <xs:complexType>
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="code" type="xs:decimal" use="required" xdb:SQLName="CODE" xdb:SQLType="NUMBER"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    </xs:element>
    <xs:element name="serviceID" type="xs:string" xdb:SQLName="SERVICEID" xdb:SQLType="VARCHAR2"/>
    <xs:element name="method" type="xs:string" xdb:SQLName="METHOD" xdb:SQLType="VARCHAR2"/>
    <xs:element name="msisdn" type="xs:string" xdb:SQLName="MSISDN" xdb:SQLType="VARCHAR2"/>
    </xs:sequence>
    <xs:attribute name="type" type="type_t" use="required" xdb:SQLName="TYP" xdb:SQLType="VARCHAR2"/>
    <xs:attribute name="status" type="status_t" use="required" xdb:SQLName="STATUS" xdb:SQLType="VARCHAR2"/>
    </xs:complexType>
    </xs:element>
    <xs:simpleType name="status_t">
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    <xs:enumeration value="new"/>
    <xs:enumeration value="pending"/>
    <xs:enumeration value="subscribed"/>
    <xs:enumeration value="error"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="type_t">
    <xs:restriction base="xs:string">
    <xs:maxLength value="30"/>
    <xs:enumeration value="subscription"/>
    <xs:enumeration value="unsubscription"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:schema>';
    begin
    dbms_XMLSchema.RegisterSchema (
    SchemaURL => 'http://www.eurotel.cz/xsd/mms-provisioning.xsd', SchemaDoc => xsd
    end;
    Listing 2
    =========
    declare
    o mms_t;
    doc clob :=
    '<?xml version="1.0" encoding="UTF-8"?>
    <mms-provisioning type="subscription" status="error">
    <error code="1">Some error</error>
    <serviceID>iDnes</serviceID>
    <method>SMS</method>
    <msisdn>+420602608696</msisdn>
    </mms-provisioning>';
    xml XMLType;
    begin
    xml := XMLType.createXML(XMLData => doc,schema => 'http://www.eurotel.cz/xsd/mms-provisioning.xsd'); --
    if xml.isSchemaBased() = 1 then
    dbms_output.put_line('Schema based');
    else
    dbms_output.put_line('Non-Schema based');
    end if;
    if xml.isFragment() = 1 then
    dbms_output.put_line('Fragment');
    else
    dbms_output.put_line('Well-formed');
    end if;
    --Crashes with errors
    --xml.schemaValidate();
    dbms_output.put_line(substr(xml.getstringval(),1,255));
    xml.toObject(o,schema => 'http://www.eurotel.cz/xsd/mms-provisioning.xsd', element => 'mms-provisioning');
    dbms_output.put_line(
    'Type:'||o.typ||
    ',Status:'||o.status||
    ',Error:'||o.error.code||'-'||o.error.sys_xdbbody$||
    ',ServiceID:'||o.serviceid||
    ',Method:'||o.method||
    ',MSISDN:'||o.msisdn);
    end;
    /

    thanks for the reply
    my source XML response will be looking something like this (it will be reponsed in a long string):
    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    <SOAP-ENV:Header>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <status>
    <retCode>00</retCode>
    <retCodeDesc>OK</retCodeDesc>
    <rRobjectId>09002347802d2981</rRobjectId>
    <rFileSize>7</rFileSize>
    <rTotalPages>1</rTotalPages>
    </status>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    my RFC is:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:sap-com:document:sap:rfc:functions" targetNamespace="urn:sap-com:document:sap:rfc:functions">
    <xsd:element name="ZRFC_SET_DOCUMENT.Response">
    <xsd:complexType>
    <xsd:all>
    <xsd:element name="RETCODE" type="xsd:string" minOccurs="0" />
    <xsd:element name="RETCODEDESC" type="xsd:string" minOccurs="0" />
    <xsd:element name="RFILESIZE" type="xsd:string" minOccurs="0" />
    <xsd:element name="RROJECTID" type="xsd:string" minOccurs="0" />
    <xsd:element name="RTOTALPAGES" type="xsd:string" minOccurs="0" />
    </xsd:all>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

  • How to define an array of fixed length

    hello, i have a basic application in which i need to define an array of size 19; and add 19 elements to it. 
    Once 19 elements have been written to the array, i want to start writing to the array from index 0.
    It's like in C language, where-in you define array_size in init, and once the array is full, you overwrite the 1st element and so on.
    i hope my question makes sense...
    any help is appreciated.
    Now on LabVIEW 10.0 on Win7

    Hi Check out these VIs as per your discription. You can try your own method. 
    PBP (CLAD)
    Labview 6.1 - 2014
    KUDOS ARE WELCOMED.
    If your problem get solved then mark as solution.
    Attachments:
    Your VI.vi ‏10 KB
    Fill Array.vi ‏16 KB

Maybe you are looking for