Xpath query ..looks tricky

Hi ,
The following is the xml file that i am using.
I want to generate an xpath that will give me an String output such as
"doc1,doc2,doc3,doc4,doc5."
I tried many options either i am able to get a nodelist or only one string (the first doc -
doc1) as output
Can you please tell me how to go about this.
<information>
     <reference>
          <docid>doc1</docid>
     </reference>
     <reference>
          <docid>doc2</docid>
     </reference>
     <reference>
          <docid>doc3</docid>
     </reference>
     <referece>
          <docid>doc4</docid>
     </reference>
     <reference>
          <docid>doc5</docid>
     </reference>
</information>Thanks for your time

Many thanks.. i actually iterated through the node list and got it done..but now i am stuck with a stream.closed error.. my code is as follows..i tried resetting the buffer..and creating a new InputSource.. but yet i get the same error..
ByteArrayInputStream baIs = new ByteArrayInputStream(strr.getBytes());
     BufferedReader bfr = new BufferedReader(new InputStreamReader(baIs));    
      InputSource ins = new InputSource(bfr);
      String ipcCountText = "count(//foreign-reference/ipc)";
      String ipcCount  = (String) xpathEvaluator.evaluate(ipcCountText, ins,
                                                        XPathConstants.STRING);
      Integer intIpcCount = new Integer(ipcCount);
      int ipcCnt = intIpcCount.intValue();
      StringBuffer sb= new StringBuffer();
      String xp = null;
      for(int i=1;i<(ipcCnt+1);i++)
        xp = "//foreign-reference[" + i + "]/ipc";       
        sb.append((String) xpathEvaluator.evaluate(xp, ins, XPathConstants.STRING));
        sb.append(", ");    
     System.out.println("[OUTPUT] = " + sb.toString());output
java.io.IOException: Stream closed
     at java.io.BufferedReader.ensureOpen(Unknown Source)
     at java.io.BufferedReader.read(Unknown Source)
     at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)
     at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipString(Unknown Source)
     at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
     at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
Can you please suggest what problem this could be.. i have been struggling with it for some time... hope its not something really silly that i have missed out....
Thanks a lot for your help...

Similar Messages

  • Binding parameter to SQL/xpath query using java/jdbc

    I'm trying to execute a query containing an xpath.
    The query looks like this:
    select * FROM table  t where t.column.existsNode('/RootElement[contains(SubElement, "someVal")]/SubElement')In java replacing the "someVal" with a bind parameter "?" will not work:
    PreparedStatement ps = c.prepareStatement("select * FROM table t where t.column.existsNode('/RootElement[contains(SubElement, ? )]/SubElement') = 1");
    ps.setString(1,"someVal");
    =EXCEPTIONOn this forum I found that you can also use '||:namedParam||'
    So the query in java would be executed like;
    PreparedStatement ps = c.prepareStatement("select * FROM table t where t.column.existsNode('/RootElement[contains(SubElement, '||:1||' )]/SubElement') = 1");
    ps.setString(1,"someVal");This seems to work (I have no idea what the '|| ||' construct does, I don't seem to find any info about it)
    HOWEVER, it seems that doing it this way the value being bound is NOT escaped.
    So, doing this will yield in an orcale SQL/xpath exception:
    ps.setString(1,"som'eVal");
    I've went to all the oracle xml manual stuff I could find, but nowhere do they address this.
    Any one an idea how I can bind the value and still have escaping ?
    Edited by: user5893566 on Nov 27, 2008 12:06 AM
    Edited by: user5893566 on Nov 27, 2008 12:15 AM

    Would you mind explain me what the replace actually does?The idea is like this:
    Let's start with a string like some'V"al and surround it by the concat function:
      '...concat("' || some'V"al || '") ....' {code}
    replace the inner (i.e. all) double quotes with +",''","+ to obtain '...concat("' || some'V",''"'',"al || '") ...' {code}
    So this concatenates three parts of the original string where the double quotes are now enclosed by two single quotes. The resulting string should look like
    {code} '...concat("some'V",''"'',"al") ...'i.e. first argument of concat is enclosed by double quotes, the second one by two single quotes and the third one again by double quotes.  This is just a rewritten form of our original string!.
    Now incorporate the whole thing in the xpath expression  as shown in my previous example and it should work ;)
    hth
    michael                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • XPath Query Language Reference

    Aside from the three little examples given in the 11g Guide and the B2B Tech Note #011, is there a reference available for the XPath Query Language used by B2B? Is is possible to use complex XPath queries in the B2B Doc Definitions?

    I'm mainly just looking for the full capabilities of the queries.
    Specifically, at the moment, I'm looking for a way to match the value of a node to a group of values (like a sql 'in') as well as check the existence and value of other nodes within the same query.
    Do the documents I find for 'Preference XPath' pertain here?

  • Human Workflow Task XPath query string returns multiple nodes.

    I am looking for trouble shooting help for this error. I am no sure if it is a server or jdev issue.
    I am running JDev version 10.1.3.3 and console version 10.1.3.1.0 locally.
    General information on the BPEL process:
    I have a temporary table in Oracle lite that I created items to be review by the user. I created a synchronous BPEL process. The first step in developing this process, I created the straight forward invoke the table to get the records, transform the records with a change the approve flag = "Y", and invoke the table to update the records. Works like a charm. I followed the online tutorial by dropping a human task after the transform, configured the parameters, setup the assignments, and moved the invoke to update table under the approved condition. If the table has only one record, the process runs great but if there are two records I get the following error message.
    <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"><part name="summary"><summary>XPath query string returns multiple nodes.
    According to BPEL4WS spec 1.1 section 14.3, The assign activity part and query /ns3:TempItemCollection/ns3:TempItem/ns3:ItemNbr should not return multipe nodes.
    Please check the BPEL source at line number "178" and verify the part and xpath query /ns3:TempItemCollection/ns3:TempItem/ns3:ItemNbr.
    </summary>
    </part></selectionFailure>
    =================
    The error occurs in the first assign of the Human task after the assign copies the fields for the title. I underlined line number 178.
    <correlationSets>
    <correlationSet name="WorkflowTaskIdCor"
    properties="taskservice:taskId"/>
    </correlationSets>
    <sequence>
    <assign name="HumanTask1_1_AssignTaskAttributes">
    <copy>
    <from expression="concat(ora:getProcessURL(), string('/HumanTask1/HumanTask1.task'))"/>
    <to variable="initiateTaskInput" part="payload"
    query="/taskservice:initiateTask/task:task/task:taskDefinitionURI"/>
    </copy>
    <copy>
    <from expression="number(3)"/>
    <to variable="initiateTaskInput" part="payload"
    query="/taskservice:initiateTask/task:task/task:priority"/>
    </copy>
    <copy>
    <from>
    <payload xmlns="http://xmlns.oracle.com/bpel/workflow/task">
    <Case xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <CourtDate xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <ErrorMessage xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <ItemName xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <Payment xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <Zip xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <ProcessFlag xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <LastUpdated xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <AddedDate xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <CityAttnyAmount xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <ApprovalFlag xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <ProlawKey xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    <ProcessKey xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
    </payload>
    </from>
    <to variable="initiateTaskInput" part="payload"
    query="/taskservice:initiateTask/task:task/task:payload"/>
    </copy>
    <copy>
    <from expression="concat(string('Item Fee Approval '), bpws:getVariableData('Invoke_1_Select_RecordsSelect_OutputVariable','TempItemCollection','/ns3:TempItemCollection/ns3:TempItem/ns3:ItemName'))"/>
    <to variable="initiateTaskInput" part="payload"
    query="/taskservice:initiateTask/task:task/task:title"/>
    </copy>
    <copy>
    <from variable="Invoke_1_Select_RecordsSelect_OutputVariable"
    part="TempItemCollection"
    query="/ns3:TempItemCollection/ns3:TempItem/ns3:ItemNbr"/>
    <to variable="initiateTaskInput" part="payload"
    query="/taskservice:initiateTask/task:task/task:payload/task:Item"/>
    </copy>
    <copy>
    Thank you for any help you can give me.

    Here is how I solved this problem: I was told by the metalink folks that I should use the same verion of SOA console as jdev. So I went back to jdev 10.1.3.1. Rather than reading from the Oracle lite table, I dumped the table into a flat file. I read flat file and populated the workflow. Remember to set the 'messages in batch' flag in the file adapter to 1 and the number of records to skip to zero in the format builder for the flat file. The process now reads each record and creates an instance for that each record. In other words, if I have 8 records in my flat file, I will have 8 instances of the process running on the console. Thanks Jeremy for your help figuring this out.
    Edited by: user7725126 on Nov 19, 2009 3:56 PM

  • XPATH query behaves differently depending on presence of default namespace

    I'm curious to know why an XPATH query seems to behave differently depending on whether the default namespace is present in the query.
    My test case is as follows:
    I use a table called xml_messages (id number, message xmltype) containing two rows - one where xmlns is specified and the other without.
    1. Default namespace is specified:
    <?xml version="1.0"?>
    <Bereken xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Fout="false" Identifier="21-4-2008 12:55:02" xmlns="http://schemas.myco.nl/services/IPP">
    <Reglementen>
    <Reglement Ind="21000005" dlnsts="6">
    <Producten>
    <Product Ind="1002" ogr="27098.00" bbr="27098.00" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1032" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1052" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1062" ogr="0" bbr="2389.968" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3002" ogr="18968.00" bbr="5690.4" igl="0" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3032" ogr="0" bbr="0" igl="0" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3502" ogr="2845.00" bbr="2845.00" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="5002" ogr="3794.00" bbr="3794.00" igl="0" elt="18" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7502" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7503" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="8101" ogr="0" bbr="0" igl="65" elt="65" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7002" ogr="0" bbr="8724.6" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7202" ogr="0" bbr="0" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7302" ogr="0" bbr="0" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    </Producten>
    </Reglement>
    </Reglementen>
    <Parameters gbtd="1957-12-18T00:00:00.0000000+01:00" gsl="Vrouw" pdr="2008-03-01T00:00:00.0000000+01:00" hdgs="40000" ptp="100" />
    </Bereken>
    2. No default namespace specified:
    <?xml version="1.0"?>
    <Bereken xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Fout="false" Identifier="21-4-2008 12:55:02" >
    <Reglementen>
    <Reglement Ind="21000005" dlnsts="6">
    <Producten>
    <Product Ind="1002" ogr="27098.00" bbr="27098.00" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1032" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1052" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="1062" ogr="0" bbr="2389.968" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3002" ogr="18968.00" bbr="5690.4" igl="0" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3032" ogr="0" bbr="0" igl="0" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="3502" ogr="2845.00" bbr="2845.00" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="5002" ogr="3794.00" bbr="3794.00" igl="0" elt="18" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7502" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7503" ogr="0" bbr="0" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="8101" ogr="0" bbr="0" igl="65" elt="65" pgs="63758.00" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7002" ogr="0" bbr="8724.6" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7202" ogr="0" bbr="0" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    <Product Ind="7302" ogr="0" bbr="0" igl="65" elt="130" pgs="0" slt="65" plt="0" reg="0" orf="0" />
    </Producten>
    </Reglement>
    </Reglementen>
    <Parameters gbtd="1957-12-18T00:00:00.0000000+01:00" gsl="Vrouw" pdr="2008-03-01T00:00:00.0000000+01:00" hdgs="40000" ptp="100" />
    </Bereken>
    Next, I use the following two queries to get attribute values from the xml messages:
    First query using xmlns:
    select extractvalue(value(v),'/Product/@Ind' ) ind
    , extractvalue(value(v),'/*/@Ind' ) ind2
    from xml_messages f
    , TABLE(XMLSequence( extract(f.message
         ,'/Bereken/Reglementen/Reglement/Producten/Product'
                                  ,'xmlns="http://schemas.myco.nl/services/IPP"'
                                  ))) v
    where f.id = 1; -- Selects from the xmltype message that does have xmlns specified
    This returns (as the first row)
    IND IND2
    ____ 1002
    ^
    |------ Nothing is returned by the XPATH /Product/@Ind
    Second without using xmlns
    select extractvalue(value(v),'/Product/@Ind' ) ind
    , extractvalue(value(v),'/*/@Ind' ) ind2
    from xml_messages f
    , TABLE(XMLSequence( extract(f.message
         ,'/Bereken/Reglementen/Reglement/Producten/Product'
                                  ))) v
    where f.id = 2; -- Selects from the xmltype message that has no xmlns
    This returns (as the first row)
    IND IND2
    1002 1002
    According to XMLSpy, the correct XPATH to get the "Ind" attribute is "/Product/@Ind" so what I dont understand is why query one doesnt return any data when using a default namespace.
    The XPATH "/*/@Ind" works in both cases and can be used as a workaround, but it seems less elegant than using the proper XPATH.
    I've tried this test case in 9i and 10g, in sqlplus and TOAD, with the same results in all cases.
    Can anyone provide some insight as to why this behavior occurs?

    Thanks, A_Non,
    adding the third parm to the extractvalue part of the query works.
    ie:
    select extractvalue(value(v),'/Product/@Ind', 'xmlns="http://schemas.myco.nl/services/IPP"' ) ind
    , extractvalue(value(v),'/*/@Ind' ) ind2
    from xml_messages f
    , TABLE(XMLSequence( extract(f.message
         ,'/Bereken/Reglementen/Reglement/Producten/Product'
                                  ,'xmlns="http://schemas.myco.nl/services/IPP"'
                                  ))) v
    where f.id = 1;               
    I had not expected this because I thought the xml fragment returned by the extract didnt include the default namespace.
    However, when looking at the query in more detail, its clear Oracle automatically includes the xmlns part in the returned xml fragment.
    One of the rows in the xml fragment:
    <Product xmlns="http://schemas.myco.nl/services/IPP" Ind="1002" ogr="27098.00" bbr="27098.00" igl="65" elt="130" pgs="63758.00" slt="65" plt="0" reg="0" orf="0"/>

  • XPath query error - xml extension in schema

    Hi,
    I am getting following error when i try to assign values to input xml payload before
    invoke process.
    "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown.
    <selectionFailure>
    <part name="summary" >
    <summary>XPath query string returns multiple nodes. According to BPEL4WS spec 1.1 section 14.3, The assign activity part and query /child::parameter/child::param1 should not return multipe nodes. Please check the BPEL source at line number "40" and verify the part and xpath query /child::parameter/child::param1. </summary>
    </part>
    </selectionFailure>
    The generated XPath resolves to a single node only (tested using XMLSpy). The only reason i can think of is that the xml schema in wsdl is extending a base xml type to a new type.
    It works fine if the extending xml type is merged with it's base type, and used as one single complex type.
    ------------------WSDL START
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://justdoit.ws.sunflower2.pageone.com" targetNamespace="http://justdoit.ws.sunflower2.pageone.com">
         <types>
              <xs:schema targetNamespace="http://justdoit.ws.sunflower2.pageone.com">
                   <xs:complexType abstract="true" name="BaseObject">
                        <xs:sequence>
                             <xs:element name="param1" nillable="true" type="xs:string"/>
                             <xs:element name="param2" nillable="true" type="xs:string"/>
                        </xs:sequence>
                   </xs:complexType>
                   <xs:complexType name="FooBar">
                        <xs:complexContent>
                             <xs:extension base="tns:BaseObject">
                                  <xs:sequence>
                                       <xs:element name="param3" nillable="true" type="xs:string"/>
                                       <xs:element name="param4" nillable="true" type="xs:string"/>
                                       <xs:element name="param5" nillable="true" type="xs:string"/>
                                       <xs:element name="param6" nillable="true" type="xs:string"/>
                                  </xs:sequence>
                             </xs:extension>
                        </xs:complexContent>
                   </xs:complexType>
              </xs:schema>
         </types>
         <message name="justDoItRequest">
              <part name="parameter" type="tns:FooBar"/>
         </message>
         <message name="justDoItResponse">
              <part name="parameter" type="tns:FooBar"/>
         </message>
         <portType name="justDoItPort">
              <operation name="justDoIt">
                   <input message="tns:justDoItRequest"/>
                   <output message="tns:justDoItResponse"/>
              </operation>
         </portType>
         <binding name="justDoItBinding" type="tns:justDoItPort">
              <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
              <operation name="justDoIt">
                   <soap:operation soapAction="tns:justDoIt"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
         </binding>
         <service name="justDoItService">
              <port name="NewPort" binding="tns:justDoItBinding">
                   <soap:address location="http://127.0.0.1:8080/axis/services/justDoIt"/>
              </port>
         </service>
    </definitions>
    ------------------WSDL END
    ------------------BPEL START
              <assign name="assign-1">
                   <copy>
                        <from variable="input" part="payload" query="/tns:justDoItRequest/tns:input1"></from>
                        <to variable="req" part="parameter" query="/parameter/param1"/>
                   </copy>
              </assign>
              <invoke name="invoke-1" partnerLink="justDoIt" portType="tns:justDoItPort" operation="justDoIt" inputVariable="req" outputVariable="res"/>
    ------------------BPEL END
    reg,
    Amitoj.

    I am also having the xml extension issue and since we are dealing with large WSDL files (exceed 40,000 lines) it would be ridiculous to move all extension classes to the base type (parent class). Has this bugged been looked at and when can it be resolved since it seems to be a major issue in JDeveloper.
    Chris

  • Xpath query using ANE with AIR3.9 for iOS app

    we are building an app for iOS using AIR 3.9 where we have to load and parse the xml document so that we can read the images path and download the stuff on iOS device. To fix this issue we have found a solution using XCode via ANE where by using XPath Query classes such as "PerformXPathQuery", "PerformXMLXPathQuery", "xmlReadMemory" etc. The code is running well when build on simulator itself on mac machine. But when we are packaging the ANE with AIR 3.9, it gives us the error which says that:-
    Error occurred while packaging the application:
    Undefined symbols for architecture armv7:
      "_xmlReadMemory", referenced from:
          _PerformXMLXPathQuery in libnet.example.download.a(ExampleLib.o)
    ld: symbol(s) not found for architecture armv7
    Compilation failed while executing : ld64
    I have tried linking binary with libraries like "libxml2.dylib", "libxml2.2.dylib" and libz.dylib + added the libXML header files to the header search path in the build properties, but got no help.
    our AIR 3.9 platform xml looks like:-
    <platform xmlns="http://ns.adobe.com/air/extension/3.9">
        <sdkVersion>4.0.0</sdkVersion>
        <linkerOptions>
            <option>-ios_version_min 4.2</option>
            <option>-framework UIKit</option>
            <option>-framework Foundation</option>
            <option>-framework CoreText</option>
        </linkerOptions>
    </platform>
    can anyone suggest where we are going wrong!
    thanks in advance

    Found the solution, i was missing the framework related to xPath library in platform.xml
    follow the instuctions from the below link:-
    http://forums.adobe.com/thread/1037904
    thanks adobe team

  • Is there a speed  comparison between xpath query

    Is there a paper whit speed comparison between xpath query on XML, stored with all oracle's techniques?
    Thank you and sorry for my english

    Not currently. Since there are no industry standards for XML benchmarks that are accepted by all major vendors Oracle policy prevents us from publishing numbers. However if you have examples of what you are looking for I can give guidance.

  • Copying Variables in BPEL using XPath Query

    Hi,
    I am new to BPEL and i want to know if it is possible to copy data from one variable to another using XPath Query in the <from> <to> tags, when the two variables are of different message types.
    I am trying to create a sample BPEL that would receive a String through the receive tag tied to one partner link (WSDl) and then invoke a different webservice using the <invoke> tag tied to another partner link (WSDL) by passing the received variable.
    I have pasted the BPEL File and the two WSDl files involved.
    My Issue is that when I send a soap request to the BPEL, it is passed as null to the webservice invoked.
    Probably because the copy tags don't work.
    Please help.
    BPEL File
    <!--
    ~ Licensed to the Apache Software Foundation (ASF) under one
    ~ or more contributor license agreements. See the NOTICE file
    ~ distributed with this work for additional information
    ~ regarding copyright ownership. The ASF licenses this file
    ~ to you under the Apache License, Version 2.0 (the
    ~ "License"); you may not use this file except in compliance
    ~ with the License. You may obtain a copy of the License at
    ~
    ~ http://www.apache.org/licenses/LICENSE-2.0
    ~
    ~ Unless required by applicable law or agreed to in writing,
    ~ software distributed under the License is distributed on an
    ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    ~ KIND, either express or implied. See the License for the
    ~ specific language governing permissions and limitations
    ~ under the License.
    -->
    <process name="HelloWorld2"
    targetNamespace="http://ode/bpel/unit-test"
    xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:tns="http://ode/bpel/unit-test"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:test="http://ode/bpel/unit-test.wsdl"
    xmlns:ns0="http://poc.com"
    queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
    expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
    <import location="HelloWorld2.wsdl"
    namespace="http://ode/bpel/unit-test.wsdl"
    importType="http://schemas.xmlsoap.org/wsdl/" />
    <import location="sayHello.wsdl"
    namespace="http://poc.com"
    importType="http://schemas.xmlsoap.org/wsdl/" />
    <partnerLinks>
    <partnerLink name="helloPartnerLink"
    partnerLinkType="test:HelloPartnerLinkType"
    myRole="me" />
    <partnerLink name="sayHelloBPELPL"
    partnerLinkType="ns0:sayHelloPLT"
    partnerRole="you" initializePartnerRole="yes" />
    </partnerLinks>
    <variables>
    <variable name="myVar" messageType="test:HelloMessage"/>
    <variable name="tmpVar" messageType="test:HelloMessage"/>
    <variable name="inVar" messageType="ns0:sayHelloRequest"/>
    <variable name="outVar" messageType="ns0:sayHelloResponse"/>
    </variables>
    <sequence>
    <receive
    name="start"
    partnerLink="helloPartnerLink"
    portType="test:HelloPortType"
    operation="hello"
    variable="myVar"
    createInstance="yes"/>
    <assign name="ass1">
    <copy>
    <from variable = "myVar" part = "TestPart"/>
    <to variable = "inVar"
    part = "parameters"
    query= "/sayHello/ns0:param0" />
    </copy>
    </assign>
    <invoke partnerLink = "sayHelloBPELPL"
    portType = "ns0:sayHelloPortType"
    inputVariable = "inVar"
    operation = "sayHello"
    outputVariable = "outVar">
    </invoke>
    <assign name="ass2">
    <copy>
    <from variable = "outVar"
    part = "parameters"
    query= "/sayHelloResponse/ns0:return" />
    <to variable = "tmpVar" part="TestPart"/>
    </copy>
    </assign>
    <reply name="end"
    partnerLink="helloPartnerLink"
    portType="test:HelloPortType"
    operation="hello"
    variable="tmpVar"/>
    </sequence>
    </process>
    WSDL File1
    <?xml version="1.0" encoding="utf-8" ?>
    <!--
    ~ Licensed to the Apache Software Foundation (ASF) under one
    ~ or more contributor license agreements. See the NOTICE file
    ~ distributed with this work for additional information
    ~ regarding copyright ownership. The ASF licenses this file
    ~ to you under the Apache License, Version 2.0 (the
    ~ "License"); you may not use this file except in compliance
    ~ with the License. You may obtain a copy of the License at
    ~
    ~ http://www.apache.org/licenses/LICENSE-2.0
    ~
    ~ Unless required by applicable law or agreed to in writing,
    ~ software distributed under the License is distributed on an
    ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    ~ KIND, either express or implied. See the License for the
    ~ specific language governing permissions and limitations
    ~ under the License.
    -->
    <wsdl:definitions
    targetNamespace="http://ode/bpel/unit-test.wsdl"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://ode/bpel/unit-test.wsdl"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
    xmlns:ns0="http://poc.com">
    <wsdl:message name="HelloMessage">
    <wsdl:part name="TestPart" type="xsd:string"/>
    </wsdl:message>
    <wsdl:portType name="HelloPortType">
    <wsdl:operation name="hello">
    <wsdl:input message="tns:HelloMessage" name="TestIn"/>
    <wsdl:output message="tns:HelloMessage" name="TestOut"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="hello">
    <soap:operation soapAction="" style="rpc"/>
    <wsdl:input>
    <soap:body
    namespace="http://ode/bpel/unit-test.wsdl"
    use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body
    namespace="http://ode/bpel/unit-test.wsdl"
    use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="HelloService">
    <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
    <soap:address location="http://localhost:8082/ode/processes/helloWorld"/>
    </wsdl:port>
    </wsdl:service>
    <plnk:partnerLinkType name="HelloPartnerLinkType">
    <plnk:role name="me" portType="tns:HelloPortType"/>
    <plnk:role name="you" portType="tns:HelloPortType"/>
    </plnk:partnerLinkType>
    </wsdl:definitions>
    WSDL File 2
    <?xml version="1.0" encoding="UTF-8" ?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:ns0="http://poc.com"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:ns1="http://org.apache.axis2/xsd"
    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
    targetNamespace="http://poc.com">
    <wsdl:types>
    <xs:schema xmlns:ns="http://poc.com" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://poc.com">
    <xs:element name="sayHello">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" name="param0" nillable="true" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="sayHelloResponse">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    </wsdl:types>
    <wsdl:message name="sayHelloRequest">
    <wsdl:part name="parameters" element="ns0:sayHello" />
    </wsdl:message>
    <wsdl:message name="sayHelloResponse">
    <wsdl:part name="parameters" element="ns0:sayHelloResponse" />
    </wsdl:message>
    <wsdl:portType name="sayHelloPortType">
    <wsdl:operation name="sayHello">
    <wsdl:input message="ns0:sayHelloRequest" wsaw:Action="urn:sayHello" />
    <wsdl:output message="ns0:sayHelloResponse" wsaw:Action="urn:sayHelloResponse" />
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="sayHelloSOAP11Binding" type="ns0:sayHelloPortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="sayHello">
    <soap:operation soapAction="urn:sayHello" style="document"/>
    <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="sayHello">
    <wsdl:port name="sayHelloPort" binding="ns0:sayHelloSOAP11Binding">
    <soap:address location="http://localhost:8082/ode/processes/sayHello" />
    </wsdl:port>
    </wsdl:service>
    <plnk:partnerLinkType name="sayHelloPLT">
    <plnk:role name="me" portType="ns0:sayHelloPortType"/>
    <plnk:role name="you" portType="ns0:sayHelloPortType"/>
    </plnk:partnerLinkType>
    </wsdl:definitions>

    Hi,
    Yes, it very much is possible.
    Xpath query provides a lot many data type conversion functions(string to int, string to date etc), which can be used in copying variables.
    thanks
    Saurabh

  • Retrieve xml attribute value of nth xml node using xpath query

    I have an xml with following stucture...
    <xml>
    <header>
     <DocumentReference OrderId="order001">
     <DocumentReference OrderId="order002">
     <DocumentReference OrderId="order003">
    I have to loop through this xml and retrieve the orderId values inside Biztalk orchestration.
    In the expression shape, I get the count of 'DocumentReference' nodes using an xpath query and then
    Added a loopshape to make sure it loops thru all nodes
    Loop condition:   n<=nodeCount     (where n is an integer variable, n=0 to begin with, incremented by 1 thru each loop, nodeCount is # of DocumentReference nodes)
     I try retrieve to the orderId in the following expression shape using the below xpath query
      xpathQuery = System.String.Format("//*[local-name()='OrderReference'][{0}]/@orderID)",n);
      sOrderId = xpath(MsgSingleInvoice,xpathQuery);
    And I get the following exception:
    Inner exception: '//*[local-name()='OrderReference'][1]/@orderID)' has an invalid token.
    Exception type: XPathException
    Appreciate any help!   thanks!

    Thanks for the quick response. I got rid of it.
    And I see a different error:
    Inner exception: Specified cast is not valid. Exception type: InvalidCastException
    Source: Microsoft.XLANGs.Engine  
    Target Site: System.Object XPathLoad(Microsoft.XLANGs.Core.Part, System.String, System.Type)
    Since variable 'n' is of integer type, I suspected it and changed it to n.ToString() and tested again and still see the same error.

  • Variable Picker generates invalid XPath query

    This one seems to be a bug:
    When declaring a variable of type "element" (not "messageType") and accessing the variable with the Variable Picker from within the assign assistant, i.e. the following line ist generated:
    bpws:getVariableData("testVar","","/tns:TaskMgrTestCaseRequest/tns:input")
    The BPEL process can be validated and deployed without an error.
    At runtime the following exception is generated:
    XPath expression failed to execute.
    Error while processing xpath expression, the expression is "bpws:getVariableData("testVar", "", "/tns:TaskMgrTestCaseRequest/tns:input")", the reason is XPath expression failed to execute.
    Error while processing xpath expression, the expression is "", the reason is Unexpected ''.
    Please verify the xpath query.
    Please verify the xpath query.
    When working with variables of type messageType, there is no problem. (So I declared a messageType to each element type ...)
    Wolfgang

    Thanks for the heads up. We will try to kill this bug in the 0.97 release. -Edwin

  • Xpath query on initiateTaskResponse variable fails

    I have a small BPEL process which has a human task , in that when I try to access taskid from initiateTaskResponse message, it throws xpath query is invalid error.
    Thanks

    Thanks for your Reply,
    I can able to browse the variable in JDeveloper at design time. When I try to deploy the process, the server throws error on that assign activity(Selection Failure). So I have changed the assign activity to JavaEmbeeding, but now it throws 'Selection Failure' error at runtime.
    I can able to use anyother variables in assign activity.
    Thanks in advance,
    Murugavel Mahadevan

  • XPath query on a CLOB?

    Does anyone know if there is an easy way to run an XPath query against a CLOB column? I know it's simple if the column is XMLType, but what if it's a CLOB?

    Does CLOB store XML? If so, simply use XMLTYPE(clob_column).
    SY.

  • Correct wat to determine if the XPath Query resulted in a match

    What is the correct way to determine of the XPath Query
    (using e4x syntax) returned matching nodes?
    The result is never a null reference even if there are no
    matches found, and I can't seem to find a way to determine if the
    XMLList returned has any nodes except for a convoluted way like so:
    var matchingRecords:XMLList =
    xmlData.dataTable[0].dataRow.(@someAttribute == someVariable);
    var record:XML = matchingRecords[0]; //This is the part I
    don't like to have to do.
    if (record == null)
    //This means no matches were found.
    else
    //This means atleast one match was found.

    "...they feel they've done it all too perfectly ..."
    I've been working with Flex since it was beta, and I must
    disagree with this. In my experience, the Adobe/MM folks are paying
    very close attention to what we say.
    You need to understand that you do not modify/release
    commercial software casually. It will take months to years. Be
    patient, or find a workaround, they exist.
    Be sure to log your wishes/bugs on the wishform. I know for a
    fact that they monitor that. I have been contacted for
    clarifications on my posts there.
    http://www.macromedia.com/support/email/wishform/
    Tracy

  • Xpath query return problem

    Hi;
    I want to load xml file into the database oracle 9.0.2 using Oracle XML DB Utilities Package on "http://otn.oracle.com/sample_code/tech/xml/xmldb/xdbutilities/XMLDB_Utilities_Overview.htm"
    I have a schema like:
    <xs:element name="catalog">
    <xs:element name="catalog">
    <xs:complexType xdb:SQLType="OBJ_CATALOG">
    <xs:sequence>
    <xs:element name="category">
    <xs:complexType xdb:SQLType="OBJ_CATEGORY">
    <xs:sequence>
    <xs:element name="product">
    <xs:complexType xdb:SQLType="OBJ_PRODUCT">
    <xs:sequence>
    <xs:element name="name" type="xs:string"/>           
    and my file include:
    [i]<catalog>
    <category name="books">
    <product id="1" keywords="yasanti, Latin Amerika" >
    <name>Gunes Topraklari</name>
    </product>
    </category>
    <category name="CDs" >
    <product id="5" keywords="music, easy listening" >
    </product>
    </category>
    I can use xpath query like
    select extract(value(x), '/catalog/category[@name="books"]').getstringval() from product_table x
    and get result but I can not take any data about product elements with queries such that
    select extract(value(x), '/catalog/category[@name="books"]//name/text()').getstringval() from product_table x
    Does anyone has an idea about this problem?
    Thanks a lot.
    Alper.

    Please post this message at:
    Forums Home » Oracle Technology Network (OTN) » Products » Database » XML DB

  • XPath Query Solved

    JDev Team,
    Is there a way to execute XPath Query on an XML document? In version 10.1.3 there was a extension through to achieve this. Do we have anything similar in TP4? If not, can we expect something for the production release? Please let me know.
    Thanks
    Bala.

    Please ignore my previous post. I found the option under the search menu.
    Thanks

Maybe you are looking for