XSLT problem passing raw XML

Hello,
I've a problem passing a piece of raw XML code to an external assembly to do some tasks.
The problem is that if I use an XSLT like this:
<xsl:template name="xml-to-string-called-template">
   <xsl:param name="param1" />
          <xsl:element name="ns0:Root">
              <xsl:variable name="tryThisTemplate">
                  <xsl:text disable-output-escaping="yes"></xsl:text>
                      <xsl:call-template name="identity" />
                  <xsl:text disable-output-escaping="yes"></xsl:text>
              </xsl:variable>
<xsl:copy-of select="$tryThisTemplate" />
           </xsl:element>
</xsl:template>
<xsl:template name="identity" match="@*|node()">
   <xsl:copy>
<xsl:apply-templates select="@*|node()" />
   </xsl:copy>
 </xsl:template>
I have as output the XML with all tags like expected (the TestFunction take a string as input ad return the same string as output), like this:
<ns0:Root xmlns:ns0="http://BizTalk_Server_ProjectDemo.SchemaOut1Node">
- <ns0:Travel xmlns:ns0="http://BizTalk_Server_ProjectDemo.SchemaIN">
  <DateTimeStart>1999-05-31T13:20:00.000-05:00</DateTimeStart>
  <Field>Field_0</Field>
  </ns0:Travel>
 </ns0:Root>
The problem is that if I try to pass the variable to my external assembly, in this way:
<xsl:template name="xml-to-string-called-template">
   <xsl:param name="param1" />
          <xsl:element name="ns0:Root">
              <xsl:variable name="tryThisTemplate">
                  <xsl:text disable-output-escaping="yes"></xsl:text>
                      <xsl:call-template name="identity" />
                  <xsl:text disable-output-escaping="yes"></xsl:text>
              </xsl:variable>
              <xsl:variable name="pCC" xmlns:ScriptNS0="http://schemas.microsoft.com/BizTalk/2003/ScriptNS0"
select="ScriptNS0:TestFunction($tryThisTemplate)" />
                <xsl:text disable-output-escaping="yes"></xsl:text>
<xsl:copy-of select="$pCC" />
                <xsl:text disable-output-escaping="yes"></xsl:text>
           </xsl:element>
</xsl:template>
saving its return value and printing it, I have as output the values of fields contained in $tryThisTemplate variable, and not all the XML like I need:
<ns0:Root xmlns:ns0="http://BizTalk_Server_ProjectDemo.SchemaOut1Node">1999-05-31T13:20:00.000-05:00
Field_0</ns0:Root>
What can I do to pass all the raw XML to my function and not the values of its fields?
I tried to declare the output method as like xml than html or text but nothing changed

First, of all your input xml has invalid namespace declaration, is this like below what mean to say:
<ns0:Root xmlns:ns0="http://BizTalk_Server_ProjectDemo.SchemaOut1Node">
  <ns1:Travel xmlns:ns1="http://BizTalk_Server_ProjectDemo.SchemaIN">
    <DateTimeStart>1999-05-31T13:20:00.000-05:00</DateTimeStart>
    <Field>Field_0</Field>
  </ns1:Travel>
</ns0:Root>
Second, you can achieve what you are trying to map using very simple map like below:
and you can see the xslt is generated like below:
<?xml version="1.0" encoding="UTF-16"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var s0 userCSharp" version="1.0" xmlns:s0="http://BizTalk_Server_ProjectDemo.SchemaIN" xmlns:ns0="http://BizTalk_Server_ProjectDemo.SchemaOut1Node" xmlns:userCSharp="http://schemas.microsoft.com/BizTalk/2003/userCSharp">  <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />  <xsl:template match="/">    <xsl:apply-templates select="/ns0:Root" />  </xsl:template>  <xsl:template match="/ns0:Root">    <xsl:variable name="var:v1" select="userCSharp:StringConcat(string(s0:Travel/DateTimeStart/text()) , &quot;  &quot; , string(s0:Travel/Field/text()))" />    <ns0:Root>      <xsl:value-of select="$var:v1" />    </ns0:Root>  </xsl:template>  <msxsl:script language="C#" implements-prefix="userCSharp"><![CDATA[public string StringConcat(string param0, string param1, string param2){   return param0 + param1 + param2;}]]></msxsl:script></xsl:stylesheet>
Third, if you are really interested passing your whole using xslt, then probably this artical will be helpful to you
http://connectedpawns.wordpress.com/2009/08/01/how-to-copy-the-entire-node-to-element-of-string-type-in-a-map/
Please mark it as Answer if this answers your question
Thanks.
Mo
The contents I write here is my personal views, not the view of my employer and anyone else.
Thank you, yes you're right about the namespaces, but this is only a proof of concept ant I have to adjust it.
What is the functoid you put in the map? And can I pass its output to an external assembly as parameter? (I need to do it and return the output to a certain schema node).
Thank you

Similar Messages

  • Problem passing a XML parameter

    Mrs,
    I need to pass a XML parameter from an OAF page to an external page. Below there is a piece of code where I did it at first (through parameters - GET). The problem: the XML has a variable length, so it can be bigger than GET limits.
    How could I pass it via POST? Put it on an OAFormValueBean doesn't seems to be a good answer, since XML tags ("<" and ">") and accents (we use Portuguese - BR) get processed in &xxx; notation. Therefore, as you can see, the page it's only used to mount XML and call another page.
    Dev Guide has a chapter "Posting to an OA Framework Page from a Different Technology". I think I need something like "POSTING FROM AN OA FRAMEWORK PAGE TO A DIFFERENT TECHNOLOGY".
    Any ideas?
    Tks.
    Elner Ribeiro
    CODE:
    processRequest()
    String xmlData = "<ReservaMultiGDSRoot>" + xmlPassag + xmlContato + "</ReservaMultiGDSRoot>";
    HashMap par = new HashMap();
    par.put("XmlData",xmlData);
    par.put("UrlPostBack","https://oafHost/OA_HTML/OA.jsp?page=/oracle/apps/xx/xx/webui/xxPG");
    pageContext.forwardImmediately("http://externalUrl/page.aspx",
    OAWebBeanConstants.REMOVE_MENU_CONTEXT,
    par,
    false,
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    }

    forwardImmediately would just forward the request to the indicated resource.
    "POSTING FROM AN OA FRAMEWORK PAGE TO A DIFFERENT TECHNOLOGY".
    doing this means you are leaving the apps context and going to a different location, which is out of apps security.As a workaround what you can do is:
    1. Create a jsp in $OA_HTML
    2. From your OA page, navigate to this jsp, as a normal url link destination
    3. in the jsp, use ServletSessionManager.getURL ("<url>") and then post the data to the page you want to visit.
    4. Remember to define a function in the same menu to navigate to the jsp.
    Thanks
    Tapash

  • Styling XML with XSLT Problem with javax.xml.transform???

    I have been trying to make a transformation and seem to be having a problem in that javax.xml.transform can not be found while using jdk1.3....If I use jdk1.4, there is no problem....
    Does anyone know how I can get things to work using jdk1.3???
    (Description of what I am doing...1) Building XML Source 2) Setting up the XSLT File 3) Building Source Object 4) Build Result Object 5) Transforming the Data.....MY RESULT SHOULD BE AN HTML PAGE)
    I have tried putting xerces.jar and xalan.jar in my CLASSPATH....but this still doesn't work....onyl thing that has worked is using jdk1.4 as my JAVA_HOME....
    PLEASE HELP!!!!

    PLEASE HELP....your advice here would be greatly appreciated.....

  • Need Help with send raw xml to PHP from flex

    Hello all,
    I am trying to pass raw XML from flex to php.
    I can pass the data using get but need to use POST.
    When I submit the data via POST
    the data is not available in $HTTP_RAW_POST_DATA.
    Any help is greatly appreciatted

    Hello all,
    I am trying to pass raw XML from flex to php.
    I can pass the data using get but need to use POST.
    When I submit the data via POST
    the data is not available in $HTTP_RAW_POST_DATA.
    Any help is greatly appreciatted

  • Problems passing xml to svg

    Hi, i tried to pass a xml to svg but the program is blocking, but when i go to work admin in windows, i show the process that i lunch, and it's waiting for the processor.
    When i stop the application, the xml process runs, like jave stop it. I prove with an inputstream and a bufferedreader ...but nothing, Here is my code, (the process that pass svg to png is similiar and it works!!!)
      String aux1="c:\\hlocal\\GOPIRO\\XML\\ProgTransformacionAsvg\\xml tr      c:\\hlocal\\GOPIRO\\XML\\osmarender.xsl c:\\hlocal\\GOPIRO\\XML\\osm-map-features-z17.xml > c:\\hlocal\\GOPIRO\\Imagen\\map.svg";
      Process p1 = Runtime.getRuntime().exec(aux1);
                p1.waitFor();
                InputStream is1=p1.getInputStream();
                BufferedReader br = new BufferedReader (new InputStreamReader (is1));
                String aux_1 = br.readLine();
                while (aux_1!=null)
                    System.out.println (aux_1);
                    aux_1 = br.readLine();
                }Thank you everybody

    I also tried that way without any luck :(
    It would be great to find solution.

  • Passing an XML file from WebDynpro app to ABAP function module

    Hi all,
    I'm stuck with a problem, and am hoping one of you could let me know how to proceed:
    I need to pass an XML file (or at least the entire content of the XML) from my WebDynpro application to a backend ABAP function module. What I tried was this:
    In my WebDynpro app, I read the XML and convert the content into one long string (using java.io.FileReader and java.io.BufferedReader). In my ABAP function module I created an import parameter of type String. I then imported the ABAP Function module into my WebDynpro app as a model. I then tried to pass the XML string to the ABAP module. What happens is this:
    If the size of the string (XML) happens to be less than 255 characters, then it works. That is, the string is passed to the ABAP function module and I can see the contents. However, if the XML string happens to be greater than 255 characters, then it does not work. The string at the ABAP side is empty. Surprisingly, the ABAP module does not throw an error either. It just displays an empty string.
    Could you please tell me what the problem is?
    Thanks & Regards,
    Biju

    Hi Biju ,
    Welcome to SDN.
    If the import parameter is defined as type string it should work, however did you check whether your application pass it properly?
    I have applications using strings as import parameters working fine. (webapplications (BSP) to RFC)
    Regards
    Raja

  • XSLT Problem with soap namespace

    Hi there,
    I have a problem transforming an XML doc with soap elements, using XSLT (Xalan).
    Here's the input:
    <?xml version = "1.0" encoding = "ISO-8859-1"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.ean.nl">
      <testthis>123456</testthis>
    </soap:Envelope>and here's the XSL:
    <?xml version="1.0"?>
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" exclude-result-prefixes="soap">
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="soap:Envelope">
    <Orders>
         <H01>
              <xsl:value-of select="testthis"/>
         </H01>
    </Orders>
    </xsl:template>
    </xsl:transform>I expect to get something like:
    <?xml version="1.0" encoding="UTF-8"?>
    <Orders>
    <H01>123456<H01>
    <Orders>But instead I get:
    <?xml version="1.0" encoding="UTF-8"?>
    <Orders>
    <H01/>
    </Orders>I've tried a lot of things and I'm probably overseeing something stupid, but I'm stuck.
    It seems as if anything without soap: namespace cannot be processed by my XSL (when I add it in the input XML and XSL it works).
    Any help would be greatly appreciated.
    Greetings,
    Erik

    Yes, I found it!
    The following XSL for the same XML doc works!
    <?xml version="1.0"?>
    <xsl:transform xmlns:ean="http://www.ean.nl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" exclude-result-prefixes="soap">
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="soap:Envelope">
    <Orders>
         <H01>
              <xsl:value-of select="ean:testthis"/>
         </H01>
    </Orders>
    </xsl:template>
    </xsl:transform>Thanks, you pointed me in the right direction :-)
    Erik

  • Real simple xslt problem/question

    Hi, i have a real simple xslt problem but i just cant figure out how to do it by looking at various examples on the net. i have a xml document and in it are some elements with a "result" tag name. i want to use xslt to reproduce exactly the same xml document except with an attribute called "id" added to those elements with a "result" tag name. i'm sure that theres a simple solution to it but i just cant figure it out. any helps greatly appreciated, thanks

    Start with the XSLT identity transform (I don't have it handy and it's fairly long, but you should be able to google it up). Add this:<xsl:template match="result">
      <result id="">
        <xsl:apply-templates>
      </result>
    </xsl:template>

  • GUI_UPLOAD - Problem in uploading xml file

    Hi,
    I have problem in uploading xml file into itab.
    Here is the code
    begin of GS_STRING,
            STR(72) type C,
          end of GS_STRING,
          GT_STRING like standard table of GS_STRING,
    call function 'GUI_UPLOAD'
          EXPORTING
            FILENAME                = FILE_NAME
            FILETYPE                = 'ASC'
          TABLES
            DATA_TAB                = GT_STRING
          EXCEPTIONS
            FILE_OPEN_ERROR         = 1
            FILE_READ_ERROR         = 2
            NO_BATCH                = 3
            GUI_REFUSE_FILETRANSFER = 4
            INVALID_TYPE            = 5
            NO_AUTHORITY            = 6
            UNKNOWN_ERROR           = 7
            BAD_DATA_FORMAT         = 8
            HEADER_NOT_ALLOWED      = 9
            SEPARATOR_NOT_ALLOWED   = 10
            HEADER_TOO_LONG         = 11
            UNKNOWN_DP_ERROR        = 12
            ACCESS_DENIED           = 13
            DP_OUT_OF_MEMORY        = 14
            DISK_FULL               = 15
            DP_TIMEOUT              = 16
            others                  = 17.
        if SY-SUBRC <> 0.
          message I499(SY) with 'File upload failed'.
          stop.
        endif.
      endif.
    In debuggin mode, i can see the itab uploaded with xml payload. But in that same place, the hexadecimal format has double zeros 00 after each character.
    XML message : <?xml
    Correct Hexadecimal : 3C3F786D6C
    Hexadecimal in itab  : 3C003F0078006D006C00
    This makes the resultant xml invalid.
    can anyone help me to solve this?
    Thanks,
    Uma
    Edited by: Uma Maheswari on May 30, 2008 4:15 PM

    what do you want to do with the uploaded XML?
    i use the following
    constants: line_size type i value 255.
    data: begin of xml_tab occurs 0,
               raw(line_size) type x,
            end   of xml_tab,
            file  type string,
            size  type i.
    call function 'GUI_UPLOAD'
        exporting
          filename            = filename
          filetype            = 'BIN'
          has_field_separator = ' '
          header_length       = 0
        importing
          filelength          = size
        tables
          data_tab            = xml_tab
        exceptions
          others              = 1.

  • How to pass a xml CDATA in string element when OSB calling a webservice?

    How to pass a xml CDATA in string element when OSB calling a webservice?
    I have a business service (biz) that route to operation of a webservice.
    A example of request to this webservice legacy:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eg="example">
    <soapenv:Header/>
    <soapenv:Body>
    <ex:execute>
    <ex:arg><![CDATA[<searchCustomerByDocumentNumber>
    <documentNumber>12345678909</documentNumber>
    </searchCustomerByDocumentNumber>]]></ex:arg>
    </ex:execute>
    </soapenv:Body>
    </soapenv:Envelope>
    the type of ex:arg is a string.
    How to pass this CDATA structure to webservice in OSB?

    Steps to solve this problem:
    1. Create a XML Schema. E.g.:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         elementFormDefault="unqualified">
         <xs:complexType name="searchCustomerByDocumentNumber">
              <xs:sequence>
                   <xs:element name="documentNumber" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation>
                             </xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:string" />
                        </xs:simpleType>
                   </xs:element>
         </xs:sequence>
         </xs:complexType>
         <xs:element name="searchCustomerByDocumentNumber" type="searchCustomerByDocumentNumber"></xs:element>
    </xs:schema>
    With this XSD, the XML can be generate:
    <?xml version="1.0" encoding="UTF-8"?>
    <searchCustomerByDocumentNumber xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="searchCustomerByDocumentNumber.xsd">
    <documentNumber>documentNumber</documentNumber>
    </searchCustomerByDocumentNumber>
    2. Create a XQuery to create a searchCustomerByDocumentNumber ComplexType. E.g.:
    (:: pragma bea:global-element-return element="searchCustomerByDocumentNumber" location="searchCustomerByDocumentNumber.xsd" ::)
    declare namespace xf = "http://tempuri.org/NovoSia/CreateSearchCustomerByDocumentNumber/";
    declare function xf:CreateSearchCustomerByDocumentNumber($documentNumber as xs:string)
    as element(searchCustomerByDocumentNumber) {
    <searchCustomerByDocumentNumber>
    <documentNumber>{ $documentNumber }</documentNumber>
    </searchCustomerByDocumentNumber>
    declare variable $documentNumber as xs:string external;
    xf:CreateSearchCustomerByDocumentNumber($documentNumber)
    3. In your stage in pipeline proxy add a assign calling the XQuery created passing the document number of your payload.
    Assign to a variable (e.g.: called searchCustomerByDocumentNumberRequest)
    4. Create another XQuery Transformation (XQ) to create a request to the webservice legacy. E.g.:
    <ex:arg>{fn-bea:serialize($searchCustomerByDocumentNumberRequest)}</ex:arg>
    For more information about xquery serialize function:
    41.2.6 fn-bea:serialize()
    You can use the fn-bea:serialize() function if you need to represent an XML document as a string instead of as an XML element. For example, you may want to exchange an XML document through an EJB interface and the EJB method takes String as argument. The function has the following signature:
    fn-bea:serialize($input as item()) as xs:string
    Source: http://docs.oracle.com/cd/E14571_01/doc.1111/e15867/xquery.htm

  • XML Forms show raw xml after transport

    Hallo experts,
    at the moment I am working to set up a SAP Enterprise Portal 7.4. I was able to export KM content from our old 7.0 portal.
    The only problem i am experiencing is that xml forms, that I exported and imported through standard KM export / import, are showing as raw xml.
    The forms are available in forms builder and I also generated a preview (compiled the form) for each form and saved after that.
    There are no errors in the log that point me in a direction, so please help.
    Do you have any ideas what I am missing?
    Best regards,
    André

    Hi Zlatin,
    -> 1
    By Default identic properties queries are connected by an 'OR'.
    Please have a look into the documentation for further info.
    http://help.sap.com/saphelp_nw04/helpdata/en/85/80b3d4c9ef11d5993e00508b6b8b11/frameset.htm
    -> Search Options
    So far it's not possible to connect two identic proerties by an 'AND' within the standard.
    You can preset a search filter via the relevant Search Option Set.
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/765140c770cd01e10000000a155106/frameset.htm
    Regards Matthias Röbig-Landau

  • Need HELP passing raw SOAP to JAX-RPC Web Service

    Ive recently downloaded the web services development kit from the SUN site and have got all the examples to work fine.
    What I am now trying to do is pass RAW SOAP to the HelloWorld JAX-RPC example,
    Ive managed to get the service to call the sayHello function with no params which returns 'Hello NULL'.
    I can't however get any parameters to be passed to the sayHello function,
    Below is the existing SOAP ive got calling the function with no params.
    <?xml version="1.0"?>
    <soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><sayHello xmlns="http://hello.org/wsdl">????????????</sayHello></soap:Body></soap:Envelope>
    If anybody could tell me what I need to replace ???????????? with then I would be more than gratefull.
    P.s If I changed the webservice to accept multiple arguments what would I need to put in my SOAP?
    Yours,
    Cris.

    Thanks for your help on this one. However there is still one thing I don`t understand.
    In the example SOAP I posted on the orignal message I have added the namespace ns1 pointing to
    http://hello.org/wsdl
    The example you posted goes to http://caller.org/wsdl
    below is SOAP you posted for me.
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns0="http://caller.org/wsdl"
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <env:Body>
    <ns0:sayHello>
    <String_1 xsi:type="xsd:string">some text</String_1>
    </ns0:sayHello>
    </env:Body>
    </env:Envelope>
    This returns me an error! However If I change ns0 to point to http://hello.org/wsdl it all works perfectly.....
    If you open a browser and go to http://hello.org/wsdl OR http://caller.org/wsdl neither URL points to anything!!!!!!! All the other namespaces used point to valid XML Schemas, which makes sense.
    So how can this SOAP message work if the namespace ns0 is nothing???????????
    Yours,
    Cris.

  • Java SAX parser. How to get raw XML code of the currently parsing event?

    Java SAX parser, please need a clue how to get the raw XML code of the currently parsing event... needed for logging, debugging purposes.
    Here's and example, letting me clarify exactly what i need: (see the comments in source)
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
         //..Here... or maybe somewhere elsewhere I need on my disposal the raw XML code of
         //..every XML tags received from the XML stream. I need simply to write it down
         //..in a log file, for debugging purposes, while parsing. Can anyone give me a suggestion
         //..how can i implement such logging while the SAX parser only returns me the tagname and
         //..attributes. While parsing I want to log the XML code for every tag in
         //..its 'pure form', like it is comming from the server directly on the
         //..socket's input reader.
         if ("p".equals(qName)) {
              etc...
    }Than you in advance.

    YES!
    I've solved my problem using class RecordingInputStream that wraps the InputStream
    here is the class source code:
    import java.io.ByteArrayOutputStream;
    import java.io.FilterInputStream;
    import java.io.InputStream;
    import java.io.IOException;
    * @author Unknown
    class RecordingInputStream  extends  FilterInputStream {
         protected ByteArrayOutputStream sink;
        RecordingInputStream(InputStream in) {
            this(in, new ByteArrayOutputStream());
        RecordingInputStream(InputStream in, ByteArrayOutputStream sink) {
            super(in);
            this.sink = sink;
        public synchronized int read() throws IOException {
            int i = in.read();
            sink.write(i);
            return i;
        public synchronized int read(byte[] buf, int off, int len) throws IOException {
            int l = in.read(buf, off, len);
            sink.write(buf, off, l);
            return l;
        public synchronized int read(byte[] buf) throws IOException {
            return read(buf, 0, buf.length);
        public synchronized long skip(long len) throws IOException {
            long l = 0;
            int i = 0;
            byte[] buf = new byte[1024];
            while (l < len) {
                i = read(buf, 0, (int)Math.min((long)buf.length, len - l));
                if (i == -1) break;
                l += i;
            return l;
        byte[] getBytes() {
            return sink.toByteArray();
        void resetSink() {
            sink.reset();
    } Then here is the initialization before use with SAX:
    this.psock = new Socket(this.profile.httpServer, Integer.parseInt(this.profile.httpPort));
    this.out = new PrintWriter(this.psock.getOutputStream(), true);
    this.ris=new RecordingInputStream(this.psock.getInputStream());
    this.in=new BufferedReader(new InputStreamReader(this.ris));
    try {
         this.parser = SAXParserFactory.newInstance().newSAXParser();
         this.parser.parse(new InputSource(this.in),new XMLCommandsHandler());
    catch (IOException ioex) {  }
    catch (Exception ex) {  }Then the handler class looks like this (it will be an inner class, so you can access ris, from the parent class):
    class XMLCommandsHandler extends DefaultHandler {
         public void startDocument() throws SAXException {
              //...nothing
         public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
              // BEGIN - Synchronized logging of raw XML source code in parallel with SAX parsing :)
              byte[] bs=ris.getBytes();
              logger.warn(new String(bs));
              ris.resetSink();
              // End logging
              if ("expectedTagThatTriggersMeToDoSomething".equals(qName)) {
                   //...Do smth.
    }Edited by: patladj on Jul 3, 2008 12:30 PM

  • Need example on passing an XML object to a JWS webservice

    Hello,
    Does anyone have an example on how to pass an xml object to a JWS webservice?
    I have created a webservice and passed parameters as such:
    https://myserver.test.com:7777/lookups/lookups_db/AmsDBClient.jws/getStaffInformation?userName=kkwiatek
    But there has got to be a way to pass an xml object, right? How?
    Thanks,
    Keith

    As an example of a JWS that expects and XML Object, try a method like the following:
    public XmlObject simpleXmlObject(noNamespace.PurchaseOrderDocument poDoc){
    return XmlObject.Factory.parse("<newXml>"+poDoc.xmlText()+"</newXml>");
    where noNamespace.PurchaseOrderDocument comes from compiling the po.xsd that is available in the W3C XML Schema spec.
    From your URL it appears you are trying to use a REST style web service. Is this correct?
    You will NOT be able to invoke this method via a get query like you mention below. For you to invoke this method you should use SOAP over HTTP.
    Are you still having problems with this?

  • How to perform an xslt transformation on an xml document dynamically ?

    Hi all,
    I'd like to perform an xslt tranformation on a dynamically generated xml code. I'm looking for a tag which can by useful for it. The tag should take both xml code and xslt code, passed as String arguments (not as names of xml and xslt files). I tried to use xtags library and jstl:transform tag but it did not work. It worked only with plain xml code passed to x-tag. When I try to perform a transformation on a tag body containing an output text tag, the transformation formats only this tag, not its content.
    For example:
    <xtags:style xslt="xslName.xsl">
    <h:outputText value="#{beanName.stringPropertyName}"/>
    </xtags:style>
    Thanks in advance
    Message was edited by:
    opad

    The issue is in the logic f your XSL mapping.
    Use the same source XML and use it with XML Spy to debug why it is not working as you want it to.
    Regards
    Bhavesh

Maybe you are looking for

  • Unable to start gnome-session or gdm

    Sorry for the vague title. I don't really have any specifics to go on for this problem. When I try to start a gnome-session through startx, I get a screen that says, "Oh no! Something has gone wrong", with no error outputs in xsession-errors. First o

  • WebUtil & Client_OLE2 - Urgent!

    Hi! I use Oracle9iASR2, Forms9i (Patch 9.2.0.3) and JInitiator 1.3.1.13! I was following all webutil_manual.pdf and readme.html steps! I have no problem with client_get_file_name or client_host calls, but I have a tedious problem when I'm trying to c

  • Help!  Form is not submitting or doing anything! Any ideas?

    I inherited this web application and have zero CF experience and any help is greatly appreciated!  So, the "Forgot Password" form isn't working at all.  The email is sent properly from the referring page and when you click the link it brings up the p

  • Question on hooking up an Audigy 2zs to my home theatre syste

    im trying to hook up my home theatre system to my pc. does anybody know if the "creative sound blaster digital I/O module cable" (which is an adapter that converts /8" headphone jack to a digital optical cable), is compatible with the Audigy 2zs card

  • IPhone 5 same electrical charger can be use abroad ?

    Hi,          I purchased iPhone 5 on December 2012 in USA.          I am going for a trip to Singapore, Malaysia and Bangkok. My question is " Can I use the same Electrical charger to charge my iPhone 5 in those countries or do I need to buy an exter