This discussion is archived
7 Replies Latest reply: Dec 3, 2012 9:37 PM by Sachinmrt RSS

xml data convert into only element data

Sachinmrt Explorer
Currently Being Moderated
Hello everybody,

I create a form which use the web service. My output is come in xml form like..

<NewDataSet>
<Table>
<PRIVATE_MARKA_BATCH_NO>0622</PRIVATE_MARKA_BATCH_NO>
</Table>
<Table>
<PRIVATE_MARKA_BATCH_NO>DOOR CABINET</PRIVATE_MARKA_BATCH_NO>
</Table>
</NewDataSet>




I want only element data like 0622, DOOR CABINET. Is it possible to remove the xml heading?? Please help..

Forms [32 Bit] Version 10.1.2.0.2 (Production)
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

Edited by: Sachingmrt on Nov 28, 2012 3:14 PM
  • 1. Re: xml data convert into only element data
    Prabodh Guru
    Currently Being Moderated
    >
    I create a form which use the web service. My output is come in xml form like..
    >
    I presume output=Response.
    >
    <NewDataSet>
    <Table>
    <PRIVATE_MARKA_BATCH_NO>0622</PRIVATE_MARKA_BATCH_NO>
    </Table>
    <Table>
    <PRIVATE_MARKA_BATCH_NO>DOOR CABINET</PRIVATE_MARKA_BATCH_NO>
    </Table>
    </NewDataSet>

    I want only element data like 0622, DOOR CABINET. Is it possible to remove the xml heading?? Please help..

    Forms [32 Bit] Version 10.1.2.0.2 (Production)
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

    >

    Use XQuery functions. You could start from here http://www.oracle.com/technetwork/articles/quinlan-xml-095823.html

    This is more of a SQL and PL/SQL query.

    Cheers,
  • 2. Re: xml data convert into only element data
    Sachinmrt Explorer
    Currently Being Moderated
    Dear Prabodh,

    It's really very good document. I am not able to register my schema. Please suggest how can i use this funtion DBMS_XMLSCHEMA.registerSchema for given below code and plz tell me if any simple way to convert xml output.


    My web service code is :-


    <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/">
    <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
    <s:element name="Get_MAC_ID">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="Issue_Branch" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="Type_Of_Material" type="s:string"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="Get_MAC_IDResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="Get_MAC_IDResult" type="s:string"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="Book_CP">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="l_ISSUE_BRANCH" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="l_PRIVATE_MARKA_BATCH_NO" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="l_ISR" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="l_CUSTOMER_ID" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="l_CRR_NO" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="l_WO_NO" type="s:string"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="Book_CPResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="Book_CPResult" type="s:int"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:schema>
    </wsdl:types>
    <wsdl:message name="Get_MAC_IDSoapIn">
    <wsdl:part name="parameters" element="tns:Get_MAC_ID"/>
    </wsdl:message>
    <wsdl:message name="Get_MAC_IDSoapOut">
    <wsdl:part name="parameters" element="tns:Get_MAC_IDResponse"/>
    </wsdl:message>
    <wsdl:message name="Book_CPSoapIn">
    <wsdl:part name="parameters" element="tns:Book_CP"/>
    </wsdl:message>
    <wsdl:message name="Book_CPSoapOut">
    <wsdl:part name="parameters" element="tns:Book_CPResponse"/>
    </wsdl:message>
    <wsdl:portType name="GIRServiceSoap">
    <wsdl:operation name="Get_MAC_ID">
    <wsdl:input message="tns:Get_MAC_IDSoapIn"/>
    <wsdl:output message="tns:Get_MAC_IDSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="Book_CP">
    <wsdl:input message="tns:Book_CPSoapIn"/>
    <wsdl:output message="tns:Book_CPSoapOut"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="GIRServiceSoap" type="tns:GIRServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="Get_MAC_ID">
    <soap:operation soapAction="http://tempuri.org/Get_MAC_ID" style="document"/>
    <wsdl:input>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="Book_CP">
    <soap:operation soapAction="http://tempuri.org/Book_CP" style="document"/>
    <wsdl:input>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="GIRServiceSoap12" type="tns:GIRServiceSoap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="Get_MAC_ID">
    <soap12:operation soapAction="http://tempuri.org/Get_MAC_ID" style="document"/>
    <wsdl:input>
    <soap12:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap12:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="Book_CP">
    <soap12:operation soapAction="http://tempuri.org/Book_CP" style="document"/>
    <wsdl:input>
    <soap12:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap12:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="GIRService">
    <wsdl:port name="GIRServiceSoap" binding="tns:GIRServiceSoap">
    <soap:address location="http://localhost:4300/GIRservicepublished/GIRService.asmx"/>
    </wsdl:port>
    <wsdl:port name="GIRServiceSoap12" binding="tns:GIRServiceSoap12">
    <soap12:address location="http://localhost:4300/GIRservicepublished/GIRService.asmx"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
  • 3. Re: xml data convert into only element data
    Prabodh Guru
    Currently Being Moderated
    a. You not really have to use the WSDL for this processing. It cannot be used to generate stubs/interfaces, like in .NET or Java, in PL/SQL.
    b. You also do not need to use SCHEMA

    All you need to use is to start from "Understanding XQuery Functions and Expressions" section in the link.
    The above is the faster / more efficient approach most of the time. For complex stuff you could also look at DBMS_XML* Packages in Packages and Types Reference documentation.

    If search the internet you will find some examples and code for using the above.
    Hint: Search with the package/function name and XML as keywords

    Cheers,
  • 4. Re: xml data convert into only element data
    Sachinmrt Explorer
    Currently Being Moderated
    Sir I use web service in form builder. and return output is

    <NewDataSet>
    <Table>
    <PRIVATE_MARKA_BATCH_NO>0622</PRIVATE_MARKA_BATCH_NO>
    </Table>
    <Table>
    <PRIVATE_MARKA_BATCH_NO>DOOR CABINET</PRIVATE_MARKA_BATCH_NO>
    </Table>
    </NewDataSet>


    which i displaying in text item. Now i want to show element value 0622, and DOOR CABINET and etc.
    If i store this data in xml table then how can i show it because this data in xml form. To resolve i have to register the schema as per the document. I am not able to register the schema. Second If i use

    select value(Person) asd
    from test_xml_tbl i,
    table(XMLSequence(
    extract(i.object_value, '/NewDataSet/Table/PRIVATE_MARKA_BATCH_NO'))) person
    where existsnode(i.object_value, '/NewDataSet/Table[@id="2006Sept1to30PA"]') = 1;

    then return data in xml form so i am not able see it. any conversion from xml to character??
  • 5. Re: xml data convert into only element data
    Prabodh Guru
    Currently Being Moderated
    Take at look at this. Especially, Example 13-1 the "Creating and Manipulating a DOM Document" section and example.

    Maybe this will be easier to implement.

    Cheers.

    PS: As suggested earlier. This ought to be in {forum:id=75}

    Edited by: Prabodh on Nov 29, 2012 2:54 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points