XPath Syntax Query

Hello,
I am trying to write an XPath syntax query to retrieve some specific child nodes in a loop (in PLSQL) from the following document excerpt..
<?xml version="1.0" encoding="utf-8" ?>
<Request RequestNumber="">
<TargetServers>
<TargetServer>
<HARDWARE>
<HOSTNAME>HNSS1</HOSTNAME>
</HARDWARE>
<PRODUCTS>
<PRODUCT PRD_ID="123" QUANTITY="10">
<PERIOD></PERIOD>
<PROD_ATTRIBUTES>
<SUPP>ven1</SUPP>
<EDITION>ENTERPRISE</EDITION>
<VERSION>1.0</VERSION>
</PROD_ATTRIBUTES>
</PRODUCT>
<PRODUCT PRD_ID="234" QUANTITY="3">
<PERIOD></PERIOD>
<EXEMPTIONS>
<EXEMPTION_CODE>xxx1</EXEMPTION_CODE>
</EXEMPTIONS>
<EXCEPTIONS />
<PROD_ATTRIBUTES />
</PRODUCT>
<PRODUCT PRD_ID="345" QUANTITY="5">
<PERIOD></PERIOD>
<EXCEPTIONS />
<PROD_ATTRIBUTES />
</PRODUCT>
</PRODUCTS>
</TargetServer>
<TargetServer>
<HARDWARE>
<HOSTNAME>HNSS2</HOSTNAME>
</HARDWARE>
<PRODUCTS>
<PRODUCT PRD_ID="123" QUANTITY="10">
<PERIOD></PERIOD>
<PROD_ATTRIBUTES>
<SUPP>ven1</SUPP>
<EDITION>ENTERPRISE</EDITION>
<VERSION>1.0</VERSION>
</PROD_ATTRIBUTES>
</PRODUCT>
</PRODUCTS>
</TargetServer>
</TargetServers>
</Request>
What I am trying to do is retrieve only those products associated with a given hostname but the xpath query I have come up with returns ALL the products for the entire document.
I am using the following code
xpath.selectnodes(doc,'/Request/TargetServers/TargetServer/PRODUCTS/PRODUCT');
Which I think is correctly returning (in the example above) all three product nodes.
My question is how do I make the xpath query ONLY select the nodes for a given specific hostname ?
I tried adding an HN attribute to the TARGETSERVER node and then using the following syntax
xpath.selectnodes(doc,'/Request/TargetServers/TargetServer[@HN="HN1"]/PRODUCTS/PRODUCT');
but that didn't work..
Any other suggestions gratefully received.
Thanks

Hi,
Based on the sample document you provided, this should work :
/Request/TargetServers/TargetServer[HARDWARE/HOSTNAME="HNSS1"]/PRODUCTS/PRODUCT
I am using the following code
xpath.selectnodes(doc,'/Request/TargetServers/TargetServer/PRODUCTS/PRODUCT');You said you're using PL/SQL, but isn't that a Java method?

Similar Messages

  • XPATH Database Query Syntax in an Assign

    Trying to get an XPATH Database query to work by assigning the Input variable value in a simple BPEL Process to my query condition. I keep getting invalid XPATH errors. I cannot seem to figure out how get write it out.
    Here is what I have:
    <from expression="orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')"/>
    Here is my error:
    Error(30): [Error ORABPEL-10039]: invalid xpath expression [Description]: in line 30 of "C:\OraBPELPM_1\integration\jdev\jdev\mywork\BPELws\ReadDB\ReadDB.bpel", xpath expression "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')" specified in <from> is not valid, because XPath query syntax error. Syntax error while parsing xpath expression "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')", at position "80" the exception is Expected: ). Please verify the xpath query "orcl:query-database( 'select ename from emp where ename = bpws:getVariableData('inputVariable','payload','/client:ReadDBProcessRequest/client:input')' ,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')" which is defined in BPEL process. . [Potential fix]: Please make sure the expression is valid.
    Any help?
    Thanks!!!

    Ok. I have figured out how to place the condition (variable value) inside a concatentated string. So my final result is the actual XPATH Query-Database statement. But the problem is it is being returned as a String. How can I turn that final string into the XPATH expression I need? I suspect another <COPY> block could pull this off but I am not sure how to do it.
    Here is my code:
    <process name="QueryBuild" targetNamespace="http://xmlns.oracle.com/QueryBuild" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:client="http://xmlns.oracle.com/QueryBuild" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <partnerLinks>
    <partnerLink name="client" partnerLinkType="client:QueryBuild" myRole="QueryBuildProvider"/>
    </partnerLinks>
    <variables>
    <variable name="inputVariable" messageType="client:QueryBuildRequestMessage"/>
    <variable name="outputVariable" messageType="client:QueryBuildResponseMessage"/>
    <variable name="QueryText" type="ns1:string"/>
    </variables>
    <sequence name="main">
    <receive name="receiveInput" partnerLink="client" portType="client:QueryBuild" operation="process" variable="inputVariable" createInstance="yes"/><!-- Generate reply to synchronous request -->
    <assign name="Assign_1">
    <copy>
    <from expression="concat(&quot;orcl:query-database('select ename from emp where empno = &quot;, bpws:getVariableData('inputVariable','payload','/client:QueryBuildProcessRequest/client:input'), &quot;,false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL)'&quot;)"/>
    <to variable="QueryText"/>
    </copy>
    <copy>
    <from variable="QueryText"/>
    <to variable="outputVariable" part="payload" query="/client:QueryBuildProcessResponse/client:result"/>
    </copy>
    </assign>
    <reply name="replyOutput" partnerLink="client" portType="client:QueryBuild" operation="process" variable="outputVariable"/>
    </sequence>
    </process>

  • Documaker 12.1 XPath Syntax Issue

    We are moving to Documaker Studio 12.1 from Docucreate 11.0. So, I am importing few forms into 12.1 and doing test runs. I ran into a XPath syntax issue. We use XPath manual triggers to trigger forms and sections.
    In 11.0, the following trigger (use as Search Mask (True/False) in Manual Triggers) works perfectly fine. But it doesn't work in 12.1
    *!/Acord/Bills/Form/[FormNumber='U61']FormNumber*
    In 12.1, I have to remove the "/" present before "[" to make it work - as shown below.
    *!/Acord/Bills/Form[FormNumber='U61']FormNumber*
    Is there a way we can make the old syntax work with 12.1 as well? It would save us from changing thousands of Form and Section Triggers?
    Thank you,
    SGov.

    I suspect the short answer is No. The initial xPath syntax appears invalid as you would not define a slash between the node and the attribute that belongs to the node. The fact that it somehow succeeded was an anomaly that must have been corrected.

  • XPATH Syntax

    Simple question. Can someone please provide the proper syntax for placing an Input Variable into the query-database XPATH statement? I cannot even get this statement to compile (or any variants of it):
    orcl:query-database('select ename from emp where empno = bpws:getVariableData('inputVariable','payload')',false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')
    Here is the detailed error:
    Error(30): [Error ORABPEL-10039]: invalid xpath expression [Description]: in line 30 of "C:\OraBPELPM_1\integration\jdev\jdev\mywork\BPELws\JDBC\JDBC.bpel", xpath expression "orcl:query-database('select ename from emp where empno = bpws:getVariableData('inputVariable')',false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')" specified in <from> is not valid, because XPath query syntax error. Syntax error while parsing xpath expression "orcl:query-database('select ename from emp where empno = bpws:getVariableData('inputVariable')',false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')", at position "79" the exception is Expected: ). Please verify the xpath query "orcl:query-database('select ename from emp where empno = bpws:getVariableData('inputVariable')',false(),false(),'jdbc:oracle:thin:scott/tiger@localhost:1521:ORCL')" which is defined in BPEL process. . [Potential fix]: Please make sure the expression is valid.
    I have been trying to XSQL to work and it suffers from XPATH issues at runtime.
    Clemens, any suggestions here? I was thinking perhaps of using ora:parseEscapedXML to forceably create the proper expression after concatenating the orcl:query-database together with the EMPNO after it is assigned to a holding String variable. Not sure it would work though. It does not look like you can perform 2 successive COPY TO / FROM in one set of tags.
    Thanks!

    Does anybody have any suggestions for this issue? Has anyone gotten this aspect of XPATH to work correctly? HELP!

  • Xpath syntax for "a number"

    In regex, it's [0-9]+ or \d+.  I'm trying to use xpath to match a number that's any value of 18 digits long.  What's the syntax?

    DuckDuckGo: http://www.regular-expressions.info/xpath.html

  • Xpath combo-query

    Need help querying the xml listed (abbreviated) at the
    bottom.
    the following returns just he first image and what I need is
    all the images but I also need all the infomation on the level
    above such as stock number, year ans length.
    var ds2Image = new Spry.Data.XMLDataSet("myCompany.xml",
    "Inventory/Dealer/Location/Units/Unit[Type ='Park Model']/Images");
    I tried var
    ds1Image = new Spry.Data.XMLDataSet("myCompany.xml",
    "Inventory/Dealer/Location/Units/Unit[Type ='Toy Hauler']|
    Inventory/Dealer/Location/Units/Unit[Type ='Toy Hauler']/Images");
    but DW does not recognize this xpath.
    xml
    <?xml version="1.0" encoding="utf-8"?>
    <Inventory>
    <Dealer>
    <ID>422</ID>
    <Name><![CDATA[mycompany]]></Name>
    <Location>
    <ID>458</ID>
    <Address>11572 Creek Road</Address>
    <City>AnyCIty</City>
    <State>WA</State>
    <ZipCode>98383</ZipCode>
    <Phone>360-692-1098</Phone>
    <Units>
    <Unit>
    <ID>482252</ID>
    <Type><![CDATA[Park Model]]></Type>
    <Condition><![CDATA[New]]></Condition>
    <Stock_Number><![CDATA[1865]]></Stock_Number>
    <Year><![CDATA[2008]]></Year>
    <Manufacturer><![CDATA[Kropf]]></Manufacturer>
    <Model><![CDATA[SESRLP]]></Model>
    <Length>36</Length>
    <MSRP>0</MSRP>
    <Price>61545</Price>
    <Sale_Price>0</Sale_Price>
    <Description><![CDATA[Brand new Kropf rear loft
    model, rear master bedroom with ample closet space. Large bathroom
    with walk-in laundry room. Front living room, nice entertainment
    center. All residential appliances, 8" I-beam chassis with full
    outriggers, 2x4 sidewall framing 16" on-center. 50 year vinyl
    siding, fiberglass insulation R-22 in the roof, R-11 in the
    sidewalls and floor.]]></Description>
    <Chassis><![CDATA[]]></Chassis>
    <Engine_Manufacturer><![CDATA[]]></Engine_Manufacturer>
    <Engine_Model><![CDATA[]]></Engine_Model>
    <Fuel_Type><![CDATA[]]></Fuel_Type>
    <Interior_Color><![CDATA[Rustic]]></Interior_Color>
    <Exterior_Color><![CDATA[Tan]]></Exterior_Color>
    <Sleep_Capacity />
    <Water_Capacity />
    <Num_Air_Conditioners>1</Num_Air_Conditioners>
    <Mileage />
    <Trailer_Weight />
    <Num_Slideouts>0</Num_Slideouts>
    <VIN><![CDATA[]]></VIN>
    <Is_Special><![CDATA[False]]></Is_Special>
    <Is_Sold><![CDATA[False]]></Is_Sold>
    <Is_Consignment><![CDATA[False]]></Is_Consignment>
    <Is_New_Arrival><![CDATA[False]]></Is_New_Arrival>
    <Is_On_Deposit><![CDATA[False]]></Is_On_Deposit>
    <Is_On_order><![CDATA[False]]></Is_On_order>
    <Images>
    <Image order="1"><![CDATA[
    http://mydomain.com/images/482252_1.jpg
    <Image order="2"><![CDATA[
    http://mydomain.com/images/482252_2.jpg
    <Image order="3"><![CDATA[
    http://mydomain.com/images/482252_3.jpg
    <Image order="4"><![CDATA[
    http://mydomain.com/images/482252_4.jpg
    <Image order="5"><![CDATA[
    http://mydomain.com/images/482252_5.jpg
    <Image order="6"><![CDATA[
    http://mydomain.com/images/482252_6.jpg
    <Image order="7"><![CDATA[
    http://mydomain.com/images/482252_7.jpg
    <Image order="8"><![CDATA[
    http://.com/images/482252_8.jpg
    <Image order="9"><![CDATA[
    http://mydomain.com/images/482252_9.jpg
    <Image order="10"><![CDATA[
    http://mydomain.com/images/482252_10.jpg
    <Image order="11"><![CDATA[
    http://mydomain.com/images/482252_11.jpg
    </Images>
    <Options>
    <Air_Conditioning />
    <CD_Player />
    <LP_Detector />
    <Microwave />
    <NonSmoking_Unit />
    <Refrigerator />
    <Smoke_Detector />
    <Stereo_System />
    <Stove />
    <Thermal_Pane_Windows />
    <TV />
    <Washer_Dryer_Prep />
    <Water_Heater />
    </Options>
    </Unit>
    Text
    Text

    Hi nick,
    At first, like Don, from the info you gave in your initial
    post, I immediately thought about controlling the flattening of the
    XML, but it looks like you are trying to flatten 2 additional
    levels (Images and Options), which will result in one row for every
    pairing of images and options, which I don't think you really want.
    Perhaps, you should look into using nested data sets, and
    have a dsUnit (the master), dsImages (nested) and dsOptions
    (nested). There are examples of nested data sets at that same URL
    Don gave you above.
    The method you choose, whether flattening or nested data
    sets, depends on the layout of the data you are after.
    --== Kin ==--

  • How to use Xpath to query elements loaded from different xml docs?

    I have a big DBLP XML doc (95mb), to load into the container, i splitted the doc into many small xml docs by the publication types, such as articles, books, inproceedings, etc.
    I tried to use xpath query such as
    query 'collection()/dblp[article/author]/book[title]'
    I got empty answers.
    but if i use XQuery such as
    query 'let $r:=collection()/dblp,$a :=$r/inproceedings/author
    for $l2 in $r/book
    where $a and $l2/title
    return <result> {$l2}{$a}</result>'
    i got answers. However, if i remove {$a} from the return clause, i still got empty answers.
    is there any problem with my Xpath query and flwor Xquery?
    regards,
    xiaoying

    Hi John,
    Following is the procedure i have used to load the xml docs (after the indexes have been created):
    private static void loadXmlFiles(File path2DbEnv,String theContainer, File file) throws Throwable {
         //Open a container in the db environment
              XmlManager theMgr = null;
              XmlContainer openedContainer = null;
              myDbEnv env;
              try {
              env = new myDbEnv(path2DbEnv);
         theMgr = new XmlManager(env.getEnvironment(), new XmlManagerConfig());
         //use node container
         theMgr.setDefaultContainerType(XmlContainer.NodeContainer);
                   try{
                   openedContainer = theMgr.createContainer(theContainer);
                   }catch (XmlException e){
                        //if the container alreay exist, then open it;     
                        openedContainer = theMgr.openContainer(theContainer);
              //Get an update context.
              XmlUpdateContext updateContext = theMgr.createUpdateContext();
                   String theFile = file.toString();
                   String docName=file.getName();
              //Get the input stream.
              XmlInputStream theStream = theMgr.createLocalFileInputStream(theFile);
              System.out.println("Adding " + theFile + " to container " +
                             theContainer);
         //     Do the actual put
              openedContainer.putDocument(docName, // The document's name
              theStream, // The actual document.
              updateContext, // The update context
         //     (required).
              null); // XmlDocumentConfig object
              System.out.println("done.");
              //XmlException extends DatabaseException, which in turn extends Exception.
              // Catching Exception catches them all.
              } catch (XmlException e){
                   System.err.println("Error loading files into container " + theContainer);
                   System.err.println(" Message: " + e.getMessage());
                   //In the event of an error, we abort the operation
                   // The database is left in the same state as it was in before
                   // we started this operation.
                   throw e;
              finally {
              cleanup(theMgr, openedContainer);
    Unfortunately, i waited for around 20 hours 148mb doc was not loaded; so i gave up.
    Could you please give me some suggestions on how to load the large doc efficiently ? thanks.
    regards,
    xiaoying

  • XPath expression query.

    Hi all
    I have this XPATH in my Receiver Determination
    (/p1:CREMAS03/IDOC/E1LFA1M/LIFNR = "1000")
    Prefix: p1
    Namespace: urn:sap-com:document:sap:idoc:messages
    This is the payload of the XML message.
    <CREMAS03>
         <IDOC>
             <E1LFA1M>
                  <LIFNR>1000</LIFNR>
             </E1LFA1M>
           </IDOC>
    </CREMAS03>
    Is there anything wrong with the XPath expression? I am getting Receiver cannot be be found.

    Hi,
    Yes , this is correct expression only
    Check these
    http://help.sap.com/saphelp_nw04/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/frameset.htm
    /people/prasadbabu.nemalikanti3/blog/2006/09/20/receiver-determination-based-on-the-payload-of-input-dataextended-xpathcontext-object
    context objects
    Receiver Det- Xpath:
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
    XPATH in Interfce Det:
    /people/suraj.sr/blog/2006/01/05/multiple-inbound-interfaces-within-a-service
    Regards
    Seshagiri

  • Syntax query

    hi all,
    is the following syntax valid.
    select * from dbtab for all entries of it_tab.
    im running a batch program. i just want to check if my entries in my internal table are present in my dbtab.
    so that i dont insert my dbtab for those corresponding entries
    i strictly want to avoid looping on the it_tab.
    please correct me if wrong also give alternative if any

    hi,
    If i have understood your question correctly do this way  ..
    if not it_tab[] is initial.
    select * from dbtab into table it_data for all entries in it_tab
                  where field1 = it_tab-field1 and
                           field2 = it_tab-field2.
    endif.
    Regards,
    Santosh

  • Bpel xpath query

    Hi,
    My wsdl contains:
    <wsdl:message name="BPELProcess1RequestMessage">
              <wsdl:part name="payload" type="xsd:string"/>
    </wsdl:message>
    <wsdl:message name="BPELProcess1ResponseMessage">
              <wsdl:part name="payload" type="xsd:string"/>
    </wsdl:message>
    In my soap request I am sending xml as part of soap body as string:
    <soap:Body>
    <Test>
    <TestRequest>111</TestRequest>
    <TestType tc="99">
    </Test>
    </soap:Body>
    So in my bpel I want to access tc value i.e 99. Could you please share some sample code to access this attribute value. appreciate your quick inputs.
    thanks

    first i would recommend changing the wsdl to have right complex type for the part instead of using xsd:string. once that is done, then you can use /Test/TestType/@tc to get the value of tc attribute. by using the complex type you can validate the incoming documents and eliminate other xpath syntax errors.

  • Converting XPATH to SQL syntax?

    HI, all
    I am looking for a third party tool to convert XPATH syntax to SQL syntax?
    XPATH is primary syntax to retrieve and locate data in XML structre, while SQL is the stand syntax to operate data in RDBMS. Please assume I have a way to map XML data to RDBMS.
    Thanks in advance!
    Tao
    2002/11/15

    Did you ever find a solution?????... that�s exactly what I�m trying to do. Any help would be appreciated. Theres like no information on this stuff. Thanks
    bpfl

  • DBUri query issues

    Hi all,
    I am using URI XPath queries on 9i. I do not have permission on the
    database or database server to create any Stored Procedures, Servlets
    or anything else that I could possibly use to help me. I have firewall
    access on ports 80 and 8080 ONLY. I am connecting on a 100Mbit LAN
    with very little extra traffic. The Oracle server is on a Sun box
    which is a dev replica of a high-performance production server.
    I have a couple issues to resolve:
    1. The response speed is currently extremely slow. I am connecting and
    retrieving data via a C# .NET component using:
    HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strURIQuery);
    req.Method = "GET";
    req.Credentials = new NetworkCredential(strUser, strPass); // Oracle
    log-in
    // Get the stream from the response
    StreamReader stream = new
    StreamReader(req.GetResponse().GetResponseStream());
    However, the timings are the same when I simply paste the query into a
    browser and get a response, even without applying a stylesheet
    transformation.
    I have been fishing the internet/NGs for some optimization hints but
    it seems like almost no-one is using this Oracle feature. Does
    anyone on this NG have experience with speeding up URI queries?
    Any query, regardless of complexity, seems to take between 1.5 and 3
    seconds to return with XML. I am doing simple select statements on a
    single table with multiple "or" statements, but the classic test:
    http://myservername:8080/oradb/SCOTT/EMP/ROW[EMPNO=7369]/ENAME
    ... is just as slow!
    2. There is a limit to the number of characters I can use in a query
    (it appears to be 420 chars inside the [] predicate). Slightly over
    this limit and I get:
    <ERROR>
    ORA-00600: internal error code, arguments: [17114], [0x2703F690], [],
    </ERROR>
    Way over this limit and Oracle can't even return an error message! I
    get a 500 back from Apache.
    Does anyone know if this size limit is configurable? Alternatively, is
    there a way of using a more concise XPath syntax to perform a query
    with multiple "or" statements?. The queries I am doing are similar to
    the one below, only with even more "or" statements:
    http://myservername:8080/oradb/SCOTT/RLR/ROW[NGC='SW37331083' or
    NGC='SW37332471' or NGC='SW37332591' or NGC='SW37332965' or
    NGC='SW37333078' or NGC='SW37333395' or NGC='SW37335398' or
    NGC='SW37340233' or NGC='SW37340351' or NGC='SW37340811' or
    NGC='SW37341521' or NGC='SW37341909' or NGC='SW37342828' or
    NGC='SW37343418' or NGC='SW37343605' or NGC='SW37343728' or
    NGC='SW37344528' or NGC='SW37344707']?rowsettag=Data
    TIA,
    Oafyuf

    Apologies if this is the wrong forum for the question above. Could anyone suggest a more suitable one?
    Thanks,
    Oafyuf

  • XPath Expression Problem

    Hi again,
    still a newb and stillsomequestions, but hope dies at last :)
    I want to extract values from a xml file which is stored in a table.
    i have the following code:
    COLUMN div DEFAULT
    SELECT extract(value(x), '//DIV/@ ID = ''FXAC93006ENC.0001.01.00''/text()').getStringVal() AS div
    FROM versuch2 x;
    With this code ive got the following Error Message: ORA:31012: Not supported XPath Statement.
    I tried this XPath statement in SlyXML and got a boolean:true result, so i think its not a xpath problem.
    Isthere a syntax problem?
    Thx for help!

    The correct syntax for fetching attributes is different from what you did.
    Not sure which syntax is the standard, but the Oracle Version seems more intuitive (too me). Why? Because an attribute is on the same hierachy level of the xml tag and therefore should not be queried with an additional /.
    SQL> with versuch2 as (select xmltype('<doc><div id="FXAC93006ENC.0001.01.00">Test</div></doc>') xmlcol from dual)
      2  SELECT extract(xmlcol, '//div[@id="FXAC93006ENC.0001.01.00"]/ text()').getStringVal() AS div
      3  FROM versuch2 x;
    DIV
    Test
    SQL>
    SQL> btw: W3C XPath Syntax stuff: http://www.w3.org/TR/xpath#predicates
    Message was edited by:
    Sven W.

  • [XML/XPATH] jaxen : problem with "parent" function

    Hello
    I have a problem with jaxen, when I try to use the XPath function parent :
    When I try this :
    import ...
    DocumentNavigator dn=new DocumentNavigator();
    try {
    objet=dn.getDocument("TESTXPath.xml");
    apath=dn.parseXPath("/Entry/Resultats/step/Population/individu/*");
    result=apath.evaluate(objet);
    System.out.println(result);
    apath=dn.parseXPath("/Entry/Resultats/step/Population/parent::*");
    result=apath.evaluate(objet); // ---> exception
    System.out.println(result);
    catch(Exception e) {
    e.printStackTrace();
    The first result is well displayed, but just before the second, I catch this exception:
    Exception in thread "main" java.lang.NoSuchMethodError: org.jdom.Element.getParent()Lorg/jdom/Element; at org.jaxen.jdom.DocumentNavigator.getParentAxisIterator(DocumentNavigator.java: 252)
    at org.jaxen.expr.iter.IterableParentAxis.iterator(IterableParentAxis.java:82)
    at org.jaxen.expr.DefaultStep.axisIterator(DefaultStep.java:139)
    at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:188)
    at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPat h.java:126)
    at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:107)
    at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:716)
    at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:239)
    at org.jaxen.BaseXPath.evaluate(BaseXPath.java:196)
    at MainTestClass.main(MainTestClass.java:85)
    However, the first query works good and I received list so I'm quite sure that it's not a problem of unfindable elements.
    Finaly I can't be syccessful to use XPath parent function:
    Either I catch an exception, or it returns nothing or empty list
    Isn't the XPath syntax correct in my second expression ?
    Can we do :
    /.../.../parent::* ? ou //individu/parent::* ?

    Thanks
    I think so, but.
    In fact I don't think I'm using different version of JDOM.
    I use eclipse with jdk1.4.2.
    I have downloaded JDOM-b10 and the only things I have done is to extract zip archive and to add all .jar files of the jdom directory in my library path.
    Do this is the only version of JDOM I'm using.
    All works perfectly excepted only the XPath parent method. It's strange that the other methods work fine.
    I don't knnow how to solve this problem ! so if you can help me I be very thankfull.

  • Invalid XPath ?

    I have a process that gets a date (format YYYY-MM-DD; forced by Console), which has to be delivered to a Webservice, that requests dates in format 'dd MMM yyyy' (24 aug 2005).
    I've tried the following options (in an Assign):
    <copy>
      <from variable="inputVariable" part="payload" query="ora:formatDate('/client:bpAanvraagProcessRequest/client:DatumBemonstering', 'dd MMM yyyy')"/>
      <to variable="addAanvraag_addaanvraag_InputVariable" part="pDbg"/>
    </copy>And:
    <copy>
      <from variable="inputVariable" part="payload" query="xp20:format-dateTime(/client:bpAanvraagProcessRequest/client:DatumBemonstering,'[dd] [MMM] [YYYY]')"/>
       <to variable="addAanvraag_addaanvraag_InputVariable" part="pDbg"/>
    </copy>Both fail with the following message:
    [Error ORABPEL-10076]: invalid xpath query string 
    [Description]: in line 68 of "L:\workspaces\BPEL\bpAanvraag\bpAanvraag.bpel", According to BPEL4WS spec 1.1, section 14.3,
    the xpath query "ora:formatDate('/client:bpAanvraagProcessRequest/client:DatumBemonstering', 'dd MMM yyyy')" is invalid,
    query should be an absolute location path and it must start from the root element prefixed with "/".. 
    [Potential fix]: Please make sure that your xpath query starts with "/" which is the root..Anyone has any ideas how to fix this?

    Okey, found it:
    The format-string is an XSLT 2.0 picture string, see syntax explained at http://www.w3.org/TR/xslt20/#date-picture-string
    By the way:
    a) w3.org publishes the function xslt:format-date(), and format it by picture. This is not offered by Oracle BPEL it seems (at least not through the Expression builder, ver 10.1.2.0.0 ).
    Oracle-BPEL offers:
    b) ora:formatDate(), and format it by java.text.SimpleDateFormat.
    c) xp20:format-dateTime(), and format it by picture.
    So I took it away by code like:
    <copy>
    <from expression="xp20:current-dateTime()"/>
    <to variable="myDateTime"/>
    </copy>
    <copy>
    <from expression="'P21D'"/>
    <my-xml-comment>The Xpath syntax (like P21D) is for specifying an xdt:dayTimeDuration of 21 days ahead, see http://www.w3.org/TR/xpath-functions/#lexical-dayTimeDuration</my-xml-comment>
    <to variable="myDuration"/>
    </copy>
    <copy>
    <from expression="xp20:add-dayTimeDuration-to-dateTime( bpws:getVariableData('myDateTime'), bpws:getVariableData('myDuration') )"/>
    <to variable="myResultTime"/>
    </copy>
    <copy>
    <from expression="xp20:format-dateTime( bpws:getVariableData('myResultTime'), '[Y0001][M01][D01]' )"/>
    <to variable="myResultTimeNOARK"/>
    </copy>

Maybe you are looking for

  • Can i Bind more than one Model object to the Custom controller or not

    Hi All, I trying to bind more than one model object to the custom controller, Both the model objects contains same attribute name called ( output). Both model objects created on to top of the BAPI. So when i bind first model object to the custom cont

  • Arch as a Media Center PC

    I'm just now getting my beast of a desktop back up and running from a failed video card (overheated and fried, fan was bad). It's a rather outdated Athlon XP 3200+, it's decked out nicely with 2 gigs ram and approximately 2.5TB of hard drive space (I

  • Quick Time for Windows 98 please

    Been online for hours trying to download something that will play this stupid little animation .mov file that is from a stopmo animator. I really am working hard for what might be only half a minute. Do you still have an older version of your Quick T

  • Read Write to a database in a network

    I have a program that reads and writes data to a database it works OK as long the data base is located in the local PC where the program is executing. I wrote the program so I can set up by changing the ini file. In the ini file I indicate the path t

  • ServerSide Event-Handler for Flag-Event possible?

    Hi! Is it possible to hook up some managed code into Exchange 2013 which is triggered when an E-Mail is flagged via Outlook or OWA? I've been fiddling around with transport-agents, but they seem to get triggered only on Mail-Transport events, which i