XPath predicate on wildcard

I am trying to get a (for me!) complex XPath expression working, and having trouble. If I use this it finds all nodes in the Arch Package Set, including Removals.
$SetExpression = "/Definitions/PackageSets/PackageSet[@id='Arch']/*"
But if I do this it returns nothing, rather than returning the two Rollout nodes that are there.
$SetExpression = "/Definitions/PackageSets/PackageSet[@id='Arch']/*[Name!='Removal']"
So, is it not possible to apply a predicate to a wildcard?

And the answer is...
$SetExpression = "/Definitions/PackageSets/PackageSet[@id='Arch']/*[local-name()!='Removal']"
Good grief! ;)

Similar Messages

  • Translate() function in an xpath predicate

    I'm trying to use the translate() function in an xpath predicate, and it appears to be having no effect. For instance, I have the following XML document (abbreviated for clarity):
    <metadata>
    <baseObject>
    <PublicationTime>2003-06-30T21:45:56Z</PublicationTime>
    </baseObject>
    </metadata>
    The following xpath expression returns no nodes:
    metadata[translate(baseObject/PublicationTime, "-:TZ", "") = "20030630214556"]
    But this next expression does return a node:
    metadata[translate(baseObject/PublicationTime, "-:TZ", "") = "2003-06-30T21:45:56Z"]
    It appears to me that the translate function is not removing the -, :, T, and Z characters as would be expected. Am I misunderstanding the usage of the translate function, making an error in my xpath expression, or is there some other explanation?
    Thanks.
    Brian

    Brian
    This looks like a bug in the implementation of translate
    Filed as bug 3036042

  • Xpath predicates

    Hi.
    I get wrong results when running the following query that includes predicates:
    <bpelx:append>
    <bpelx:from expression="ora:getNodes('Campi','/client:CambioResidenza/client:Individui/client:Individuo[IntestatarioVeicoli=true() or IntestatarioPatente=true()]')"/>
    <bpelx:to variable="IndividuiProprietariPatentati"
    query="/client:Individui"/>
    </bpelx:append>
    getNodes returns an empy set.
    Whats wrong with the predicate syntax?
    Thanks for yout help,
    Mick
    Edited by: Mick on 28-dic-2010 15.03

    never faced this issue rather I never used condition in []. Seems like a logical corruption in the evaluation of the condition. Have you tried removing one condition and by keeping only one condition at a time ? Which version of BPEL/platform you are using ??? can you provide the source structure xsd for which you are using getNodes().

  • XPATH Predicate for container variable of simple type in BPM

    Hi Experts,
    I have read various threads and blogs with this topic and as I couldn't get a clear view, hence I am raising it here. In my BPM, I am collecting idocs by means of a finite loop. I have used a receive step, container step(to append the idocs) and another container(to increment the counter_variable) in a loop. I want to run the loop for the condition: counter_variable<=3 whereas 'counter_variable' is a container variable of 'simple XSD type(XSD: integer)'.
    All the blogs and threads  have demonstrated like how to use the EX operator with container variable of type 'Abstract interface'. But how can i incorporate the above scenario for a container variable of simple xsd type ? Please share your ideas.
    Regards,
    Laawanya

    so this is what you need to do,
    1. in your loop have a container operation that will increment your simple integer variable each time a message come in.
    2. for your loop the condition will be, left operand (simple integer variable) /= (not equal) 3 (Constant)
    Ref: SAP BASIS (SWCV) -> http://sap.com/xi/XI/System/Patterns -> Integration Process -> BpmPatternCollectPayload
    the only difference here will be the loop condition to be altered as i have mentioned above.

  • 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.

  • CcBPM - switch with a condition (greater than) in XI 7.0

    Hello.
    I have this BPM that must have a switch condition like:
    IF <field xpto> of the received message is greater than 0.
      branch 1.
    ELSE.
      branch 2.
    ENDIF.
    In XI 7.1 is easy, because the condition editor has logical expressions like >, <, etc ...
    In XI 7.0 we don't have that, but in SAP help I read:
    You want to formulate the following condition: The booking number (BookingNumber) is greater than 0100.
    Since the greater than (>) operator is not available in the condition editor, you can use the following solution: You define the relevant logical expression in the expression editor by means of an XPath predicate, and assign it to a node element. Using the condition editor you then just query the existence of this node element (by using the existence operator (EX)).
    This means you first create the following expression in the expression editor:
    /FlightBookingOrderConfirmation [BookingID/BookingNumber > 0100]
    Using the condition editor, you then formulate the following condition:
    (/FlightBookingOrderConfirmation [BookingID/BookingNumber > 0100] EX)
    The meaning of this condition is as follows:
    A node element FlightBookingOrderConfirmation exists, to which the following applies: The content of the subelement BookingID/BookingNumber is greater than 0100.
    In my example, the xpath for the variable is:
    /p4:EventMessage/p4:MessageBody/p5:Order/p5:Totals/p5:TotalGrossAmount
    But i'm not getting how to use the bracket condition.
    Regards,
    Valter Oliveira.
    Edited by: Valter Oliveira on Mar 10, 2009 6:04 PM

    Hi, valter:
    Existence operator (EX) is to check if the node exist in your source message or not.
    It is used in Conditional Editor, mostly in the conditional routing in ID.
    IF <field xpto> of the received message is greater than 0.
    branch 1.
    ELSE.
    branch 2.
    ENDIF.
    If your branch 1 or 2 is a send step, then you can use the conditional routing to substitute BPM logic.
    otherwise, you can not use conditon editor to replace your BPM logics.
    Regards.
    Liang

  • IDOC - FILE Issue

    SCENARIO: IDOC-FILE
    IDOC: COND_A04
    DESIGN: Two namespaces with DT,MT,MI,MM,IM for sales condition and purchase condition.
    Here based on the condition(LIFNR) i have to schedule the message to either salesconditon CC or purchasecondition CC.
    REQUIREMENT: If LIFNR has value in IDOC it should go to SALESCONDITION receiver CC, else PURCHASECONDITION.
    I need the condition to be given in receiver determination.
    note: we are using different structures for salescondition and purchase condition even the idoc is same.
    thanks in advance

    Hi,
    First check some links on xpath and then put the condition in receiver determination
    XPath to show the path (Multiple Receivers)
    http://help.sap.com/saphelp_nw04/helpdata/en/43/a5f2066340332de10000000a11466f/content.htm
    http://www.w3schools.com/xpath/default.asp
    http://www.w3schools.com/xpath/xpath_operators.asp
    Customise your 'XPATH' Expressions in Receiver Determination
    Multiple Inbound Interfaces within a Service
    Have a look into this link for complete understanding about XPATH Predicates.
    http://www.tizag.com/xmlTutorial/xpathpredicate.php
    Customise your 'XPATH' Expressions in Receiver Determination
    Multiple Inbound Interfaces within a Service
    XPath to show the path (Multiple Receivers)
    http://help.sap.com/saphelp_nw04/helpdata/en/59/e1283f2bbad036e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ab/13bf7191e73a4fb3560e767a2525fd/content.htm
    https://forums.sdn.sap.com/click.jspa?searchID=12418562&messageID=5232329
    http://www.tizag.com/xmlTutorial/xpathpredicate.php
    XPath to show the path (Multiple Receivers)
    http://help.sap.com/saphelp_nw04/helpdata/en/43/a5f2066340332de10000000a11466f/content.htm
    http://www.w3schools.com/xpath/default.asp
    http://www.w3schools.com/xpath/xpath_operators.asp
    Customise your 'XPATH' Expressions in Receiver Determination
    Multiple Inbound Interfaces within a Service
    http://help.sap.com/saphelp_nw04/helpdata/en/59/e1283f2bbad036e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ab/13bf7191e73a4fb3560e767a2525fd/content.htm
    Regards,
    Phani

  • How do you get brackets [  ] to be visible in the forumn?

    When I'm responding to posts with XPATH predicates they keep disappearing in the post because the forumn formatting engine thinks it's a URL. Does anybody know how to workaround this issue?
    Thanks,
    Ike Wiggins
    http://biupublisher.blogspot.com

    Use tags (code) ... (/code) (replace brackets with square brackets). Will display like this:
    [anything]

  • ORA-00932 Using Structured XML Table

    Hello,
    I'm having a problem in trying to create and use a Structured XML Table.
    I have created very small sample that illustrates my problem:
    I have registered the following schema:
    <schema
    targetNamespace="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd"
    xmlns:jjm="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd" xmlns="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <complexType name="JjmType">
    <choice maxOccurs="unbounded">
    <element name = "Key" type = "string"></element>
    <element name = "Type" type = "string"></element>
    <element name = "AccessID" type = "string"></element>
    </choice>
    </complexType>
    <element name ="Jjm" type="jjm:JjmType"/>
    </schema>'
    Then I created the following table:
    CREATE TABLE JJM_SCHEMA of XMLType
    XMLSCHEMA "http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd"
    ELEMENT "Jjm";
    Then I inserted the following row:
    insert into JJM_SCHEMA values(xmltype('<Jjm
                             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                             xsi:noNamespaceSchemaLocation="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd">
    <Key>anp</Key>
                   <Type>User</Type>
    <AccessID>TSL2</AccessID>
    </Jjm>'));
    Then I do the following query:
    SELECT
    extract(value(x),
    '/Jjm[Type="User"]') AS jjmXML FROM JJM_SCHEMA x
    WHERE existsNode(value(x),'/Jjm[Type="User"]') = 1;
    I get this error:
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected UDT got CHAR
    However, if I remove the Xpath predicate [Type="User"] from the "extract()" function and WHERE clause...
    SELECT
    extract(value(x),
    '/Jjm') AS jjmXML FROM JJM_SCHEMA x
    WHERE existsNode(value(x),'/Jjm') = 1;
    The query works.
    Also, If I change the schema from <choice maxOccurs="unbounded"> to <sequence>... either query works.
    I need the "choice" type element to work with the Xpath predicate. Am I missing something?
    Thanks in advance.
    Jim McDowall

    Jim
    Which version of the database are you using...
    Testing with 9.2.0.4.0 I had to add an xmlns declaration to the instance document before I could insert it into the table
    <Jjm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd" xsi:noNamespaceSchemaLocation="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd">
         <Key>anp</Key>
         <Type>User</Type>
         <AccessID>TSL2</AccessID>
    </Jjm>
    However once that was done I get the following.
    SQL*Plus: Release 9.2.0.4.0 - Production on Wed Aug 20 15:40:32 2003
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    SQL> spool testcase.log
    SQL> set trimspool on
    SQL> connect &1/&2
    Connected.
    SQL> --
    SQL> set timing on
    SQL> set long 10000
    SQL> set pages 10000
    SQL> set feedback on
    SQL> set lines 132
    SQL> --
    SQL> SELECT extract(value(x),'/Jjm[Type="User"]') AS jjmXML
    2 FROM JJM_SCHEMA x
    3 WHERE existsNode(value(x),'/Jjm[Type="User"]') = 1
    4 /
    JJMXML
    <Jjm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tsldev01.thesoftlife.com:7887/SoftTop/S
    noNamespaceSchemaLocation="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd">
    <Key>anp</Key>
    <Type>User</Type>
    <AccessID>TSL2</AccessID>
    </Jjm>
    1 row selected.
    Elapsed: 00:00:02.07
    SQL> SELECT extract(value(x),'/Jjm') AS jjmXML
    2 FROM JJM_SCHEMA x
    3 WHERE existsNode(value(x),'/Jjm') = 1;
    JJMXML
    <Jjm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tsldev01.thesoftlife.com:7887/SoftTop/S
    noNamespaceSchemaLocation="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd">
    <Key>anp</Key>
    <Type>User</Type>
    <AccessID>TSL2</AccessID>
    </Jjm>
    1 row selected.
    Elapsed: 00:00:00.00
    SQL> /
    JJMXML
    <Jjm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tsldev01.thesoftlife.com:7887/SoftTop/S
    noNamespaceSchemaLocation="http://tsldev01.thesoftlife.com:7887/SoftTop/Schemas/Jjm.xsd">
    <Key>anp</Key>
    <Type>User</Type>
    <AccessID>TSL2</AccessID>
    </Jjm>
    1 row selected.
    Elapsed: 00:00:00.00
    SQL> quit

  • Help!! Calling PL/SQL with table of objects params

    Hi JDBC experts,
    This is probably a familiar problem to many of you and I was hoping you can help me.
    I have a JDBC application that makes calls to a PL/SQL stored procedure that accepts and returns tables (arrays) of objects. I have an equivalent representation of these in Java (the object is a simple Java class and the array of objects is a subclass of ArrayList). The object has around 10 attributes (varchar and number) and the call typically accepts and returns between 50 and 100 objects.
    I noticed that converting from one representation to the other before and after the JDBC call is very time consuming. Before calling the procedure, I need to instantiate a new oracle.sql.ARRAY and fill it with oracle.sql.STRUCT equivalents for each object in my ArrayList. After the procedure call returns, I need to instantiate a new ArrayList and fill it with my Java object representation for each oracle.sql.STRUCT in the returned oracle.sql.ARRAY. Given the # of objects returned and the size of each object, this causes performance degradation.
    Is there any way I can avoid the above conversion overhead? I was reading somewhere about jpub and CustomDatum. I tried it out but the code that sqlj generated looked rather complex - but if this is the recommended approach, I can follow that.
    Also, are there any java code examples for dealing with table of (non-scalar) objects with CustomDatum? I saw some code for using CustomDatum with single objects but not with a table of objects.
    Your help is much appreciated!
    Thanks,
    Niranjan

    I would do it like this :
    - use existsNode function in the filter predicate to look for candidate rows regardless of the number of occurrences of target nodes in the document
    - use XPath predicates on attributes to restrict target nodes
    SQL> create table temp1 of xmltype;
    Table created
    SQL>
    SQL> insert into temp1 values(xmlparse(document
      2  '<soc id="2">
      3   <listsectii>
      4    <sectie cods="4">
      5     <prodv codp="2" cant=""></prodv>
      6    </sectie>
      7    <sectie cods="5">
      8     <prodv codp="8"></prodv>
      9    </sectie>
    10    <sectie cods="6">
    11     <prodv codp="2"></prodv>
    12    </sectie>
    13   </listsectii>
    14  </soc>'));
    1 row inserted
    SQL>
    SQL> update temp1
      2  set object_value =
      3      updateXML( object_value
      4               , '/soc/listsectii/sectie[@cods="4"]/prodv[@codp="2"]/@cant'
      5               , 'new_cant' )
      6  where existsNode( object_value
      7                  , '/soc/listsectii/sectie[@cods="4"]/prodv[@codp="2"]' ) = 1
      8  ;
    1 row updated
    SQL> select * from temp1;
    SYS_NC_ROWINFO$
    <soc id="2">
      <listsectii>
        <sectie cods="4">
          <prodv codp="2" cant="new_cant"/>
        </sectie>
        <sectie cods="5">
          <prodv codp="8"/>
        </sectie>
        <sectie cods="6">
          <prodv codp="2"/>
        </sectie>
      </listsectii>
    </soc>
    Of course, that implies there's already an existing "cant" attribute (not the case in your samples).
    If you actually need to create one, then you must use insertChildXML() instead.

  • Dumping xml content with tags

    Hi,
    To help me debugging an rtf template, i would like do display in my pdf output the current node and sub nodeq whis its tags (not only the values). How can i do this ?
    In infopath, i use xml property of node with vbscript.
    thank's

    Thank you for your reply,
    Local-name() is not ok for me, because i want to display in my rtf (for debugging xpath predicates) a node and his subnodes : ie :
    <nodeA>
    <nodeB>value 1</nodeB>
    <nodeB>vlaue 2</nodeB>
    </nodeA>
    local-name(nodeA) does only display nodeA
    thank's

  • Few definitions and difference

    Hi ALL,
    I have some qs....pls help me
    1.What is the diff between BPM and ccBPM(if they are not same)
    2.What is the definition of XPATH?
    3.For Idoc to file scenario is it required to create Distribution channel or not? In some link of SDN I have seen they have created distribution channel and some guys have not created ...so I want to know what to do?
    Regards,
    Somenath

    Hi,
    Have a look into this link for complete understanding about XPATH Predicates.
    http://www.tizag.com/xmlTutorial/xpathpredicate.php
    Customise your 'XPATH' Expressions in Receiver Determination
    Multiple Inbound Interfaces within a Service
    XPath to show the path (Multiple Receivers)
    http://help.sap.com/saphelp_nw04/helpdata/en/59/e1283f2bbad036e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ab/13bf7191e73a4fb3560e767a2525fd/content.htm
    https://forums.sdn.sap.com/click.jspa?searchID=12418562&messageID=5232329
    http://www.tizag.com/xmlTutorial/xpathpredicate.php
    XPath to show the path (Multiple Receivers)
    http://help.sap.com/saphelp_nw04/helpdata/en/43/a5f2066340332de10000000a11466f/content.htm
    http://www.w3schools.com/xpath/default.asp
    http://www.w3schools.com/xpath/xpath_operators.asp
    Customise your 'XPATH' Expressions in Receiver Determination
    Multiple Inbound Interfaces within a Service
    http://help.sap.com/saphelp_nw04/helpdata/en/59/e1283f2bbad036e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ab/13bf7191e73a4fb3560e767a2525fd/content.htm
    Create Customer Distribution model in the transaction code BD64
    1) Click on the Create modal View button and enter the short text, Technical name etc as shown below
    2) Now select the created model view and click on Add message type button .A pop up box appears, enter Sending system, receiving system and message type
    3) Save the Distribution model
    Generate Partner Profiles
    Click on Menu Item u2018Generate Partner Profilesu2019
    It leads to the next transaction where in the selection screen you have to provide Model view name, Partner System logical system and execute
    Then, you will be intimated about the partners, port creation, and outbound parameters creation
    4) Distribute Customer Distribution Model
    In the menu item GO to Edit->Modal View-> u2018Distributeu2019 to the destination client
    Popup window appears ,press Enter
    You will be intimated about the the Modal View Distributed
    Regards,
    Phani

  • Finder Methods - Does xmlbeans support this?

    Finder Methods - Does xmlbeans support this?
    Hi,
    Q1 - Is there currently a mechanism via generated xmlbeans java classes to
    find specific data required (from within the java generated methods
    provided). For example assuming in the following xml (see below) if one has
    already loaded the <main-item> via xmlbean generated java classes, but then
    wishes to find the appropriate configs/config within this section of the xml
    (i.e. the main-item entry "config" is a reference to one of the "config"
    items under "configs") , does XMLBeans currently support this? That is, it
    would be nice to have finder methods on the generated java classes so once
    you have a <configs> java instance you can issue a finder method for a
    <config> item and pass the <config-name> in. For example:
    What is available: MainXML.getConfigs().getConfig(23) -> i.e. put in
    index,
    However what about: MainXML.getConfigs().findConfig ("mainConfig");
    Q2 - If there is no support for this within the generated java classes what
    is recommended? Via xpath? Have to write your own short java finder classes
    which iterate through until the item is found?
    ATTACHMENT - XML REFERED TO
    ============================
    < MainXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="xxx.xsd">
    <configs>
    <config>
    <config-name>mainConfig</config-name>
    <report_width>1</report_width>
    </config>
    <config>
    <config-name>testConfig</config-name>
    <report_width>0</report_width>
    </config>
    </configs>
    <main-config>
    <main-item>
    <itemName>TestItem</itemName>
    <config>mainConfig</config>
    </main-item>
    </main-config>
    </sns_config>
    Cheers
    Greg

    thanks Steve
    "Steve Traut" <[email protected]> wrote in message
    news:[email protected]...
    Hello Greg,
    To my knowledge, the reference-specific kind of function you're asking for
    isn't supported. But if you're writing code on WebLogic Platform 8.1, you
    can use XPath/XQuery to accomplish this. Incidentally, your XML belowopens
    with MainXML and closes with sns_config, but I'll assume it's MainXML.
    To retrieve a main-config/main-item/config element when you know the
    config-name element's value, you could use the following expression (where
    the mainXml variable is a MainXMLDocument instance):
    String queryExpression = "$this/MainXML/configs/config[config-name=
    'mainConfig']";
    ConfigType[] configs =
    (ConfigType[])mainXml.selectPath(queryExpression);
    The configs array would contain one item in this case. The second linewould
    throw a class cast exception if no results were returned.
    Note that XPath predicates aren't supported in XMLBeans outside thecontext
    of WebLogic, but simple path expressions are.
    Steve
    "greg" <[email protected]> wrote in message news:1074728633.92236@ns1...
    Finder Methods - Does xmlbeans support this?
    Hi,
    Q1 - Is there currently a mechanism via generated xmlbeans java classes
    to
    find specific data required (from within the java generated methods
    provided). For example assuming in the following xml (see below) if onehas
    already loaded the <main-item> via xmlbean generated java classes, butthen
    wishes to find the appropriate configs/config within this section of thexml
    (i.e. the main-item entry "config" is a reference to one of the
    "config"
    items under "configs") , does XMLBeans currently support this? That is,it
    would be nice to have finder methods on the generated java classes so
    once
    you have a <configs> java instance you can issue a finder method for a
    <config> item and pass the <config-name> in. For example:
    What is available: MainXML.getConfigs().getConfig(23) -> i.e. putin
    index,
    However what about: MainXML.getConfigs().findConfig ("mainConfig");
    Q2 - If there is no support for this within the generated java classeswhat
    is recommended? Via xpath? Have to write your own short java finderclasses
    which iterate through until the item is found?
    ATTACHMENT - XML REFERED TO
    ============================
    < MainXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="xxx.xsd">
    <configs>
    <config>
    <config-name>mainConfig</config-name>
    <report_width>1</report_width>
    </config>
    <config>
    <config-name>testConfig</config-name>
    <report_width>0</report_width>
    </config>
    </configs>
    <main-config>
    <main-item>
    <itemName>TestItem</itemName>
    <config>mainConfig</config>
    </main-item>
    </main-config>
    </sns_config>
    Cheers
    Greg

  • What is this type of searching called?  Need assistance please.

    version: 11.2.0.2
    sparc64
    I have a requirement to create a view from an xmltype column. One of the columns would be:
    /Invoice/ReferenceNumbers/ReferenceNumberType=PURCHASE_ORDER_NUMBER/ReferenceNumber...and the respective fragment would look like:
    <ReferenceNumbers>
        <ReferenceNumber>
           <ReferenceNumber>?</ReferenceNumber>
           <Description>?</Description>
           <ReferenceNumberType>?</ReferenceNumberType>
         </ReferenceNumber>
    </ReferenceNumbers>Being that the node is generically named "ReferenceNumber," what is it called when I need to search the "ReferenceNumberType" by a particular string - in this case, the PURCHASE_ORDER_NUMBER?
    select m.*
        from INVOICE i,
             xmlTable
                '$i/Invoice'
                passing i.doc as "i"
                columns
                INVOICE_NUMBER PATH '/Invoice/InvoiceHeader/invoiceNumber/text()',
                PO_NUMBER path '/Invoice/ReferenceNumbers/ReferenceNumberType=PURCHASE_ORDER_NUMBER/ReferenceNumber/text()'
             ) m
    /* I know this is incorrect, but trying to detail what I'm getting after */Any help would be appreciated...I'll research how to do that in sql xquery, I just don't know what it's called.
    Thank you in advance.

    You're close. You just need a correct XPath expression.
    SELECT x.*
    FROM invoice t
       , XMLTable(
           '$i/Invoice'
           passing i.doc as "i"
           columns
             invoice_number number path 'InvoiceHeader/invoiceNumber'
           , po_number      number path 'ReferenceNumbers/ReferenceNumber[ReferenceNumberType="PURCHASE_ORDER_NUMBER"]/ReferenceNumber'
         ) x
    /  The part between square brackets is an XPath predicate, it restricts the selected ReferenceNumber elements to those having a child ReferenceNumberType = "PURCHASE_ORDER_NUMBER", then the rest of the expression selects the child named ReferenceNumber (assuming it's not an error).

  • UPDATEXML

    Hello
    My conf :
    SQL> select * from V$VERSION;
    BANNER
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Beta
    PL/SQL Release 11.2.0.2.0 - Beta
    CORE 11.2.0.2.0 Production
    TNS for 32-bit Windows: Version 11.2.0.2.0 - Beta
    NLSRTL Version 11.2.0.2.0 - Production
    One of my XML stored document :
    SQL> SELECT v.OBJECT_VALUE
    2 FROM vol_reel_xml_2 v
    3 WHERE XMLEXISTS('$obj/vol_reel[@nvol="AF6154"]'
    4 PASSING v.OBJECT_VALUE AS "obj")
    5 AND XMLEXISTS('$obj/vol_reel/passagers/pax[@num_carte=13457934]'
    6 PASSING v.OBJECT_VALUE AS "obj")
    7 AND TO_DATE(XMLCAST(
    8 XMLQUERY('$obj/vol_reel/@datev'
    9 PASSING BY VALUE v.OBJECT_VALUE AS "obj"
    10 RETURNING CONTENT)
    11 AS VARCHAR2(12)),'YYYY-MM-DD')
    12 = TO_DATE('2012-08-31','YYYY-MM-DD');
    OBJECT_VALUE
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <vol_reel nvol="AF6154" datev="2012-08-31">
    <passagers>
    <pax num_carte="13457934">
    <nom>Lacombe</nom>
    <prenom>Serge</prenom>
    <siege>05A</siege>
    <prix>190</prix>
    </pax>
    <pax num_carte="44482340">
    <nom>Blanchet</nom>
    <prenom>Agnes</prenom>
    <siege>17D</siege>
    <prix>146</prix>
    </pax>
    </passagers>
    </vol_reel>
    I want update the "prix" element for the first pax (198 replace 190) :
    With the same predicates, the element isn't updated :
    SQL> UPDATE vol_reel_xml_2 v
    2 SET v.OBJECT_VALUE =
    3 UPDATEXML(v.OBJECT_VALUE,'/vol_reel/passagers/pax/prix/text()','198')
    4 WHERE XMLEXISTS('$obj/vol_reel[@nvol="AF6154"]' PASSING v.OBJECT_VALUE AS "obj")
    5 AND XMLEXISTS('$obj/vol_reel/passagers/pax[@num_carte=13457934]'
    6 PASSING v.OBJECT_VALUE AS "obj")
    7 AND TO_DATE(XMLCAST(
    8 XMLQUERY('$obj/vol_reel/@datev'
    9 PASSING BY VALUE v.OBJECT_VALUE AS "obj"
    10 RETURNING CONTENT)
    11 AS VARCHAR2(12)),'YYYY-MM-DD')
    12 = TO_DATE('2012-08-31','YYYY-MM-DD');
    0 rows updated.
    Any idea?
    Thanks in advance

    Thanks
    You're right, my table is created based on XML Schema :
    CREATE TABLE vol_reel_xml_2 OF XMLType
    XMLTYPE STORE AS OBJECT RELATIONAL
    XMLSCHEMA "http://www.iut-blagnac.fr/vols.xsd"
    ELEMENT "vol_reel"
    VARRAY "XMLDATA"."passagers"."pax" STORE AS TABLE pax_tabnt;
    ---xml schema (vol_reel_annote.xsd)
    <?xml version="1.0" encoding="utf-8"?>
    <xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xdb:storeVarrayAsTable="true" version="1.0" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <xsd:element name="vol_reel" type="vol_reelType"/>
         <xsd:complexType name="vol_reelType" xdb:SQLType="VOL_REEL_XML_T">
              <xsd:sequence>
                   <xsd:element name="passagers" type="passagersType"/>
              </xsd:sequence>
              <xsd:attribute name="nvol" xdb:SQLType="VARCHAR2">
                   <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                             <xsd:minLength value="4"/>
                             <xsd:maxLength value="7"/>
                        </xsd:restriction>
                   </xsd:simpleType>
              </xsd:attribute>
              <xsd:attribute name="datev" type="xsd:date"/>
         </xsd:complexType>
         <xsd:complexType name="passagersType" xdb:SQLType="PASSAGERS_T">
              <xsd:sequence>
                   <xsd:element minOccurs="2" maxOccurs="180" name="pax" type="paxType" xdb:SQLCollType="PASSAGERS_VRY_T"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="paxType" xdb:SQLType="PASSAGERS_ELT_VRY_T">
              <xsd:sequence>
                   <xsd:element name="nom" minOccurs="1" xdb:SQLType="VARCHAR2">
                        <xsd:simpleType>
                             <xsd:restriction base="xsd:string">
                                  <xsd:minLength value="1"/>
                                  <xsd:maxLength value="30"/>
                             </xsd:restriction>
                        </xsd:simpleType>
                   </xsd:element>
                   <xsd:element name="prenom" minOccurs="1" xdb:SQLType="VARCHAR2">
                        <xsd:simpleType>
                             <xsd:restriction base="xsd:string">
                                  <xsd:minLength value="1"/>
                                  <xsd:maxLength value="30"/>
                             </xsd:restriction>
                        </xsd:simpleType>
                   </xsd:element>
                   <xsd:element name="siege" minOccurs="1" xdb:SQLType="CHAR">
                        <xsd:simpleType>
                             <xsd:restriction base="xsd:string">
                                  <xsd:minLength value="1"/>
                                  <xsd:maxLength value="3"/>
                             </xsd:restriction>
                        </xsd:simpleType>
                   </xsd:element>
                   <xsd:element name="prix" minOccurs="1" xdb:SQLType="NUMBER">
                        <xsd:simpleType>
                             <xsd:restriction base="xsd:decimal">
                                  <xsd:fractionDigits value="2"/>
                                  <xsd:totalDigits value="4"/>
                             </xsd:restriction>
                        </xsd:simpleType>
                   </xsd:element>
              </xsd:sequence>
              <xsd:attribute name="num_carte" type="xsd:int"/>
         </xsd:complexType>
    </xsd:schema>
    ----- xml schema registration
    BEGIN
    --DBMS_XMLSCHEMA.DELETESCHEMA
    -- ('http://www.iut-blagnac.fr/vols.xsd',DBMS_XMLSCHEMA.DELETE_CASCADE_FORCE);
    DBMS_XMLSCHEMA.REGISTERSCHEMA(
    SCHEMAURL => 'http://www.iut-blagnac.fr/vols.xsd',
    SCHEMADOC => BFILENAME('REPXML','vol_reel_annote.xsd'),
    LOCAL => TRUE, GENTYPES => TRUE, GENTABLES => FALSE,
    CSID => NLS_CHARSET_ID('AL32UTF8'));
    END;
    Your succesful update becomes with my configuration :
    SQL> UPDATE vol_reel_xml_2 v
    2 SET v.object_value =
    3 updateXML( v.object_value,
    4 '/vol_reel/passagers/pax[@num_carte=13457934]/prix/text()'
    5 , 198 )
    6 WHERE XMLExists('/vol_reel[@nvol="AF6154" and @datev="2012-08-31"]'
    7 passing v.object_value);
    SET v.object_value =
    ERROR at line 2:
    ORA-19162: XPTY0004 - XQuery type mismatch: invalid argument types 'xs:date',
    'xs:string' for function '='
    By translating the xsd:datetime / Oracle date :
    SQL> UPDATE vol_reel_xml_2 v
    2 SET v.object_value =
    3 updateXML( v.object_value,
    4 '/vol_reel/passagers/pax[@num_carte=13457934]/prix/text()',198)
    5 WHERE XMLExists('/vol_reel[@nvol="AF6154"]'passing v.object_value)
    6 AND TO_DATE(XMLCAST(
    7 XMLQUERY('$obj/vol_reel/@datev'
    8 PASSING BY VALUE OBJECT_VALUE AS "obj"
    9 RETURNING CONTENT)
    10 AS VARCHAR2(12)),'YYYY-MM-DD')
    11 = TO_DATE('2012-08-31','YYYY-MM-DD');
    1 row updated.
    I think my fault came from the fact I performed the test num_carte=13457934 in the UPDATE WHERE clause instead of the XPath predicate as previously.
    Thanks again

Maybe you are looking for

  • My work calendar is gone off of ical and icloud. how do i restore this from time machine

    last night i opened reminders and there was new list with the same name as my work calendar. i immediately deleted it as i don't want my reminders to show up on a shared work calendar. now this morning i find out by deleting this NEVER CREATED REMIND

  • Oracle 8.1.7 Release 3 on Windows XP Home Edition

    Hi, I'm trying to install the personal oracle 8.1.7 in a laptop which is an windows xp home edition. The installer doesn't start! Is it a compatibility problem? What should i do now to install oracle?

  • Oracle 9i ignores INDEX hint

    Hello, I try to convince Oracle to do a index scan rather then a full table scan in a query. To do this I created a view on top of the table which simply adds this hint: CREATE OR REPLACE VIEW V_FHDDSC3_FACT_DATA_4WEEK AS SELECT /*+ INDEX(T P_FHDDSC3

  • ITunes Sync Error Message -69

    Recently i get this error message when i'm trying to sync songs onto the iPhone. I'm using iPhone software 3.1.2 and iTunes 9. It doesn't seem to backup anymore either, just stalls after a few minutes into it. iTunes doesn't freeze the backup itself

  • Can't connect to apps server

    New iPad.  When I try to open app store message reads "Cound not connect to the server". Yet when prompted by iPad to get facebook app, it will download free apps. Any suggestions?