Preserving whitespace in XML fields?

I have a requirement to preserve the character positioning within an XML field. I am using the standard XML/HTTP port for output from the ALE interface. One of the fields contains multiple spaces within the data. It appears the default setting of the XML processor is to condense these spaces into a single space. The xsl:preserve-space pre-processor command should preserve the whitespace, Does anyone know how to configure the SAP XML processor to do this?   Thanks!
We are using basis 6.20

There's a setting in Flash's XML object called ignoreWhitespace that you need to set to false (by default its true).
Something like this should work:
function convertStringToXML(source:String):XML
     var originalSettings:Object = XML.settings();
     try
          XML.ignoreWhitespace = false;
          var xmlTree:XML = new XML(source);
     finally
          XML.setSettings(originalSettings);
     return xmlTree;
- robin

Similar Messages

  • Preserve whitespace in xml parsing

    Hi,
    I am using PL.SQL to parse XML documents using DBMS_XMLDOM..
    and using XMLTYPE...
    Below is the code...
    set serveroutput on
    declare
         var_xmltype     XMLType;
         doc          dbms_xmldom.DOMDocument;
         ndoc          dbms_xmldom.DOMNode;
         docelem          dbms_xmldom.DOMElement;
         node          dbms_xmldom.DOMNode;
         l_loop_group_8_node_list          dbms_xmldom.DOMNodelist;
         l_loop_group_8_node_list_count          number(10);
         l_loop_group_8_sub_node_list          dbms_xmldom.DOMNodelist;
         l_lin_segment_node          dbms_xmldom.DOMNode;
         l_lin_segment_child_node     dbms_xmldom.DOMNode;
         l_loop_group_8_count number(10);
         p_clob_message CLOB;
         l_clob_message CLOB;
         CURSOR c is SELECT * from emx_message_storage where emx_message_id = '170615';
    begin
    for r in c loop
    p_clob_message := r.message_clob;
    end loop;
         var_xmltype := xmltype (p_clob_message);
         -- Create DOMDocument handle
         doc :=     dbms_xmldom.newDOMDocument (var_xmltype);
         ndoc := dbms_xmldom.makeNode (doc);
         docelem := dbms_xmldom.getDocumentElement (doc);
         -- Access Loop-Group_8 Node:
         l_loop_group_8_node_list := dbms_xmldom.getElementsByTagName(docelem, 'Loop-Group_8');
         l_loop_group_8_node_list_count := dbms_xmldom.getlength (l_loop_group_8_node_list);
         --dbms_output.put_line ('Number of Loop-Group_8 Nodes =' || l_loop_group_8_node_list_count);
         FOR l_ka IN 0..(l_loop_group_8_node_list_count-1) LOOP
              -- Get ith Loop-Group_8 node.
              node := dbms_xmldom.item (l_loop_group_8_node_list, l_ka);
              l_loop_group_8_sub_node_list := dbms_xmldom.getChildNodes (node);
              -- Get Segment-LIN
              l_lin_segment_node := dbms_xmldom.item (l_loop_group_8_sub_node_list,0);
              l_lin_segment_child_node := dbms_xmldom.getFirstChild (l_lin_segment_node);
              --dbms_output.put_line ('Before,' || dbms_xmldom.getNodeName (l_lin_segment_child_node) || ' = '  || dbms_xmldom.getNodeValue (DBMS_XMLDOM.getFirstChild(l_lin_segment_child_node)));
              dbms_xmldom.setNodeValue (DBMS_XMLDOM.getFirstChild(l_lin_segment_child_node), l_ka+1);
              --dbms_output.put_line ('After,' || dbms_xmldom.getNodeName (l_lin_segment_child_node) || ' = '  || dbms_xmldom.getNodeValue (DBMS_XMLDOM.getFirstChild(l_lin_segment_child_node)));
         END LOOP;
         DBMS_LOB.CreateTemporary(l_clob_message, TRUE);
         dbms_xmldom.writeToClob (doc, l_clob_message);
         dbms_xmldom.freeDocument(doc);
         update emx_message_storage set message_clob = l_clob_message where emx_message_id = '149329';
    end;
    The code works fine.. except for the fact that when in the input XML message i get one element as
    <Element-3042> </Element-3042>
    it converts it to
    <Element-3042/>
    The whitespace is removed...
    I tried using the xml parser method...and whitespacepreserver optioin...but it creates some extra lines...
    Which i dont want.
    Please suggest.
    Thanks,
    Rosh

    Difficult to read non-formatted code, so pardon not looking at it and trying to spot the problem/error. However, whitespaces seem to work fine for me (tested on 10.2.0.4). Note the resulting XML for a string value, a whitespace value and a null.
    SQL> create table foo_tab( attr1 number, attr2 varchar2(10) );
    Table created.
    SQL>
    SQL> insert into foo_tab values( 1, 'test 123' );
    1 row created.
    SQL> insert into foo_tab values( 2, ' ' );
    1 row created.
    SQL> insert into foo_tab values( 3, null );
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL> col XML format a50
    SQL> select
      2          XmlElement( "Row",
      3                  XmlForest(
      4                          attr1 as "Name",
      5                          attr2 as "Value"
      6                  )
      7          )               as XML
      8  from       foo_tab
      9  /
    XML
    <Row><Name>1</Name><Value>test 123</Value></Row>
    <Row><Name>2</Name><Value> </Value></Row>
    <Row><Name>3</Name></Row>
    SQL>

  • Preserve whitespace in XML element value

    I am trying to add XML element with value prefix with white space:
      ex_doc->create_simple_element(
          name = 'VALUEPART1'
          value = '          BQ/XWKB-99-5-9999-2'
          parent = lo_ele_e1bpparex_bape_vbak ).
    But when the XML is create, the white space is removed! How can I preserve the white space???
    <VALUEPART1>BQ/XWKB-99-5-9999-2</VALUEPART1>
    What i want is:
    <VALUEPART1>          BQ/XWKB-99-5-9999-2</VALUEPART1>
    Appreciate for any help

    Hi,
    if you had been using XSLT instead, I would have said 'remove the strip-space element or alter it according to your needs'...
    Please provide what class you are using, else it's too generic..
    regards, Lukas

  • Using configuration tool, how can I preserve whitespace in name field

    I created script to get the name using the business object and don't want remove spaces from name field.

    I would suggest raising a SR for this with Customer Support as it looks like issues around language translation

  • How do I Load a clob from an XML field in an XMLTYPE using XMLTABLE ?

    I am trying to load data into a CLOB from a XML field using XMLTABLE.
    I have a SUMMARY xml field with over 100 K of data (potentialy)
    and I can load all the other datatype fields to columns but can not load the xml fields over 4000 characters.
    example
    First I create a table of XMLTYPE. I need to sqlload new files in at regular intervals.
    Create table WEB_XML of XMLTYPE;
    Then I create my relational table....
    create table WEB_WORKING
    request_id varchar(10),
    ref_number varchar(20),
    summary clob
    The I use the .ctl file to sqlload the xml data in
    LOAD DATA
    INFILE *
    INTO TABLE WEB_XML
    append
    xmltype(XMLDATA)
    ext_fname filler char(90),
    XMLDATA LOBFILE(ext_fname) TERMINATED BY EOF
    BEGINDATA
    XMLFILE1.xml
    After loading the WEB_XML table using sqlldr, I try to load my relational table using XMLTable
    INSERT into WEBBAR_WORKING
    request_id ,
    ref_number ,
    summary
    SELECT X.* FROM WEB_XML P2,
    XMLTable ( '//Request//REQUESTVIEW'
    PASSING P2.object_value
    COLUMNS
    "request_id" VARCHAR(10) PATH 'REQUEST_ID',
    "ref_number" VARchar(20) PATH 'REF_NUMBER',
    "SUMMARY" clob PATH 'SUMMARY'
    ) AS X;
    This gives an error saying its not expecting clob
    My XML looks somthing like
    -<Request>
    -<REQUESTVIEW>
    <REQUEST_ID>3140</REQUEST_ID>
    <ref_number>2003-04-02</RECEIVED_DATE>
    <SUMMARY>
    OVER 100 K of data
    </SUMMARY>
    </REQUESTVIEW>
    </Request>

    ok
    that helped lot, im getting there however some more help please
    This SQL
    SELECT request_id, recieved_by, X.SUMMARY.getClobVal()
    FROM WEB_XML P2,
    XMLTable
    '//Request//REQUESTVIEW'
    PASSING P2.object_value
    COLUMNS
    "request_id" VARCHAR(10) PATH 'REQUEST_ID',
    "received_by" VARCHAR(10) PATH 'RECEIVED_BY',
    "SUMMARY" xmltype PATH 'SUMMARY'
    ) AS X;
    SELECT request_id, recieved_by, X.SUMMARY.getClobVal()
    ERROR at line 1:
    ORA-00904: "RECIEVED_BY": invalid identifier
    If I use the X.request_id, X.received_by ......
    i get the error message
    Package or function is in aan invalid state.
    But this SQL was successful in getting the clob by itself but with the XML tgs around it still, how do I strip the XML tags from around this result ?
    SELECT X.SUMMARY.getClobVal()
    FROM WEBBAR_XML P2,
    XMLTable
    '//Request//REQUESTVIEW'
    PASSING P2.object_value
    COLUMNS
    "SUMMARY" XMLTYPE PATH 'SUMMARY'
    ) AS X;
    ----------------------------------------------------------

  • Unable to modify a XML node which is a SimpleType using a Typed XML field.

    Hello,
    I have an XSD schema that uses SimpleTypes.  When I attempt to modify a node in an Schema typed XML field, which has a schema using simpletypes, I receive the error:  XQuery [modify()]: The value is of type "xs:string", which is not a
    subtype of the expected type "<anonymous>"
    To reproduce the problem use the following information:
    SCHEMA:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:ns1="http://testschema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" targetNamespace="http://testschema" elementFormDefault="qualified" attributeFormDefault="unqualified" vc:minVersion="1.1">
    <xs:element name="Test">
    <xs:annotation>
    <xs:documentation>Comment describing your root element</xs:documentation>
    </xs:annotation>
    <xs:complexType>
    <xs:sequence>
    <xs:element name="SAPCode">
    <xs:annotation>
    <xs:documentation>Customer Number for Delivery Organization</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="OrganizationName">
    <xs:annotation>
    <xs:documentation>Name of Organization</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="AttentionTo" minOccurs="0">
    <xs:annotation>
    <xs:documentation>Attention to Recepient for the delivery</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="150" fixed="false"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="Address1">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="150"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="Address2" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="150"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="Address3" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="150"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="City">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="StateProvince">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="PostalCode">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="Country">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="2"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="Phone" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="50"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmailAddress" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="200"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    The T-SQL That produces the error:
    DECLARE
    @vx_Test xml (CONTENT [dbo].[Test]),
    @vs_ShipToAttentionTo NVARCHAR(50)
    SET
    @vx_Test = N'<ns0:Test xmlns:ns0="http://testschema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ns0:SAPCode>1234567890</ns0:SAPCode>
    <ns0:OrganizationName>Test Org</ns0:OrganizationName>
    <ns0:AttentionTo>Test Person</ns0:AttentionTo>
    <ns0:Address1>123 Main Street</ns0:Address1>
    <ns0:City>Test City</ns0:City>
    <ns0:StateProvince>IL</ns0:StateProvince>
    <ns0:PostalCode>12345</ns0:PostalCode>
    <ns0:Country>US</ns0:Country>
    </ns0:Test>'
    SET
    @vs_ShipToAttentionTo = 'New Attention To'
    SET @vx_Test.modify('declare namespace ns0="http://testschema";
    replace value of (/ns0:Test[1]/ns0:AttentionTo) with sql:variable("@vs_ShipToAttentionTo")');
    -- This would be how I would reference it if I was modifiying the XML in a typed XML column in a table.
    WITH XMLNAMESPACES('http://testschema' AS ns0)
    UPDATE TestItems
    SET TestXML.modify('replace value of (/ns0:Test[1]/ns0:AttentionTo) with sql:variable("@vs_ShipToAttentionTo")')
    SELECT @vx_Test
    How can I make this work.  In this example I am using a typed XML variable, but I really want to do this in a table update.
    Thanks,
    Kent

    Try the change below.  What I did was to create a named simple type for the AttentionTo node.  Here is my understanding (based on this working).  Because you have a simpleType the node cannot accept just any string, it has to be a string of
    the type in the simpleType.  That simpleType has no name (thus anonymous). 
    What I did was to create a named simpleType and used that simpleType as the type for the AttentionTo element.  Then in my XQuery, I cast the value to the name of that type (AttentionToType in my example).
    CREATE xml schema collection Test as '<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:ns1="http://testschema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" targetNamespace="http://testschema" elementFormDefault="qualified" attributeFormDefault="unqualified" vc:minVersion="1.1">
    <xs:element name="Test">
    <xs:annotation>
    <xs:documentation>Comment describing your root element</xs:documentation>
    </xs:annotation>
    <xs:complexType>
    <xs:sequence>
    <xs:element name="SAPCode">
    <xs:annotation>
    <xs:documentation>Customer Number for Delivery Organization</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="10"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="OrganizationName">
    <xs:annotation>
    <xs:documentation>Name of Organization</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="AttentionTo" minOccurs="0" type="ns1:AttentionToType">
    <xs:annotation>
    <xs:documentation>Attention to Recepient for the delivery</xs:documentation>
    </xs:annotation>
    </xs:element>
    <xs:element name="Address1">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="150"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="Address2" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="150"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="Address3" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="150"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="City">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="StateProvince">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="PostalCode">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="20"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="Country">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:length value="2"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="Phone" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="50"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="EmailAddress" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="200"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:simpleType name="AttentionToType">
    <xs:restriction base="xs:string">
    <xs:maxLength value="150" fixed="false"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:schema>';
    go
    DECLARE
    @vx_Test xml (CONTENT dbo.Test),
    @vs_ShipToAttentionTo nvarchar(50)
    SET
    @vx_Test = N'<ns0:Test xmlns:ns0="http://testschema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ns0:SAPCode>1234567890</ns0:SAPCode>
    <ns0:OrganizationName>Test Org</ns0:OrganizationName>
    <ns0:AttentionTo>Test Person</ns0:AttentionTo>
    <ns0:Address1>123 Main Street</ns0:Address1>
    <ns0:City>Test City</ns0:City>
    <ns0:StateProvince>IL</ns0:StateProvince>
    <ns0:PostalCode>12345</ns0:PostalCode>
    <ns0:Country>US</ns0:Country>
    </ns0:Test>'
    SET
    @vs_ShipToAttentionTo = 'New Attention To'
    SET @vx_Test.modify('declare namespace ns0="http://testschema";
    replace value of (/ns0:Test[1]/ns0:AttentionTo) with sql:variable("@vs_ShipToAttentionTo") cast as ns0:AttentionToType?');
    -- This would be how I would reference it if I was modifiying the XML in a typed XML column in a table.
    WITH XMLNAMESPACES('http://testschema' AS ns0)
    UPDATE TestItems
    SET TestXML.modify('replace value of (/ns0:Test[1]/ns0:AttentionTo)
    with sql:variable("@vs_ShipToAttentionTo")')
    SELECT @vx_Test
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • Is there any way to force Sun C++ Preprocessor preserve whitespace?

    Hello!
    I'm preprocessing simple source file:
    void test()
        int i;
    }with command: CC -E test.cpp
    and CC preprocessor eats all whitespace at the beginning of each line, like this:
    void test()
    int i;
    }Is there any way to force CC preprocessor preserve whitespace?

    You cannot use the C preprocessor on C++ code, for at least two major reasons.
    1. The default -I options in CC are not the same as for cc. Try adding
    #include <iostream>
    #include <cstdlib>
    to your example.
    Even if you add the missing -I options, the conventions for finding the C++ standard headers are not known to the C preprocessor.
    Example:
    % cc -P -I/opt/SUNWspro/prod/include/CC/Cstd -I/opt/SUNWspro/prod/include/CC -I/opt/SUNWspro/prod/include/cc z.c
    "z.c", line 2: cannot find include file: <cstdlib>
    cc: acomp failed for z.c2. The predefined macros (-D options and predefined macros built into the compilers) are different for cc and CC.
    In particular, the C compiler predefines macros saying it is a C compiler. The C++ compiler predefines macros saying it is a C++ compiler. Code that is conditionalized on whether it is compiled by the C or C++ compiler will give different results. If you add -D options for C++ macros, the results will depend on the way the tests are coded. That is, testing for a C compiler or a C++ compiler will not give mutually exclusive answers, as they would if you use the correct compiler. The Solaris headers have conditional code for C and C++.

  • How to include the file name as an XML field

    Hi,
    I'm using a file adapter for process a flat file and convert it into an XML. Does anybody knows how to include the file name into an XML field.
    Ex.
    I process the file named <b>XXIMN21022007.txt</b> and I need an XML like:
    <MT_FILE>
    <field1></field1>
    <field2></field2>
    <field3></field3>
    <filename><b>XXIMN21022007.txt</b></filename>
    </MT_FILE>
    Regards
    Gonzalo

    Just go for dynamic configuration.
    Check the sender file adapter to write the filename in the header (as explained in Michal's blog) and then read that header in some mapping.
    U can use that even in simple message mappings.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
    Your code for the filename tag would be something like:
    <i>DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
        “http://sap.com/xi/XI/System/File”,
        “FileName”);
    return conf.get(key);</i>
    Regards,
    Henrique.

  • XSQL not delivering XML fields

    [Win AS2003/Oracle 10.1/OC4J Standalone 9.0.4/XDK 10.1.0.2]
    I am trying to do a query in XSQL that includes one field of XML. However, the XML field always yields the error:
    oracle.xml.sql.OracleXMLSQLException: Conversion to String failed
    This happens with a native XMLTYPE field, or if I use the XMLTYPE() function on a varchar field. The same XSQL files worked just fine under Oracle 9.2, so I'm wondering if my (cumbersome) installation of the XSQL servlet under OC4J is missing a jar somewhere--I followed the directions, but you never know...
    P.S.: Why did Oracle make XSQL so much more difficult to implement in 10g than in 9i? I had to install the Oracle HTTP server separately, which didn't include any java servlet engine, so I had to install OC4J manually (A real pain), then the XDK manually. It all just installed automatically in 9i.

    [been avoiding this issue, but now coming back to it]
    Felipe,
    The anchor in your URL didn't work, but I guess you're pointing to the following quote:
    ==============================================
    Oracle9i introduced the XMLType for use with storing and querying XML-based database content. You can exploit database XML features to produce XML for inclusion in your XSQL pages using one of two techniques:
    * <xsql:query> handles any query including columns of type XMLType, however it handles XML markup in CLOB/VARCHAR2 columns as literal text.
    ==============================================
    Which is a nice thing to say, except that I get the results described above, not what the documentation says I should get.
    Perhaps it is the servlet engine I am using (OC4J), but since it is an oracle engine, it ought to work.
    Brandon

  • File name as an XML field

    Does anybody knows how to include the file name into an XML field. My scenario is  XML file to JDBC. I have to pass the filename as one of the table field.

    Hi,
    refer this weblog for dynamic configuration https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2664. [original link is broken] [original link is broken] [original link is broken]
    It will show how to include the file name.
    Also you can use that even in simple message mappings.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
    regards
    Aashish Sinha
    PS : reward points if helpful

  • InputsourceXML String to XML fields

    Hi Experts,
    My requirement is to convert the Input XMLstring into XML fields.Actually the original XML comes in <Payload> field as a string.I want to convert it to XML fields.How to achieve it through java mapping?Please provide your suggestion.
    Regards,
    Karthiga

    Below thread should address your need http://scn.sap.com/thread/3269146

  • Optional XML fields in Simple transformations (ST)

    Hi, I am using Simple Transformation (ST) to convert an XML file into ABAP data. In my XML file some XML tags are optional: sometimes they are available in the file, sometimes they are not. I can not find out how to define a ST for this.
    Either the XML fields are in the ST definition and then these field should also be in the XML file or
    the XML fields are not in the ST definition and then these fields are not allowed in the XML.
    Regards jack

    Hi Jack, please find some sample coding below that will solve your issue:
    <tt:cond check="not-initial(ref('E1EDL20.INCO1'))">
      <INCO1 tt:value-ref="E1EDL20.INCO1"/>
    </tt:cond>
    With the simple transformation tt cond statment you can make an XML tag optional. In below example during deserialisation xml tag <INCO1> will be skipped when not availabke in the xml and SAP data E1EDL20.INCO1 will not be filled by the transformation.
    Regards. Please give points when usefull !

  • Check boxes, Radio Buttons, and XML Field Order

    I am working with Adobe Designer Version 7.0. Hopefully this forum can still address my issues.
    I am creating a registration form that will often be submitted via email to us for processing. To help make the data both easy to transfer for us into our excel file  and to minimize the errors made by the people using the form, I need the form to be able to do a couple of things that I am having a hard time figuring out. My questions are the following:
    I have a list of 7 check boxes that each insert a dollar value into a seperate numeric field on the form. Each check box has a unique dollar value associated with it. Is there any way to design the form so the user can only choose one of the check boxes? I tried using radio buttons in a group, but if a user mistakenly chose the wrong radio button and then selected another button from that group, it would add to the total in the Application Fee field and not subtract out the previous amount. Below is the code i used for one of the check boxes.
    I have two numeric fields that the user must choose one or the other. Can I design those two fields (numHomes and numBuildings) so that if the you enter a value for one field, you cannot enter a value for the other field? Both fields are then calcuated in a seperate numeric field. Below is the code i used for the numeric field.
    I want to be able to take the data emailed to us as an XML file  when a user submits the results via email and directly paste it into our Excel file. To keep the cut and paste process simple, I want to make sure the order of the XML fields matches the order of the database fields so it can be done in one shot. Do you know how to organize the XML fields? They do not seem to correspond to the ordering found under the Hierarchy tab. Any thoughts on this?
    Thanks
    if (this.rawValue == 1) then
           numAppFee.rawValue = numAppFee.rawValue + 350;
    else
           numAppFee.rawValue = numAppFee.rawValue - 350;
    endif
    numHomes * 50 + numBuildings * 100 + numDups * 10

    Create an XML Schema (XSD) and define that as the default form schema. The form data will conforms to the order of fields defined in the XML schema.
    Hope that helps.
    Nith

  • How do you change an xml field inside of a database?

    Please: can you tell me how do you update an xml file?
    I mean how do you edit an xml field?
    Paola
    @{---->>----->---------                                                                                                                                                                                                                                                                       

    It should work for Oracle 9.2 and 10.2
    Thank you Dany.
    Regards.
    Paola
    @{--->----->>----------                                                                                                                                                                                                               

  • Problem regarding XML field value to XML generation

    Hi Everybody,
    I am facing a typical problem. I am storing xml in an xml datatype field in a table. But when I am generating physical file from the xml field, '&amp;' in the xml field is getting converted into '&' in the physical file. But I want '&amp;' to
    be intact.
    Can anyone faced the issue or have any idea of solving this?
    Thanks & Regards,
    Anujit Karmakar
    Anujit Karmakar Sr. Software Engineer

    Hi Anujit,
    How do you generate physical file from the xml field?
    I make a test on my computer using your XML data with the following scripts, '&amp;' exists in my exported file.
    DECLARE @testXML XML
    SELECT @TestXML='<ENVELOPE>
    <HEADER>
    <TALLYREQUEST>Import Data</TALLYREQUEST>
    </HEADER>
    <BODY>
    <IMPORTDATA>
    <LEDGER NAME="Prafulla Ghosh">
    <ADDRESS.LIST TYPE="String">
    <ADDRESS>BEHIND DILIP MATH &amp; DISARI CLUB</ADDRESS>
    </ADDRESS.LIST>
    <MAILINGNAME.LIST TYPE="String">
    <MAILINGNAME>Prafulla Ghosh</MAILINGNAME>
    </MAILINGNAME.LIST>
    <STATENAME>West Bengal</STATENAME>
    </LEDGER>
    </IMPORTDATA>
    </BODY>
    </ENVELOPE>'
    -- We Store the contents of an XML variable to a table
    CREATE TABLE MyXMLTable
    xCol XML
    INSERT INTO MyXMLTable ( xCol )
    SELECT @testXML
    We Save an XML value to a file.
    DECLARE @Command VARCHAR(255)
    DECLARE @Filename VARCHAR(100)
    SELECT @Filename = 'C:\Files\TestXMLRoutine'
    /* we then insert a row into the table from the XML variable */
    /* so we can then write it out via BCP! */
    SELECT @Command = 'bcp "select xCol from ' + DB_NAME()
    + '..MyXMLTable" queryout '
    + @Filename + ' -w -T -S' + @@servername
    EXECUTE master..xp_cmdshell @command
    --so now the xml is written out to a file
    SELECT CONVERT(nVARCHAR(max),BulkColumn)
    FROM OPENROWSET(BULK 'C:\Files\TestXMLRoutine', SINGLE_BLOB) AS x
    go
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

Maybe you are looking for