Handling long XML strings in XSLT

I am creating an XML string dynamically to feed to my XSLT processing servlet. In a prototype I did this by passing the XML as a string to a routing servlet that then calls HttpResponse.sendRedirect() with the name of the XSLT processing servlet and the XML string like this :
redirectString = "/WardenConfig/servlet/XSLTServlet?xslPage=" + nextPage + "&xmlSourceString=" + XMLData ;
where XMLData is the dynamically built XML and nextPage is an XSL stylesheet. Then I send use this to send it all to the servlet that processes the XSL and displays the result :
response.sendRedirect( redirectString );
The problem is that when I get a lot of data in the XML string this does not work. I think this might be because sendRedirect() uses the GET method but I am not sure. SO I had two questions :
1) Is that the problem - the GET method, I mean ?
2) What's a better way to do this ?
thanks in advance !!

Will do, Doctor. I appreciate your quick help ! Is that the way most people handle this ?
By the way, if you can tell me how to award Duke Dollars, I would like to do that. For some reason I can't do it anymore .. used to be able to ... feel lame ...
Thanks again.

Similar Messages

  • Sending long XML strings from a servlet

    Hi,
    I'm trying to send a long (16K) XML string from a Java servlet to a
    MSXML2.XMLHTTP40 client. The client doesn't receive any data when the
    string is longer than about 2K .
    I am using the POST method.
    I have tried increasing the buffer size on the sending side with
    HttpServletResponse.setBufferSize() - this had no effect.
    Any ideas ?
    Thanks very much for your help,
    Rod

    Looks like the problem is on the client side (MSXML) because I can flawlessly send half-megs XML files from a Servlet to a browser or a java.net.URL

  • Printint XML string using  XSLT mapping

    Hi,
    I'm trying to build a outgoing SOAP message with in XI, my backedn legacy application expect the soap message to be in certain format. It expect the xml request passed in the body of the message as whole xml string. I need to pring the xml something like this, I would appreciate if anyone had implemented something like this before. if you look at the below message I'm enclosing the whole xml string in the data element.
    <data xsi:type="xsd:string"><?xml version="1.0" encoding="UTF-8"?> <crm:schedule_call_request session_id="mid://07060623130210031519@elnk_crm.com" target_system_id="csi_ivr" xmlns:crm="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd" xmlns:xcommon="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd"> <crm:call_parameter global_rules_version_id="" manual_request="true" originating_skillset="TS (DU/BB)|ADSL RETAIL" parameter_version_id="1" transfer_skillset="TSBBDSL...WinELNK"> <crm:call_id>10031519</crm:call_id> <crm:department_name>TS</crm:department_name> <crm:object_type>CASE</crm:object_type> <crm:object_id>73079085</crm:object_id> <crm:call_time>2007-06-07T12:30:01.000-08:00</crm:call_time> <crm:customer_phone_number>6263452656</crm:customer_phone_number> <crm:override_attempts>false</crm:override_attempts> <crm:retry_count>3</crm:retry_count> <crm:call_trigger>3000</crm:call_trigger> <crm:call_time_padding>10</crm:call_time_padding> <crm:override_local_customer_call_hours>false</crm:override_local_customer_call_hours> </crm:call_parameter> </crm:schedule_call_request></data>

    Hi
    thanks for responding. here is the input SOAP message that I was building in the XLT mapping. I was stuck at putting the xml in the data element.
    soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <soapenv:Header>
    - <wsa:EndpointReference soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
      <wsa:Address xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">https://xmlc-qe.corp.earthlink.net/ws_xmlc/s_router</wsa:Address>
      <wsa:ServiceName wsa:PortName="XMLCollectivePort" xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">wsa:ServiceName</wsa:ServiceName>
      </wsa:EndpointReference>
      <wsa:To soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">https://xmlc-qe.corp.earthlink.net/ws_xmlc/queues/csi_queue</wsa:To>
      <wsa:Action soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">https://xmlc-qe.corp.earthlink.net/ws_xmlc/action//messaging/put_single</wsa:Action>
      <wsa:MessageID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">07060623130210031519</wsa:MessageID>
    - <wsse:Security soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext">
    - <wsse:UsernameToken>
      <wsse:Username xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">elnk_crm</wsse:Username>
      <wsse:Password wsse:Type="wsse:PasswordDigest" xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">20UioFa77hI6MLhlc+KPDF95Hx0=</wsse:Password>
      <wsse:Nonce xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">VlX1Jpoq+vkQCQ8af2SaCDP1u9c=</wsse:Nonce>
      <wsu:Created xsi:type="soapenc:string" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">2007-06-06T23:13:12Z</wsu:Created>
      </wsse:UsernameToken>
      </wsse:Security>
      </soapenv:Header>
    - <soapenv:Body>
    - <ns1:SubmitRequest soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="SubmitRequest">
      <data xsi:type="xsd:string"><?xml version="1.0" encoding="UTF-8"?> <crm:schedule_call_request session_id="mid://07060623130210031519@elnk_crm.com" target_system_id="csi_ivr" xmlns:crm="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd" xmlns:xcommon="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd"> <crm:call_parameter global_rules_version_id="" manual_request="true" originating_skillset="TS (DU/BB)|ADSL RETAIL" parameter_version_id="1" transfer_skillset="TSBBDSL...WinELNK"> <crm:call_id>10031519</crm:call_id> <crm:department_name>TS</crm:department_name> <crm:object_type>CASE</crm:object_type> <crm:object_id>73079085</crm:object_id> <crm:call_time>2007-06-07T12:30:01.000-08:00</crm:call_time> <crm:customer_phone_number>6263452656</crm:customer_phone_number> <crm:override_attempts>false</crm:override_attempts> <crm:retry_count>3</crm:retry_count> <crm:call_trigger>3000</crm:call_trigger> <crm:call_time_padding>10</crm:call_time_padding> <crm:override_local_customer_call_hours>false</crm:override_local_customer_call_hours> </crm:call_parameter> </crm:schedule_call_request></data>
      </ns1:SubmitRequest>
      </soapenv:Body>
      </soapenv:Envelope>

  • Update xml string values.

    Hi,
    I'm on 11.2.0.2 and got table with nclob column which stores long xml string .
    {code}
    "<?xml version="1.0" encoding="UTF-8"?>
    <?fuego version="6.5.2" build="101272"?>
    <set>
    <configuration name="TEST Database" type="SQL" subtype="DDORACLE">
      <property name="jdbc.pool.idle_timeout" value="5"/>
      <property name="jdbc.pool.entry.max" value="10"/>
      <property name="oracle.dateEqualsTimestamp" value="false"/>
      <property name="jdbc.schema" value="user1"/>
      <property name="jdbc.host" value="hostname"/>
      <property name="user" value="user1"/>
      <property name="jdbc.port" value="1521"/>
      <property name="jdbc.pool.min" value="0"/>
      <property name="jdbc.pool.maxopencursors" value="50"/>
      <property name="oracle.sid" value="dbsid"/>
      <property name="password" value="user101"/>
      <property name="jdbc.xa" value="false"/>
      <property name="jdbc.pool.max" value="10"/>
    </configuration>
    <configuration name="TEST Database2" type="SQL" subtype="DDORACLE">
      <property name="jdbc.pool.idle_timeout" value="5"/>
      <property name="jdbc.pool.entry.max" value="10"/>
      <property name="oracle.dateEqualsTimestamp" value="false"/>
      <property name="jdbc.schema" value="user2"/>
      <property name="jdbc.host" value="hostname"/>
      <property name="user" value="user2"/>
      <property name="jdbc.port" value="1521"/>
      <property name="jdbc.pool.min" value="0"/>
      <property name="jdbc.pool.maxopencursors" value="50"/>
      <property name="oracle.sid" value="dbsid2"/>
      <property name="password" value="user201"/>
      <property name="jdbc.xa" value="false"/>
      <property name="jdbc.pool.max" value="10"/>
    </configuration>
    </set>
    {code}
    My goal is to update password value in such way that it equals to value from jdbc.schema value  <property name="jdbc.schema" value="user2"/>   so in this case user2 || '01'
    <property name="password" value="user201"/>   <-- that is my goal .
    Regards
    Greg

    Hi,
    You can find a few methods here : How To : Update XML nodes with values from the same document | Odie's Oracle Blog
    They're not all applicable to your version and settings though.
    Here's the first one applied to your case :
    declare
      v_xmldoc   xmltype;
    begin
      select xmlparse(document to_clob(t.xmldoc))
      into v_xmldoc
      from my_nclob_table t
      where t.id = 1;
      for r in (
        select idx, schema_name
        from my_nclob_table t
           , xmltable(
               '/set/configuration'
               passing v_xmldoc
               columns idx         for ordinality
                     , schema_name varchar2(30) path 'property[@name="jdbc.schema"]/@value'
      loop
        select updatexml(
                 v_xmldoc
               , '/set/configuration['||to_char(r.idx)||']/property[@name="password"]/@value'
               , r.schema_name || '01'
        into v_xmldoc
        from dual ;
      end loop;
      update my_nclob_table t
      set t.xmldoc = to_nclob(xmlserialize(document v_xmldoc indent))
      where t.id = 1;
    end;
    Here's another one, using DOM :
    declare
      doc   clob;
      p        dbms_xmlparser.Parser;
      domdoc   dbms_xmldom.DOMDocument;
      docnode  dbms_xmldom.DOMNode;
      conf_list      dbms_xmldom.DOMNodeList;
      conf_node      dbms_xmldom.DOMNode;
      password_node  dbms_xmldom.DOMNode;
      schema_name     varchar2(30);
      password_value  varchar2(256);
    begin
      select to_clob(xmldoc)
      into doc
      from my_nclob_table
      where id = 1 ;
      p := dbms_xmlparser.newParser;
      dbms_xmlparser.parseClob(p, doc);
      domdoc := dbms_xmlparser.getDocument(p);
      dbms_xmlparser.freeParser(p);
      docnode := dbms_xmldom.makeNode(domdoc);
      conf_list := dbms_xslprocessor.selectNodes(docnode, '/set/configuration');
      for i in 0 .. dbms_xmldom.getLength(conf_list) - 1 loop
        conf_node := dbms_xmldom.item(conf_list, i);
        dbms_xslprocessor.valueOf(conf_node, 'property[@name="jdbc.schema"]/@value', schema_name);
        password_node := dbms_xslprocessor.selectSingleNode(conf_node, 'property[@name="password"]/@value');
        dbms_xmldom.setNodeValue(password_node, schema_name || '01');
      end loop;
      dbms_xmldom.writeToClob(domdoc, doc);
      dbms_xmldom.freeDocument(domdoc);
      update my_nclob_table t
      set t.xmldoc = to_nclob(doc)
      where t.id = 1;
    end;
    Message was edited by: odie_63 - added DOM example

  • How to get an XML string store in CLOB or LONG column ?

    How to get an XML string store in CLOB or LONG column ?
    We use XSU with the following command
    String str = qry.getXMLString();
    but all the "<" are replace by "&lt;"
    It's impossible to parse the result for XSLT transformation
    Thank's for your help
    Denis Calvayrac
    Example :
    in the column "TT_NAME"
    "<name><firstname>aaa</<firstname><lastname>bbb</lastname></name>
    I want this result
    <TT_NAME>
    <name>
    <firstname>aaa</firstname>
    <lastname>bbb</lastname>
    </name>
    </TT_NAME>
    but, I have this result
    <TT_NAME>
    &lt;name&gt;
    &lt;firstname&gt;aaa&lt;/firstname&gt;
    &lt;lastname&gt;bbb&lt;/lastname&gt;
    &lt;/name&gt;
    </TT_NAME>

    Can you post some of your code, so I can take a look ?
    Thanks

  • XSLT transformation of XML string

    Hello Everyone,
    This is my first endeavor to use XSLT and XML in our newly upgraded system.  I can't for the life of me figure out what is wrong with my code and would appreciate someone just glancing over it and pointing out what is likely a realy dumb problem.
    I have a program that reads a PEXR2002 IDoc. For testing purposes, I've hardcoded that IDoc number. It runs fine, creates the XML fine, the xslt in STRANS tests fine as well...but in the end my ls_table is blank.  I've been fuddling with this for a while and would really appreciate another pair of eyes taking a look at it.
    THANKS!!
    Greg
    My program. (xslt is below...really simple, but it's my first time).
    TYPES: BEGIN OF ty_table,
            sndprn LIKE edidc-sndprn,
            bgmref TYPE edif1004_r,
            moabetr TYPE edif5004_a,
            credat TYPE edidat8,
            datum TYPE edidat8,
          END OF ty_table.
    DATA: o_idoc TYPE REF TO cl_idoc_xml1, str type string, ls_table type ty_table. 
    CREATE OBJECT o_idoc
      EXPORTING
        docnum = '0000000000211014'.
    CALL METHOD o_idoc->get_xmldata_as_string
      IMPORTING
        data_string = str.
    CALL TRANSFORMATION ZUSL_PEXR2002_V1
    SOURCE XML str
    RESULT HEADER_DATA = ls_table.
    My XSLT....
    <xsl:transform
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:asx="http://www.sap.com/abapxml"
        xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <asx:abap version="1.0">
          <asx:values>
            <HEADER_DATA>
              <SNDPRN>
                <xsl:value-of select="PEXR2002/IDOC/EDI_DC40/SNDPRN"/>
              </SNDPRN>
              <BGMREF>
                <xsl:value-of select="PEXR2002/IDOC/E1IDKU1/BGMREF"/>
              </BGMREF>
              <MOABETR>
                <xsl:value-of select="PEXR2002/IDOC/E1IDKU5/MOABETR"/>
              </MOABETR>
              <CREDAT>
                <xsl:value-of select="PEXR2002/IDOC/EDI_DC40/CREDAT"/>
              </CREDAT>
              <DATUM>
                <xsl:value-of select="PEXR2002/IDOC/E1EDK03/DATUM"/>
              </DATUM>
            </HEADER_DATA>
          </asx:values>
        </asx:abap>
      </xsl:template>
    </xsl:transform>

    Hi Greg,
    please try it with the following (just slightly) modified transformation (works fine for me):
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                   xmlns:asx="http://www.sap.com/abapxml"
                   xmlns:sap="http://www.sap.com/sapxsl"
                   version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:template match="/PEXR2002/IDOC">
        <asx:abap version="1.0">
          <asx:values>
            <HEADER_DATA>
              <SNDPRN>
                <xsl:value-of select="EDI_DC40/SNDPRN"/>
              </SNDPRN>
              <BGMREF>
                <xsl:value-of select="E1IDKU1/BGMREF"/>
              </BGMREF>
              <MOABETR>
                <xsl:value-of select="E1IDKU5/MOABETR"/>
              </MOABETR>
              <CREDAT>
                <xsl:value-of select="EDI_DC40/CREDAT"/>
              </CREDAT>
              <DATUM>
                <xsl:value-of select="E1EDK03/DATUM"/>
              </DATUM>
            </HEADER_DATA>
          </asx:values>
        </asx:abap>
      </xsl:template>
    </xsl:transform>
    I recommend to test all transformations that you define on a sample source and check the output. If you apply your original transformation you would see that it basically doesn't select anything and therefore you just get an XML document with the field names but no values.
    Cheers, harald

  • Special charecters handling while Converting XML string to DOM

    Hi,
    I am using the following approach for converting XML string to DOM, but due to Special characters like "&", I am getting Exceptions:
    String xmlString;
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(new InputSource(new StringReader(xmlString)));
    Can anyone please help me out on how to handle the Special characters in the above code.

    If the XML doesn't parse, then the XML must be invalid. Show a sample of such a special character in the XML data. Please use \ tags to post the actual XML content and any other code.                                                                                                                                                                                                                                                                                                                                                                                           

  • How to process a large XML string passed to a LONG variable?

    I am attempting to extract and loop through some XML that is stored in a variable (v_xml_string) that is defined as LONG data type. However, I am receiving an ORA-01460: unimplemented or unreasonable conversion requested when the string value exceeds 20 records in the XML layout below. When I performed a LENGHTB on a sample XML string containing 19 records (just below the threshold of erroring), I get 3895, which I'm assuming is in BYTES...this is not near the 32,760 byte limit of PL/SQL variables defined as LONG. I suppose my other alternative is that I use CLOB datatype instead of LONG.
    XML layout:
    <?xml version="1.0"?>
    <DocumentElement>
      <tblElections>
        <EmpID>872G4</EmpID>
        <MgrNTID>JohnDoe</MgrNTID>
        <Entity>050595</Entity>
        <AddlAmt>1000</AddlAmt>
        <CheckedForSave>Y</CheckedForSave>   
      </tblElections>
    </DocumentElement>sample of code where error appers to be occurring:
    DECLARE
      v_xml_string LONG;
    BEGIN
        FOR v_xml_rec IN (SELECT t.COLUMN_VALUE.extract('/tblElections/EmpID/text()') .getStringVal() EmpID,
                                 t.COLUMN_VALUE.extract('/tblElections/MgrNTID/text()') .getStringVal() MgrNTID,
                                 t.COLUMN_VALUE.extract('/tblElections/FAEntity/text()') .getStringVal() FAEntity,
                                 t.COLUMN_VALUE.extract('/tblElections/AddlSLEAAmt/text()') .getStringVal() AddlSLEAAmt,
                                 t.COLUMN_VALUE.extract('/tblElections/CheckedForSave/text()') .getStringVal() CheckedForSave
                            FROM TABLE(xmlsequence(XMLTYPE(v_xml_string) .extract('/DocumentElement/tblElections'))) t)
        LOOP
    ... <do some stuff here>
       END LOOP;
    END;

    Strings in SQL are limited to 4000 in length, the long variable will work up to 32K as long as it is not used in SQL, if it goes over 4000 you will get the error.
    SQL> declare
      2    l long;
      3  begin
      4    l := rpad('x',32000,'x');
      5    dbms_output.put_line('length is : ' || to_char(length(l)));
      6  end;
      7  /
    length is : 32000
    PL/SQL procedure successfully completed.
    SQL> edi
    Wrote file afiedt.sql
      1  declare
      2    l long;
      3    n number;
      4  begin
      5    l := rpad('x',32000,'x');
      6    select length(l) into n from dual;
      7    dbms_output.put_line('length is : ' || to_char(n));
      8* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-01460: unimplemented or unreasonable conversion requested
    ORA-06512: at line 6
    SQL> edi
    Wrote file afiedt.sql
      1  declare
      2    l long;
      3    n number;
      4  begin
      5    l := rpad('x',4000,'x');
      6    select length(l) into n from dual;
      7    dbms_output.put_line('length is : ' || to_char(n));
      8* end;
    SQL> /
    length is : 4000
    PL/SQL procedure successfully completed.
    SQL> edi
    Wrote file afiedt.sql
      1  declare
      2    l long;
      3    n number;
      4  begin
      5    l := rpad('x',4001,'x');
      6    select length(l) into n from dual;
      7    dbms_output.put_line('length is : ' || to_char(n));
      8* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-01460: unimplemented or unreasonable conversion requested
    ORA-06512: at line 6
    SQL>

  • SharePoint 2010 Error while executing web part: System.Xml.Xsl.XslLoadException: XSLT compile error.

    Hello,
    I currently having a series of errors (18 issues) that are occurring under the below Correlation ID ad1a22f5-1ddb-4fa5-8487-143cb6fd0f9d
    I have listed (3) that are in the Web Parts category, this error/issue is causing several timed job to no longer work properly I have been trying to find the root cause for about a week now. If anyone has encountered a issue
    such as this one I'm open for suggestions.     
    (1)
    Error while executing web part: System.Xml.Xsl.XslLoadException: XSLT compile error. An error occurred at (1,475). ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
    ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.     at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest
    asyncRequest, Exception exception)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult
    lazyResult)     at System.Threading.ExecutionContext.runTryCode(Object userData)     at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)    
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)     at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)     at System.Net.TlsStream.Write(Byte[]
    buffer, Int32 offset, Int32 size)     at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)     at System.Net.ConnectStream.WriteHeaders(Boolean async)     --- End of inner exception
    stack trace ---     at System.Net.HttpWebRequest.GetResponse()     at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)     at System.Xml.XmlUrlResolver.GetEntity(Uri
    absoluteUri, String role, Type ofObjectToReturn)     at Microsoft.SharePoint.WebPartPages.WSSXmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)     at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri
    uri, XmlResolver xmlResolver)     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(Uri uri, Boolean include)     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)    
    --- End of inner exception stack trace ---     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)     at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver
    xmlResolver)     at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)     at System.Xml.Xsl.XslCompiledTransform.CompileXsltToQil(Object stylesheet, XsltSettings
    settings, XmlResolver stylesheetResolver)     at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)     at System.Xml.Xsl.XslCompiledTransform.Load(XmlReader
    stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.LoadXslCompiledTransform(WSSXmlUrlResolver someXmlResolver)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXslCompiledTransform()    
    at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)
    (2)
    InnerException 1: System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according
    to the validation procedure.     at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[]
    buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[]
    buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[]
    buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ForceAuthentication(Boolean
    receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)     at System.Threading.ExecutionContext.runTryCode(Object userData)    
    at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback,
    Object state)     at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)     at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)     at System.Net.PooledStream.Write(Byte[]
    buffer, Int32 offset, Int32 size)     at System.Net.ConnectStream.WriteHeaders(Boolean async)     --- End of inner exception stack trace ---     at System.Net.HttpWebRequest.GetResponse()    
    at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)     at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)     at Microsoft.SharePoint.WebPartPages.WSSXmlUrlResolver.GetEntity(Uri
    absoluteUri, String role, Type ofObjectToReturn)     at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver xmlResolver)     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(Uri uri, Boolean include)    
    at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
    (3)
    InnerException 2: System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.     at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest
    asyncRequest, Exception exception)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult
    lazyResult)     at System.Threading.ExecutionContext.runTryCode(Object userData)     at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)    
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)     at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)     at System.Net.TlsStream.Write(Byte[]
    buffer, Int32 offset, Int32 size)     at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)     at System.Net.ConnectStream.WriteHeaders(Boolean async)

    Hello,
    It seems that issue is related to certificate. Could you please upload certificate to central admin and make it trust.
    Just try this and see the result:
    http://social.technet.microsoft.com/Forums/en-US/cbc58585-1673-4c91-b8c1-1b95c339bbb7/could-not-establish-trust-relationship-for-the-ssltls-secure-channel?forum=fastsharepoint
    http://social.msdn.microsoft.com/Forums/en-US/7a7e56ba-6e95-4a84-9384-791818cce89d/the-underlying-connection-was-closed-could-not-establish-trust-relationship-for-the-ssltls-secure?forum=sharepointdevelopmentprevious
    http://www.infotext.com/help/sharepoint-could-not-estabilish-trust-relationship-for-the-ssltls-secure-channel-when-crawling-ssl-enabled-websites/
    If still face the issue then tell us more about your webparts and also confirm if you are facing same problem to other page and site.
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Is there a way to get the actual XML string when using the JAXP SAX Parser?

    Hi All,
    I am using a JAXP SAX xml parser and am looking for a way to get the actual line of xml that is being parsed from within a content handler.
    Here's my scenario. Consider the following example xml document.
    <formCollection>
       <form name="myForm">
          <text/>
          <selection/>
       </form>
       <form name="anotherForm">
          <text/>
       </form>
    </formCollection>My hope is to validate the entire document and then insert an xml string containing each "form" element (and its sub-elements) into a map for later use. My thought was to create a String as each "form" element is being parsed (begining with the form's startElement event and concatenating until the form's endElement event is reached) and then inserting this string into the map. Is there a way to get the actual line of xml that is being parsed, rather than just the element name and attribute values?

    DrClap wrote:
    YouRang wrote:
    2. The first handler would validate the entire XML document, extract the "type" attribute from each <form> element, and place each <form> element and its sub-elements into the map of Strings, using the "type" attribute as the key. The second handler would take a <form> element and parse it into a Form object for the display. This option was the impetus for my question because it relies on the first handler being able to access the entire <form> element XML String and write it to a map.I don't see why you need the raw data from the XML document here. You should already be abstracting your data into Java classes in the first handler, instead of making the second handler do the parsing all over again.Correct, I am not referring to XForms. In this case, it happens that I am using the XML to generate an SWT ScrolledForm object and, thus, the XML element name happens to be named "form." However, the concept/design problem could apply to any type of object and the XML element could be appropriately renamed.
    My experience with XSLT is limited and I haven't done anything with it for several years. With that said, it seems that it is primarily used for generating web content, which wouldn't apply in this case because this is for a client-server application. I could be off base on this one -- if XSLT applies to much broader translations and would be more appropriate for generating Java objects than my current methodology, I could certainly look into it further.
    I apologize that option two didn't make more sense; it is difficult to explain. Yes, optimally the data should be abstracted into Java classes in the first handler. This is really an elaboration that I failed to specify when explaining option one. The problem is that the user can choose to create any number of "forms" of any type. For instance, let's say that from the File -> New menu there are options for seven different types of forms and each form is used to send completely different data. The user can select form1, select form1 again, select form4, and select form7 (or any other combination) and bring up tabs that display the different forms. The user can then enter data and submit each form separately. When the user selects File -> New -> FormX, a SWT ScrolledForm object that corresponds with FormX must be given to the display. Because SWT ScrolledForm objects do not allow a deep copy, I cannot simply read the XML <form> elements at initialization, parse them into ScrolledForm objects, and pass deep copies of the ScrolledForm objects to the display each time the user clicks File -> New -> FormX. The only simple way I see of getting a new copy of a ScrolledForm object is to reparse the appropriate XML <form> element in order to create one each time the user selects File -> New -> FormX. As such, one handler would need to read the entire XML document and parse the <form> elements into a map (or some other data structure) and another handler would need to parse individual <form> elements into SWT ScrolledForm objects. The first handler would be called at initialization and the second handler would be called each time a user clicked on File -> New -> FormX. Once again, this isn't exactly my favorite implementation... but seems the simplest given that there is no way to do a deep copy of an SWT ScrolledForm object. Hopefully that makes a little more sense. No worries if it doesn't -- I just figured I'd throw this out there and see if anyone had a better idea.

  • Transform XML-String to human readable XML-File

    I need to transform a XML-String as coming from a simple transformation into a human readable XML-File. That means with linebreaks and logical indenting, each line not longer than n charactors.
    Example:
    <one><two>text</two><three><four>text</four></three></one>
    into
    <one>
      <two>text</two>
      <three>
        <four>text</four>
      </three>
    </one>

    I wrote a method that will do this, but the method can not handle all kinds of XML-strings, but it works with most simple XML-Strings:
    METHOD xml_str2table.
    *** Importing
    **    I_XMLSTRING type csequence
    *** Returning
    ***   e_tab_XMLtab type table of string.        
      DATA l_cnt_length TYPE i.
      l_cnt_length = STRLEN( i_xmlstring ).
      DATA l_cnt_index TYPE i.
      DATA l_xmlline TYPE string.
      DATA l_oldchar TYPE c.
      DATA l_char TYPE c.
      DATA l_nextchar TYPE c.
      DATA l_indent TYPE i.
      DO l_cnt_length TIMES.
        l_cnt_index = sy-index - 1.
        l_char = i_xmlstring+l_cnt_index(1).
        IF sy-index < l_cnt_length.
          l_nextchar = i_xmlstring+sy-index(1).
        ENDIF.
        IF  l_char <> cl_abap_char_utilities=>newline.
          IF ( l_char = '<' AND l_nextchar = '/' ) OR
             ( l_char = '/' AND l_nextchar = '>' ).
            l_indent = l_indent - 1.
            IF l_indent < 0.
              l_indent = 0.
            ENDIF.
          ENDIF.
          IF l_char = '<' AND l_oldchar = '>'.
            APPEND l_xmlline TO e_tab_xmltab.
    *      write: / l_xmlline.
            CLEAR l_xmlline.
            DO l_indent TIMES.
              CONCATENATE space space l_xmlline INTO l_xmlline SEPARATED BY space.
            ENDDO.
          ENDIF.
          if l_char <> space.
            CONCATENATE l_xmlline l_char INTO l_xmlline.
          else.
            CONCATENATE l_xmlline l_char INTO l_xmlline SEPARATED BY space.
          endif.
          IF l_char = '<' AND l_nextchar <> '/'.
            l_indent = l_indent + 1.
          ENDIF.
        ELSE.
          l_indent = 0.
          APPEND l_xmlline TO e_tab_xmltab.
    *    write: / l_xmlline.
          CLEAR l_xmlline.
        ENDIF.
        l_oldchar = l_char.
      ENDDO.
      APPEND l_xmlline TO e_tab_xmltab.
    *write: / l_xmlline.
    ENDMETHOD.
    The second Method does the same not with an string, but with an X-String:
    METHOD xml_xstr2table.
    *** Importing
    **    I_XMLSTRING type xsequence
    *** Returning
    ***   e_tab_XMLtab type table of string.     
      DATA l_tmp_string TYPE string.
      DATA conv TYPE REF TO cl_abap_conv_in_ce.
      conv = cl_abap_conv_in_ce=>create(
                encoding = 'UTF-8'
                endian = 'L' ).
      conv->convert(
        EXPORTING input = i_xmlstring
        IMPORTING data = l_tmp_string ).
      e_tab_xmltab = xml_str2table( l_tmp_string ).
    ENDMETHOD.

  • Converting SQL Server text field containing XML string to XI XML via JDBC

    Hello
    My client has a SQL Server database containing a field of type Text which contains an XML string e.g.
    <DispatchJob> <DispatchDateTime>2003-09-29T13:29:15</DispatchDateTime> <AssignedFSE>F118</AssignedFSE> <DispatchJobPurchase> <DealerID>14C5</DealerID> <DateOfPurchase>1997-10-01T00:00:00</DateOfPurchase> </DispatchJob>
    I am using JDBC to access this but could someone please recommend the best and easiest solution for converting this string to XI XML for subsequent mapping to BAPI or IDOC or ABAP Proxy and transmission to SAP. There are other fields as well in the database table so thoughts at the moment are to use a normal graphical message mapping followed by an XSL mapping. Will an XSL mapping be able to do this and if so is that the best solution?
    Also I need to do the reverse of this and take fields coming from SAP via BAPI,IDOC etc. and convert them to a single database table field as an XML string also via the JDBC adapter. What is the best way to do this. Could it be done simply with functions in the graphical mapping e.g. concatenate?
    Thank you in advance.
    Trevor

    Hi Michal
    Thanks for the prompt reply.
    I was anticipating XSLT for reading from the SQL Server database and converting the XML string.
    But how would you convert the individual fields from SAP into a single field as an XML string for storing in the SQL Server database? What approach would you use?
    Regards
    Trevor

  • Performance problem submitting big XML string parameter to the web service

    We deployed a web service on the OC4J via oracle.j2ee.ws.StatelessJavaRpcWebService . This web service takes one string as a parameter. The string contains XML. Evrything works great UNLESS input XML string reaches 5Mb in size. When it happens OC4J does something with it for about 10 minutes (yes, minutes) before it calls the web service method. At this time java.exe consumes 100% of CPU.
    WE tried to increase JVM heap size, stack size, etc, - no effect.
    Please, help!
    Thank you in advance,
    Vlad.

    Hi Sheldon,
    What i feel is that it's not been handled in your webservice if the parameter is null or "" <blank> space
    i just you to take care in webservice that if the parameter is null or "" pass the parameter null to the stored proc
    Regards
    Pavan

  • How can i read XML string in a loop???

    i changed xml file reader to xml string reader by
    looking around this and other forums.
    here is the code.
    public class XMLTester2 {
        public static void main(String[] args) {
            String s = "<firsttag><secondtag>123</secondtag></firsttag>";
            java.io.Reader reader = new java.io.StringReader(s);
            org.xml.sax.InputSource source = new org.xml.sax.InputSource(reader);
            org.w3c.dom.Document doc = null;
            javax.xml.parsers.DocumentBuilderFactory fact = javax.xml.parsers.DocumentBuilderFactory.newInstance();
            try {
                javax.xml.parsers.DocumentBuilder builder = fact.newDocumentBuilder();
                doc = builder.parse(source);
            } catch (javax.xml.parsers.ParserConfigurationException pce) {
            } catch (org.xml.sax.SAXException se) {
            } catch (java.io.IOException ioe) {
            } finally {
                try {
                    reader.close();
                } catch (java.io.IOException ignored) {
    }i put this stuff into a loop, but i always ends up
    having new in the loop.
                String inputLine = "Start";
                // define what's needed for XML messages
                Reader reader = new StringReader(inputLine);
                InputSource source = new InputSource(reader);
                Document doc = null;
                DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = null;
                Node xmlNode = null;
                try {
                    builder = fact.newDocumentBuilder();
                } catch (ParserConfigurationException pce) {
                // -->
                while ( (inputLine = in.readLine()) != null) {
                    System.out.println("readLine() : {" + inputLine + "}");
                    reader = new StringReader(inputLine);
                    source.setCharacterStream(reader);
                    try {
                        doc = builder.parse(source);
                    } catch (SAXException se) {
                        System.out.println("SAXException : " + se);
                        System.out.println("SAXException source : " + source.toString() );
                        se.printStackTrace();
                    } catch (IOException ioe) {
                        System.out.println("IOException : " + ioe);
                    } finally {
                        try {
                            reader.close();
                        } catch (IOException ignored) {
                    reader = null;i know putting new in the loop is VERY bad.
    i gotto get ride of this new from the loop.
    can anyone help me?

    i know putting new in the loop is VERY bad.
    i gotto get ride of this new from the loop.Don't design your application based on one-liners you heard somewhere. Do some timings to see if it matters. My guess would be that parsing an XML file would take a fair bit longer than creating a StringReader object. And you do need a new StringReader each time, they aren't reusable, so the alternatives are not obvious. And don't accept my guess about the timings, check it for yourself.

  • Extracting elements from an xml string - org.apache.xerces.dom.DeferredText

    Hello all,
    I am new to xml, and I thought I had a handle on things until I got this problem...I am getting an xml string from the body of an e-mail message, and then I am trying to extract elements out of it. Here is an example xml string:
    <?xml version="1.0" encoding="UTF-8"?>
    <filterRoot>
       <filter action="MOVE" bool="AND" name="My Saved Filter" target="Deleted Items">
          <condition attribute="TO" bool="AND" contains="CONTAINS">
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
             <value>[email protected]</value>
          </condition>
       </filter>
    </filterRoot>I am trying to extract the <filter> element out and store it into a Vector of Elements (called, not surprisingly, filters). However, I am getting a class cast exception:
    java.lang.ClassCastException: org.apache.xerces.dom.DeferredTextImplIt is being called from where I trying to extract the <filter> in this way:
            filterRoot = doc.getDocumentElement(); // get topmost element
            NodeList list = filterRoot.getChildNodes();
            Vector newFilters = new Vector();
            debug("There are "+list.getLength()+" filters in document");
            for(int i=0; i<list.getLength(); i++) {
                Node n = list.item(i);
                debug("Node "+i+" getNodeValue() is "+n.getNodeValue());
                Element temp = (Element)n;
                newFilters.add(temp);
            }Perhaps my question is, how do I correctly get hold of the <filter> node so that I may cast it as an Element?
    thanks,
    Riz

    Yes, I already knew that it is not a bug.
    But, I got next step problem.
    I put "false" to "include-ignorable-whitespace" feature in xerces parser.
    But, I still found unnecessary TextNodes in my parser object.
    Feature link : http://xerces.apache.org/xerces-j/features.html.
    I use xerces-2_8_0.
    DOMParser parser = new DOMParser();
    parser.setFeature("http://apache.org/xml/features/dom/include-ignorable-whitespace", false);
    parser.parse(inputSource);
    document = ps.getDocument();
    System.out.println(document.getDocumentElement().getChildNodes().length()); // still wrong lengthIs tehre any example of usage this feature?
    What is default defination of white-space "\n "(enter with one space) or " "(juz white space) or something else?
    Thanks,

Maybe you are looking for