XPath

Hello

I need help to use XPath, take this code of the 'net' and turns it into LabVIEW code, but the result I get is not desired

http://rapidshare.com/files/234470020/XPath.zip.html

Original post (http://forums.ni.com/ni/board/message?board.id=6170&thread.id=9769)

According to the original code is concerned, is not a direct application of .NET code. You need a loop to fill your XPath matches. See attached the amendment.

Tags: NI Software

Similar Questions

  • XPath gets a parent attribute

    Given this XML structure.



    text 1


    text 2


    text 3

    How I would write an xpath statement to return the cmd attribute for a single element of found?

    For example, if the text 2 is found then return 'b'... If text 1 is found then return 'a'... you get the idea... I need the attribute parent of a child element that is found.

    TIA

    Hello FunkyMonk,

    This site talks about how to choose the parent of an element in an XML expression:

    http://www.Tizag.com/xmlTutorial/xpathparent.php

    That answer your question?

  • XPath on Blackberry?

    Hello. I create a contact application that retrieves all of its data in xml files. Is it possible to implement Xpath on the BlackBerry device to query the XML?

    Thank you

    Welcome to the support forum.

    There is no implementation of rim.
    You can take a look at http://minixpath.sourceforge.net/ or other xpath j2me projects perhaps.

  • Problem with an xpath expression

    I know this isn't forum BPEL, BPEL forum is not active as a forum of the ADF because I post here. Thank you.

    I have no problem running my SOA BPEL application on test environment. When I deploy the same thing to the prod. environment, I have error "selectionfailure." When I checked the instance I noticed that this block of (operation assign) a single element is repeated twice. He threw the error message "'the result contains 2 nodes for the XPath expression" "

    I tried under code but no luck.

    < copy bpelx:ignoreMissingFromData = 'yes '.
    bpelx:insertMissingToData = "yes" >

    query. query returns 1 row.

    Are you sure that it returns only a single folder on the production environment for given id? (you paste only the payload)

    Can I add indexes like this at the end? ' / ns3:AuthDBServiceOutputCollection / ns3:AuthDBServiceOutput / ns3:USER_ID [1].

    Well, it is rather: /ns3:AuthDBServiceOutputCollection / ns3:AuthDBServiceOutput [1] / ns3:USER_ID

    But if your query returns a single folder, then it is not.

    Dario

  • create xmlindex structured with multiple columns reflecting different XPath expressions

    I run a XMLEXISTS query to return documents that contain a specific search template. The search model is based on two distinct XPATHS. I tried to create an XML Index structured to support the request. While I can make it work when I specify that a XPATH, I can't make it work when I specify both.

    Oracle version: 11.2.0.3

    extendeddata / / DESC

    Name                                      Null?    Type

    ----------------------------------------- -------- ----------------------------

    U NOT NULL VARCHAR2 (14)

    XMLCONTENT NOT NULL SYS. XMLTYPE BINARY STORAGE

    ROWINSERTDATE NOT NULL DATE

    XMLSIZE NOT NULL NUMBER (10)

    DATAIMPORTID NOT NULL VARCHAR2 (100)

    MESSAGEFLOWNAME NOT NULL VARCHAR2 (200)

    Table is partitioned by month on ROWINSERTDATE

    XMLType column stored as files secure.

    Here's the query...

    SELECT u, xmlcontent

    To extendeddata

    WHERE the XMLEXISTS ('declare namespace CAMT54 = "urn: iso: std: iso: 20022:tech:xsd:camt.054.001.02";)

    $p / CAMT54:Document / CAMT54:BkToCstmrDbtCdtNtfctn / CAMT54:Ntfctn [CAMT54:Acct / CAMT54:Id / CAMT54:IBAN = $iban]

    [and CAMT54:Ntry / CAMT54:CdtDbtInd = $ctddbtind]' Xmlcontent passing that 'p ',.

    "XXXXXXXXXXXXXXXXXXXXXX" AS "iban",.

    "DBIT" as "ctddbtind")

    AND rowinsertdate > = TO_DATE (' 2014-06-01 00:00:00 ',' ' SYYYY-MM-DD HH24:MI:SS)

    AND rowinsertdate < TO_DATE (' 2014-07-01 00:00:00 ',' SYYYY-MM-DD HH24:MI:SS');

    Here's the index...

    CREATE INDEX EXTENDEDDATA_XML_IDX1 ON EXTENDEDDATA (XMLCONTENT)

    INDEXTYPE IS XDB. XMLIndex LOCAL SETTINGS (' XMLTable EXTENDEDDATAIBAN)

    XMLNAMESPACES ("urn: iso: std: iso: 20022:tech:xsd:camt.054.001.02" as "CAMT54").

    "/ CAMT54:Document / CAMT54:BkToCstmrDbtCdtNtfctn / CAMT54:Ntfctn"

    COLUMNS

    IBAN VARCHAR (34) PATH "CAMT54:Acct / CAMT54:Id / CAMT54:IBAN".

    CTDDBTIND varchar (4) PATH "CAMT54:Ntry / CAMT54:CdtDbtInd" ');

    CREATE INDEXES SEPA_PAY. EXTENDEDDATAIBAN_IDX1 ON EXTENDEDDATAIBAN (IBAN, CTDDBTIND)

    TABLESPACE SEPA_PAY_BIG_IDX;

    exec dbms_stats.gather_table_stats (ownname = > 'SEPA_PAY', tabname = > 'EXTENDEDDATA');

    Here is the plan to explain it...

    PLAN_TABLE_OUTPUT

    ------------------------------------------------------------------------------------------------------------------------------------

    Hash value of plan: 417322092

    --------------------------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    --------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |              |  1050 |   648KO |    38 (0) | 00:00:01 |       |       |

    |*  1 |  FILTER |              |       |       |            |          |       |       |

    |   2.   RANGE OF SINGLE PARTITION |              |  1050 |   648KO |    32 (0) | 00:00:01 |    16.    16.

    |   3.    TABLE ACCESS FULL | EXTENDEDDATA |  1050 |   648KO |    32 (0) | 00:00:01 |    16.    16.

    |   4.   SEMI NESTED LOOPS.              |     1.     6.     6 (0). 00:00:01 |       |       |

    |   5.    SEMI NESTED LOOPS.              |     1.     4.     4 (0) | 00:00:01 |       |       |

    PLAN_TABLE_OUTPUT

    ------------------------------------------------------------------------------------------------------------------------------------

    |   6.     XPATH EVALUATION.              |       |       |            |          |       |       |

    |*  7 |     XPATH EVALUATION.              |       |       |            |          |       |       |

    |*  8 |    XPATH EVALUATION.              |       |       |            |          |       |       |

    --------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 Filter (EXISTS (SELECT / * + < impossible >))

    7 - filter("P2"."$ C_01"="DBIT')

    8 - filter("P1"."$ C_01"="XXXXXXXXXXXXXXXXXXXXXX')

    PLAN_TABLE_OUTPUT

    ------------------------------------------------------------------------------------------------------------------------------------

    Note

    -----

    -Construction detected no optimized XML (activate XMLOptimizationCheck for more information)

    The following is an extract from the XML file...

    " < document xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "xmlns =" urn: iso: std: iso: 20022:tech:xsd:camt.054.001.02 "" >

    < BkToCstmrDbtCdtNtfctn >

    < GrpHdr >

    < MsgId > NFTTEST201311060150412 < / MsgId >

    < CreDtTm > 2013 - 11 - 06T 15: 04:12 < / CreDtTm >

    < / GrpHdr >

    < Ntfctn >

    < id > 00001 / < ID >

    < CreDtTm > 2013 - 11 - 06T 15: 04:12 < / CreDtTm >

    < Acct >

    < id >

    XXXXXXXXXXXXXXXXXXXXXX < IBAN > < / IBAN >

    < /ID >

    < / Acct >

    < do >

    < Amt CTL = "EUR" > 89.00 < / Amt >

    < CdtDbtInd > DBIT < / CdtDbtInd >

    < m > BOOK < / m >

    < BkTxCd >

    < Prtry >

    < Cd > 99999999999999 < CD >

    < / Prtry >

    < / BkTxCd >

    < NtryDtls >

    < TxDtls >

    < refs >

    < Course > 999_99999999 < / course >

    < MndtId > str1234 < / MndtId >

    < / refs >

    < AmtDtls >

    < TxAmt >

    < Amt CTL = "EUR" > 89.00 < / Amt >

    < / TxAmt >

    < / AmtDtls >

    < BkTxCd >

    < Domn >

    < Cd > < CD > SEPA

    < Montaut >

    < Cd > < CD > SEPA

    < SubFmlyCd > CORE < / SubFmlyCd >

    < / Montaut >

    < / Domn >

    < / BkTxCd >

    < RltdPties >

    < UltmtDbtr >

    str1234 < n > < /Nm >

    < id >

    < OrgId >

    < BICOrBEI > XXXXXXXX < / BICOrBEI >

    < Scout >

    str1234 < id > < /ID >

    < SchmeNm >

    str1 < Cd > < CD >

    < / SchmeNm >

    str1234 < HIRS > < / HIRS >

    < / Scout >

    < / OrgId >

    < /ID >

    < / UltmtDbtr >

    < Instantane >

    str1234 < n > < /Nm >

    < PstlAdr >

    < Ctry > IE < / Ctry >

    < AdrLine > str1234 < / AdrLine >

    < / PstlAdr >

    < / Instantane >

    < CdtrAcct >

    < id >

    XXXXXXXXXXXXXXXXXXXXXX < IBAN > < / IBAN >

    < /ID >

    < CTL > EUR < / CTL >

    < / CdtrAcct >

    < UltmtCdtr >

    str1234 < n > < /Nm >

    < id >

    < OrgId >

    < BICOrBEI > XXXXXXXX < / BICOrBEI >

    < Scout >

    str1234 < id > < /ID >

    < SchmeNm >

    str1 < Cd > < CD >

    < / SchmeNm >

    str1234 < HIRS > < / HIRS >

    < / Scout >

    < / OrgId >

    < /ID >

    < / UltmtCdtr >

    < Prtry >

    < Tp > default SEPA < /TP >

    < Pty >

    < id >

    < PrvtId >

    < Scout >

    < id > < /ID > XXXXXXXXXXXXX

    < / Scout >

    < / PrvtId >

    < /ID >

    < / Pty >

    < / Prtry >

    < / RltdPties >

    < Purp >

    str1 < Cd > < CD >

    < / Purp >

    < RmtInf >

    < Ustrd > str1234 < / Ustrd >

    < Strd >

    < CdtrRefInf >

    < Tp >

    < CdOrPrtry >

    < Cd > SCOR < CD >

    < / CdOrPrtry >

    str1234 < HIRS > < / HIRS >

    < /TP >

    < ref > str1234 < / Ref >

    < / CdtrRefInf >

    < / Strd >

    < / RmtInf >

    < / TxDtls >

    < / NtryDtls >

    < / try >

    < / Ntfctn >

    < / BkToCstmrDbtCdtNtfctn >

    < / document >

    Can someone help me build an index for the query above?

    Thank you.

    This should work better, with the caveat explained above:

    SELECT t.*
    FROM extendeddata t
    WHERE XMLEXISTS('declare default element namespace "urn:iso:std:iso:20022:tech:xsd:camt.054.001.02";(::)
                   /Document/BkToCstmrDbtCdtNtfctn/Ntfctn[Acct/Id/IBAN=$iban]'
            Passing Xmlcontent,
                    'XXXXXXXXXXXXXXXXXXXXXX' AS "iban"
               )
    and XMLEXISTS('declare default element namespace "urn:iso:std:iso:20022:tech:xsd:camt.054.001.02";(::)
                   /Document/BkToCstmrDbtCdtNtfctn/Ntfctn[Ntry/CdtDbtInd=$ctddbtind]'
            Passing Xmlcontent,
                    'DBIT' as "ctddbtind")
    AND rowinsertdate >= TO_DATE(' 2014-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS')
    AND rowinsertdate < TO_DATE(' 2014-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS')
    ;
    

    (see how the predicates in each XQuery expression corresponds to the structure of the index)

    BTW, this kind of "DIY" XMLEXISTS works just as well.

    It emulates what we would have hoped for a single XMLExists in the first place:

    SQL> SELECT t.*
      2  FROM extendeddata t
      3  WHERE rowinsertdate >= TO_DATE(' 2015-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS')
      4  AND rowinsertdate < TO_DATE(' 2015-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS')
      5  AND EXISTS (
      6    SELECT null
      7    FROM XMLTable(
      8           XMLNamespaces(default 'urn:iso:std:iso:20022:tech:xsd:camt.054.001.02')
      9         , '/Document/BkToCstmrDbtCdtNtfctn/Ntfctn'
     10           passing t.xmlcontent
     11           COLUMNS IBAN      VARCHAR2(34) PATH 'Acct/Id/IBAN'
     12                 , CTDDBTIND VARCHAR2(4)  PATH 'Ntry/CdtDbtInd'
     13         ) x
     14    WHERE x.iban = 'XXXXXXXXXXXXXXXXXXXXXX'
     15    AND x.ctddbtind = 'DBIT'
     16  ) ;
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 409033022
    
    ---------------------------------------------------------------------------------------------------------------
    | Id  | Operation                             | Name                  | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                      |                       |     1 |   824 |     4  (25)| 00:00:01 |
    |   1 |  NESTED LOOPS                         |                       |     1 |   824 |     4  (25)| 00:00:01 |
    |   2 |   SORT UNIQUE                         |                       |     1 |    38 |     2   (0)| 00:00:01 |
    |   3 |    TABLE ACCESS BY INDEX ROWID BATCHED| EXTENDEDDATAIBAN      |     1 |    38 |     2   (0)| 00:00:01 |
    |*  4 |     INDEX RANGE SCAN                  | EXTENDEDDATAIBAN_IDX1 |     1 |       |     1   (0)| 00:00:01 |
    |*  5 |   TABLE ACCESS BY USER ROWID          | EXTENDEDDATA          |     1 |   786 |     1   (0)| 00:00:01 |
    ---------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       4 - access("SYS_SXI_1"."IBAN"='XXXXXXXXXXXXXXXXXXXXXX' AND "SYS_SXI_1"."CTDDBTIND"='DBIT')
       5 - filter("ROWINSERTDATE">=TO_DATE(' 2015-06-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
                  "ROWINSERTDATE"		   
  • Change the display format of date / time when using Xpath

    How /process_data/@create_time in Xpath can be formatted to display in the form of 30-08-2016 T 22: 50:50Z instead of 2016-08-30 T 22: 50:50Z?

    {$format-dateTime-withFormat (/process_data/ @create_time, ' MM-DD-YYYY HH: mm: a ') $}

  • XPath to capture nodes between two nodes

    Hi all

    I met a problem a seemingly simple challenge of mine.

    I have the following xml code.

    Basically, I would like to capture the text between the begin-end blocks

    <? XML version = "1.0" encoding = "UTF-8"? >

    < document >

    < body >

    < paragraph >

    < run >

    < fld type = 'start' / >

    < / run >

    < run >

    < text > SAMPLE < / text >

    < / run >

    < run >

    < text > < / text >

    < / run >

    < run >

    < text > FIELD < / text >

    < / run >

    < run >

    < fld type = 'end' / >

    < / run >

    < run >

    < text > TEXT UNWANTED SOME < / text >

    < / run >

    < / paragraph >

    < paragraph >

    < run >

    < fld type = 'start' / >

    < / run >

    < run >

    < text > SAMPLE < / text >

    < / run >

    < run >

    < text > < / text >

    < / run >

    < run >

    < text > Field2 < / text >

    < / run >

    < run >

    < fld type = 'end' / >

    < / run >

    < run >

    < text > TEXT UNWANTED SOME < / text >

    < / run >

    < run >

    < fld type = 'start' / >

    < / run >

    < run >

    < text > SAMPLE < / text >

    < / run >

    < run >

    < text > < / text >

    < / run >

    < run >

    < text > FIELD3 < / text >

    < / run >

    < run >

    < fld type = 'end' / >

    < / run >

    < / paragraph >

    < / body >

    < / document >

    So far, what I came up with is:

    WITH temp AS (
    SELECT 
           XMLTYPE ('<?xml version="1.0" encoding="UTF-8"?>
                      <document>
                         <body>
                            <paragraph>
                               <run>
                                  <fld type="begin" />
                               </run>
                               <run>
                                  <text>SAMPLE</text>
                               </run>
                               <run>
                                  <text> </text>
                               </run>
                               <run>
                                  <text>FIELD</text>
                               </run>
                               <run>
                                  <fld type="end" />
                               </run>
                               <run>
                                  <text>SOME UNWANTED TEXT</text>
                               </run>
                            </paragraph>
                            <paragraph>
                               <run>
                                  <fld type="begin" />
                               </run>
                               <run>
                                  <text>SAMPLE</text>
                               </run>
                               <run>
                                  <text> </text>
                               </run>
                               <run>
                                  <text>FIELD2</text>
                               </run>
                               <run>
                                  <fld type="end" />
                               </run>
                               <run>
                                  <text>SOME UNWANTED TEXT</text>
                               </run>
                               <run>
                                  <fld type="begin" />
                               </run>
                               <run>
                                  <text>SAMPLE</text>
                               </run>
                               <run>
                                  <text> </text>
                               </run>
                               <run>
                                  <text>FIELD3</text>
                               </run>
                               <run>
                                  <fld type="end" />
                               </run>
                            </paragraph>
                         </body>
                      </document>') AS xml_template
    FROM dual
    )
    SELECT x.*
      FROM temp
          ,XMLTABLE('//*/paragraph/run[fld/@type="begin"]/following-sibling::run[following-sibling::run[fld/@type="end"]]/text'
                    PASSING temp.xml_template
                    COLUMNS res varchar2(100) PATH '.'
                   )x
    

    Result:

    RES

    SAMPLE

    FIELD

    SAMPLE

    FIELD2

    SOME UNWANTED TEXT

    SAMPLE

    FIELD3

    Unfortunately what I wrote XPath is not good enough, because with regard to the text between the two blocs of start-end it still captures the unwanted text.

    My XPath knowledgege dept unfortunately not so I would appriciate annything you can help me with even an idea could get through on the edge.

    Thank you

    Steve

    Steve,

    XQuery can help in this case:

    SELECT x.*
    FROM temp
       , XMLTABLE('for $begin in /document/body/paragraph/run[fld/@type="begin"]
                   let $end := $begin/following-sibling::run[fld/@type="end"][1]
                   return $begin/following-sibling::run[. << $end]'
           PASSING temp.xml_template
           COLUMNS res varchar2(100) PATH 'text'
         ) x  ;
    

    Explanation:

    This FLWOR expression traverses all nodes 'start' in the document, finds the corresponding node of the 'end' and returns the sequence of "run" nodes follows 'begin' and above 'end '.

    If you want to concatenate all the fragments of text in a block, you can also do it directly, like this:

    for $begin in /document/body/paragraph/run[fld/@type="begin"]
    let $end := $begin/following-sibling::run[fld/@type="end"][1]
    return string-join($begin/following-sibling::run[. << $end]/text, "")
    

    She's going back 3 ranks:

    RES

    -------------

    EXAMPLE OF A FIELD

    SAMPLE FIELD2

    SAMPLE FIELD3

  • Due date the XPath BPM 12 c

    Hi all

    Requirement:

    Set due date should she take the load of entry date and subtract a few days after the given date.

    For this purpose in human Task in time-> requested Action before, I tried to give the date of duration by using expression as: xp20:subtract - dayTimeDuration-from-dateTime(/ns0:Date,'P2D') - xp20:current-dateTime() as we know that long is the difference of two dates.

    But I got the following error:

    < faultInfo > exception.code:30046

    exception.type: ERROR

    exception. Severity: 2

    exception. Name: error in the routing slip.

    exception. Description: the expiration specified in the routing slip could not be assessed. The error is java.lang.IllegalArgumentException: NaN. The routing slip is associated with the task definition test/DuedateExpression!1.0/Humantask.

    exception. FIX: make sure that the time-out time is correct. The value must conform to the duration specification XML.

    Then I tried to give the following expression:

    xsd:DateTime(XP20:Subtract-dayTimeDuration-from-DateTime(/ns0:date,'P2D')) - xsd:dateTime (xp20:current - dateTime ()) - this phrase when it is used in XSL given duration.

    When he is still used even in Xpath expression once was an error.

    Then tried to add "xsd" namespace in the source code of human task for the routing slip that also work force.

    In the Xpath expression builder, Date functions have only dateTime functions, but the result we want is a 'life '.

    Thank you

    Tilquin.

    Hi Tilquin,

    I think that you run the same question which exists in 11g when dealing with time-outs for human tasks.

    You would think that do you might work to arrive at a period of time, but the format should be as XML to a period of time (for example, "P2DT12H8M").

    Although there is an XPath expression that works for the timer limit event activity (select the option "Hours" of the timer event and add a logic similar to this: ' xp20:add - dayTimeDuration-to-dateTime (xp20:current - dateTime (), 'PT1M') "" "), this will not work for the deadline of the task of the human.

    The only option you have is to put it in XML format for a time period when you enter a due date for a human task.  I wouldn't go with you if you said it should work, but you will not be able to subtract two date variables to the time period and you will not be able to use a data function XPath.  You simply must have a string as XML ("P2DT12H8M").

    I've heard of people trying to create this string using XSLT, but the only way I've seen this done successfully is to create the string using Java.

    Dan

  • Reg: Difference between XQuery and XPath:

    Hi Experts,

    I tried google on this subject and read a few articles but found no adequate explanation or may not be able to understand.

    Of http://stackoverflow.com/questions/924551/difference-between-xpath-xquery-and-xpointer

    In general, XPath is a language used to locate accurate XML nodes in a DOM succinctly. XQuery is a superset of XPath which also provides FLWOR sytnax, which is similar to SQL. Finally, XPointer includes XPath, but also provides a simple model to address based on the post.

    It is also a good read - what is XQuery?

    Any other pointers? According to my understanding, both are used for the XMLs, like the SQL query for relational data. But if the two are similar, what is the reasoning behind the two different technologies?


    Please share your ideas in this regard.

    Kind regards

    -Nordine

    (on Oracle 11.2.0.3.0)

    Basic functions?

    http://www.w3.org/TR/XPath/#corelib

    Typing?

    http://www.w3.org/TR/xpath20/#ID-types

    "Transforming data" - you mean CFDS on XML data, right?

    More like SQL, but there is no strict equivalence.
    Given that XML is self-descriptive language, transforming one XML document into another also means the metadata change.
    This is where the concept of XML schema.

    What language do technical FLWOR come - XQuery or XPath?

    XQuery.

    For example:
    for $i in/root/point [1] / value
    where $i/@uom = 'kg '.
    Return to {data ($i)}

    applied to this XML document:

     
        123
     

     

    will return this sequence:

    123

    Here, / root/point [1] / value is an XPath expression (which is also an XQuery expression) but the construction of FLWOR is strictly XQuery.

  • XQuery insert node and assign the value based on an XPATH expression

    Hello

    I am trying to write a function that receives an XML as input parameters and return updated XML output

    -nodes are removed from the input XML code

    -a node must be inserted and the node value must be 1 or 0, based on an XPATH expression

    I discovered how to remove nodes, I discovered how to insert a new node, but I can not set the value of the conditionally inserted node an XPATH expression.

    Here's my current procedure and below a sample of one XML of entry. I use Oracle 12 c.

    CREATE OR REPLACE FUNCTION STRIP_XML
    (
      IN_XML IN SYS.XMLTYPE
    ) RETURN SYS.XMLTYPE AS
    p_result XMLType;
    BEGIN
      select
          xmlquery(
             'declare default element namespace "http://mad.evs.com/search"; (: :)
              copy $d := .
              modify (
      delete node $d//MainCategory/@logId,
               delete node $d/MainCategory/@id,
    -- a lot more of those delete node
     -- insert a node, but the value 1 is conditional
               insert node <DMZ>1</DMZ> after $d/MainCategory/SDataSection/EventDate)
              return $d'
            passing in_xml
            returning content
            ) into p_result
            from dual;
    
    
      RETURN p_result;
    END STRIP_XML;
    

    The condition for the value of is


    HASPATH (//DigitalAssets/DigitalAsset [@ available = "true" and @videoFormatId = "11"] / VideoLocations/Videorental [@typeId = "8"]) then 1 else 0


    It is complex because DigitalAssets/DigitalAsset is a collection. Here is an example of an XML to entry



    <MainCategory xmlns="http://mad.evs.com/search" id="9" logId="3349" logType="3">
      <Name>Sport</Name>
      <Serie id="163" externalId="557">
      <TitleAKA>UCL 2006/07</TitleAKA>
      <DigitalAssets available="true" som="20:28:49:05" dur="00:02:46:04" videoDurationMinutes="3">
         <DigitalAsset available="true" som="20:28:49:05" dur="00:02:46:04" videoDurationMinutes="3" videoFormatId="3">
            <VideoLocations>
                <VideoLocation id="3" path="003349MA.mxf" typeId="1" locationId="1" priority="0"/>
                <VideoLocation id="3" path="003349MA.mxf" typeId="2" locationId="1" priority="0"/>
                <VideoLocation id="3" path="003349MA.mxf" typeId="5" locationId="1" priority="0"/>
             </VideoLocations>
          </DigitalAsset>
          <DigitalAsset available="true" som="20:28:49:05" dur="00:02:46:04" videoDurationMinutes="3" videoFormatId="11">
             <VideoLocations>
                <VideoLocation id="101" path="003349MA.mpg" typeId="1" locationId="1" priority="0"/>
                <VideoLocation id="101" path="003349MA.mpg" typeId="2" locationId="1" priority="0"/>
                <VideoLocation id="101" path="003349MA.mpg" typeId="8" locationId="1" priority="0"/>
             </VideoLocations>
          </DigitalAsset>
      </DigitalAssets>
      <SDataSection xmlns="http://mad.evs.com/search">
        <EventDate>2006-08-09</EventDate>
        <LogType>3</LogType>
      </SDataSection>
    </MainCategory>
    


    In this case, because HASPATH expression could be set to true, the value of the added node must be 1.


    Any help or advice how I should fight against that would be appreciated. I have no experience with XML and XQuery, I create my function through from trial and error of the doc.


    Thanks and regards, Pierre

    Hi Pierre,.

    You can use the if-then-else statement, like this:

    Insert the node

    {

    If ($d/MainCategory/DigitalAssets/DigitalAsset[@available="true' and @videoFormatId = '11'] / VideoLocations/Videorental [@typeId = '8'])

    then 1

    0 otherwise

    }

    After $d, MainCategory, SDataSection, EventDate

    XSLT can be an alternative to the XQuery Update in this case.

  • Navigate to the item in WYSIWIG mode after search xpath in XML mode

    Hello. I wonder if there is option or plugin in Framemaker 13, that allow to locate the xml element in WYSIWYG view give an XPath search in XML mode (or is there Xpath search in WYSIWYG mode).

    Hi nicksona,

    There is a plugin that allows an XPath search for the WYSIWYG view:

    FrameSLT - consultation Street West

    It has many additional features related to the management of the structure based on XPath. WARNING - This is my plugin.

    Russ

  • XSL Transform map failure during execution due to missing element Xpath

    Hello

    I have a case where I use a source variable which has two components. At run time, these variables can be non-existent depends on previous activities.

    The problem is the transformation XSL doesn't like it and fails with the error

    XPath expression cannot run.

    The XPath expression cannot run; the reason was: oracle.xml.parser.v2.XMLDOMException: import not allowed on nodes of type of document.

    Check the detailed origin described in the text of the exception message and verify that the XPath query is correct.

    How can I ignore for the mapping of similar transformation to affect ignoreMissingFromData activity?

    Thank you.

    Hello

    > variable source that has two components. At run time, these variables can be non-existent

    Are you talking about BPEL variables or XML elements? Can send you a sample xml?

    In any case, I think you could use getContentAsString or something like that in your XLST and causing its failure... A workaround is to use xslt:if or xslt: choose test if the element is there...

    See you soon,.

    Vlad

  • XPath provides no node

    Hi gentlemen,

    I'm having trouble reading az XML instance with Java 7 and XPath. The relevant extract from the file is:

    {code}

    <? XML version = "1.0" encoding = "ISO-8859-1? >

    < xmlns:ehd = ehd:ehd "" urn: DHM / 001 ""

    xmlns = "urn: DHM/BOM/001.

    " xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "

    ehd_version '1.30' = >

    < ehd:header >

    <!--

    ->

    < ehd:id EX = "1100" RT="1.2.276.0.76.3.1.1"/ >

    < ehd:document_type_cd V = "BOM" S = "1.2.276.0.76.5.100' DN ="Stammdatei-Datenannahmestellen"/ >

    < ehd:service_tmr V = "2006-07-01.." / >

    < ehd:origination_dttm V = "2006-05-09" / > <! - Erstellungsdatum der Datei - >

    <!--

    ->

    < ehd:provider >

    < ehd:organization >

    < ehd:id EX = "1.2.276.0.76.3.1.1" RT="1.2.276.0.76"/ >

    < ehd:organization.nm V = "Kassenärztliche Bundesvereinigung" / >

    < ehd:addr >

    < ehd:CNT V = "Deutschland" / >

    < ehd:CTY V = "Berlin" / >

    < ehd:HNR V = "2" / >

    < ehd:ZIP V = "10623" / >

    < ehd:STR V = "Herbert-Lewin-Platz" / >

    < / ehd:addr >

    " < ehd:telecom V = ' http://www.KBV.de "/ > "

    < / ehd:organization >

    < / ehd:provider >

    <!--

    ->

    < ehd:interface >

    < ehd:id EX = "19441" RT="1.2.276.0.76.5.109"/ >

    < ehd:interface.nm V = "BOM" / >

    < ehd:version V = '1.07' / >

    < / ehd:interface >

    < / ehd:header >

    < / ehd:ehd >

    {code}

    And here is the very short program to read an attribute:

    {code}

    import java.io.File;

    import java.io.FileInputStream;

    to import java.io.FileNotFoundException;

    import java.io.IOException;

    import java.io.BufferedReader;

    import java.io.FileReader;

    Import javax.xml.parsers.DocumentBuilder;

    Import javax.xml.parsers.DocumentBuilderFactory;

    Import javax.xml.parsers.ParserConfigurationException;

    Import javax.xml.xpath.XPath;

    Import javax.xml.xpath.XPathConstants;

    Import javax.xml.xpath.XPathExpression;

    Import javax.xml.xpath.XPathExpressionException;

    Import javax.xml.xpath.XPathFactory;

    Import javax.xml.namespace.NamespaceContext;

    Import org.xml.sax.InputSource;

    to import org.W3C.DOM.document;

    Import org.w3c.dom.Node;

    Import org.w3c.dom.NodeList;

    Import org.xml.sax.SAXException;

    public class xpath {}

    Public Shared Sub main (String [] args) {}

    try {}

    InputSource inputSource = new InputSource ("sdda_01.07_kbv.xml");

    DocumentBuilderFactory plant = DocumentBuilderFactory.newInstance ();

    factory.setNamespaceAware (true);

    DocumentBuilder builder = factory.newDocumentBuilder ();

    Document document = builder.parse (inputSource);

    XPath xpath is XPathFactory.newInstance () .newXPath ();.

    String expr = "/ ehd:ehd/ehd:header/ehd:id/@EX/text()";

    Result of NodeList = (NodeList) xpath.evaluate (expr, inputSource, XPathConstants.NODESET);

    for (int i = 0; i < = result.getLength (); i ++)

    System.out.println (result. Item (i) .getNodeName ());

    }

    catch (Exception e) {}

    e.printStackTrace ();

    }

    }

    }

    {code}

    The program compiles fine, but it offers zero nodes. What can be my fault? Please help if you can. The program pulled an IBM site help programmers - I've changed it according to my needs.

    Thank you in advance, best regards

    Miklós Herboly

    Thank you very much. Has been very helpful.

  • The XPath query results do not get

    Hello

    This is the xpath query and xml. Query is works well but do not fetch all results.

    Select d.

    the left outer join CALC_RUN_XML

    XMLTABLE (XmlNamespaces (DEFAULT 'http://www.cigna.com/coreops/ccmi/internal/calculation/1 http://www.cigna.com/coreops/ccmi/client/2 ','' as "ns2"), )

    "/ calculation/calculationParameters/clientSelections / ns2:client ' to CALC_RUN_XML. CALC_RUN_XML

    columns

    clientId varchar2 (100) path ' @ns2: clientId',.

    Number of account varchar2 (100) path ' @ns2: account number ',

    path of varchar2 (100) branchNumber ' @ns2: branchNumber',.

    path of varchar2 (100) benefitPlanNumber ' @ns2: benefitPlanNumber',.

    path of varchar2 (100) benefitPlanVariationId ' @ns2: benefitPlanVariationId',.

    path of varchar2 (100) benefitClassNumber ' @ns2: benefitClassNumber',.

    path of varchar2 (100) clientAccountEffectiveDate ' @ns2: clientAccountEffectiveDate',.

    path of varchar2 (100) clientAccountTerminationDate ' @ns2: clientAccountTerminationDate'

    ) d

    1 = 1

    <? XML version = "1.0" encoding = "UTF-8" standalone = 'Yes'? >

    " < calculation = xmlns:ns2 ' http://www.CIGNA.com/coreops/CCMI/client/2 "xmlns =" http://www.Cigna.com/coreops/CCMI/Internal/calculation/1 ">

    < calculationParameters rateExhibitType = paymentFrequency "CAP" = "Monthly" calculationPeriod = "02" calculationYear = "2013" retroWindow = "Standard" retroWindowAmount = "" paymentDueDate = "2014-02 - 11 T 05: 00:00.000Z" > "

    < contractRateSheetSelections >

    < contractNumber selection '891' = >

    < rateSheetIds >

    < rateSheetId > 567 < / rateSheetId >

    < / rateSheetIds >

    < / selection >

    < / contractRateSheetSelections >

    < clientSelections >

    < ns2:client clientId = accountNumber "00358430" = "00358430" branchNumber = "A001" benefitPlanNumber = "MOAP001" benefitPlanVariationId = "00003250" benefitClassNumber = "A001" clientAccountEffectiveDate = "" 2009-06 - 01 T 04: 00:00.000Z "clientAccountTerminationDate =" 2199-12 - 31 T 05: 00:00.000Z "/ >"

    < ns2:client clientId = accountNumber "00358430" = "00358430" branchNumber = "A001" benefitPlanNumber = "MOAP001" benefitPlanVariationId = "00003250" benefitClassNumber = "A001" clientAccountEffectiveDate = "" 2009-06 - 01 T 04: 00:00.000Z "clientAccountTerminationDate =" 2199-12 - 31 T 05: 00:00.000Z "/ >"

    < / clientSelections >

    < / calculationParameters >

    < runHistory >

    < run runType = 'Se MOQUER"userId ="M59056"runDescription ="satish11"runDateTime =" "2014-02 - 11 T 17: 01:28.553Z" jobExecutionId = "2064" / > "

    < / runHistory >

    < / calculation >

    Thank you

    Partha

    Hello

    XML attributes belong to no namespace, unless explicitly qualified with a prefix.

    They do not inherit from their parents namespace either.

    So, in short, remove the attributes ns2 prefixes, and it should be OK:

    clientId varchar2 (100) path "@clientId."

    Number of account varchar2 (100) path "@accountNumber."

    path of varchar2 (100) branchNumber "@branchNumber"

    path of varchar2 (100) benefitPlanNumber "@benefitPlanNumber"

    path of varchar2 (100) benefitPlanVariationId "@benefitPlanVariationId"

    path of varchar2 (100) benefitClassNumber "@benefitClassNumber"

    path of varchar2 (100) clientAccountEffectiveDate "@clientAccountEffectiveDate"

    path of varchar2 (100) clientAccountTerminationDate '@clientAccountTerminationDate '.

  • XPath error occurred when executing unit Composite SOA testing

    I get the following error message when you run a Composite Test through the Oracle Enterprise Manager console.


    The strange thing is that XPath error does not occur when the same service is started from the client application - i.e. that it works very well when AQ puts a similar message on the queue. But when I put the same message in unit test, it throws the error of XPath.


    Any idea what steps I must take to get unit testing work?

    " < compositeTest compositeDN ="InvokeODIProject"xmlns =" http://xmlns.Oracle.com/SCA/2006/test "> "

    < on / >

    < start serviceName = operation "DequeueICom" = "Dequeue" isAsync = 'true' delay 'PT0S' = >

    < message >

    < part partName = "OBJ_CARRIER_OBJECT" >

    < content >

    < OBJ_CARRIER_OBJECT xmlns = "" >

    ICOM < SYSTEM > < / SYSTEM >

    < Interface_name > invoke ODI < / interface_name >

    < INTERFACEOPERATION > feed_staging_area < / INTERFACEOPERATION >

    < INTERFACEVERSION > 1 < / INTERFACEVERSION >

    < > 212 CORRELATIONID < / CORRELATIONID >

    < EVENTTIME > 2014-01-24T 12: 02:04.000 - 0000 < / EVENTTIME >

    < ACTION NULL = "TRUE" / >

    payload of <>

    < ODIRequest >

    < ODIUsername > * < / ODIUsername >

    < ODIPassword > * < / ODIPassword >

    < WorkRepository > * < / WorkRepository >

    < ScenarioName > TRUNCATE_CLAIM_HEADER < / ScenarioName >

    < ScenarioVersion > 001 < / ScenarioVersion >

    < frame > DEV < / context >

    < synchronous > true < / synchronous >

    < Session_name > INVOKED ICOM < / session_name >

    < / ODIRequest >

    < / payload >

    < / OBJ_CARRIER_OBJECT >

    < / content >

    < / part >

    < / message >

    < / run >

    < wireActions wireSource = "ODIInvokeProcess/ODIAgent" operation = "invokeStartScen" >

    < emulate duration = "PT0S" >

    < message >

    < part partName "part1" = >

    < content >

    < OdiStartScenResponse xmlns="xmlns.oracle.com/odi/OdiInvoke/" > "

    < session xmlns = "" > 1234 < / Session >

    < / OdiStartScenResponse >

    < / content >

    < / part >

    < / message >

    < / emulate >

    < / wireActions >

    < / compositeTest >

    [2014 02-04 T 10: 55:49.261 + 00:00] [AdminServer] [ERROR] [] [oracle.integration.platform.testfwk.TestCase] [tid: Thread-88] [userId: weblogic] [ecid: df7eb0dbec7f3140:-24efc088:143f879cee2, :-8000-0000000000036050, 1:17240] [APP: soa-infra] position of promotion message failed []

    oracle.fabric.common.FabricInvocationException: faultName: {{http://schemas.oracle.com/bpel/extension} subLanguageExecutionFault}

    messageType: {{http://schemas.oracle.com/bpel/extension} RuntimeFaultMessage}

    parts: {}

    Summary = < summary > XPath expression cannot run.

    An error occurs during the processing of the XPath expression; the expression is oraext:parseXML(bpws:getVariableData('Receive_TME_OUT_Dequeue_InputVariable','OBJ_CARRIER_OBJECT','/ns3:OBJ_CARRIER_OBJECT/PAYLOAD')) / / ODIUsername.

    The XPath expression cannot run; the reason was: internal xpath error.

    Check the detailed origin described in the text of the exception message and verify that the XPath query is correct.

    < / Summary >

    code = < code > < code > XPathExecutionError}

    cause: {XPath expression cannot run.

    An error occurs during the processing of the XPath expression; the expression is oraext:parseXML(bpws:getVariableData('Receive_TME_OUT_Dequeue_InputVariable','OBJ_CARRIER_OBJECT','/ns3:OBJ_CARRIER_OBJECT/PAYLOAD')) / / ODIUsername.

    The XPath expression cannot run; the reason was: internal xpath error.

    Check the detailed origin described in the text of the exception message and verify that the XPath query is correct.

    }

    at oracle.fabric.CubeServiceEngine.post(CubeServiceEngine.java:626)

    at oracle.integration.platform.blocks.mesh.AsynchronousMessageHandler.doPost(AsynchronousMessageHandler.java:142)

    at oracle.integration.platform.blocks.mesh.MessageRouter.post(MessageRouter.java:197)

    at oracle.integration.platform.blocks.mesh.MeshImpl.post(MeshImpl.java:215)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:606)

    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)

    at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:59)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

    to com.sun.proxy. $Proxy361.post (unknown Source)

    at oracle.integration.platform.testfwk.execution.TestFwkService.launchNormalTestCase(TestFwkService.java:416)

    at oracle.integration.platform.testfwk.execution.TestFwkService.launchTestCase(TestFwkService.java:203)

    at oracle.integration.platform.testfwk.execution.TestFwkService.runTestCases(TestFwkService.java:546)

    at oracle.soa.management.internal.ejb.impl.SOATestBeanImpl.executeTestCases (SOATestBeanImpl.java:129)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    Hello

    Apparently not very well... Why it is oraext:parseXML if the content is XML already? The QA message probably has the payload in a CDATA tag...

    See you soon,.

    Vlad

Maybe you are looking for

  • Too many emails to Junk

    Mac iOS 10.7.5 1 TB of storage, 2.16 Ghz Intel Core 2 Duo Mail version: 5.5 (1283) Messaging problem It is a problem with 'known' contact e-mails end up in the junk mail. This seems to happen randomly, some do to my Inbox, this can happen at any time

  • HP Envy Pheonix 810-210: Possible POWER supply problem?

    I bought the HP Envy 810-210 a Phoenix earlier this year and recently replaced a 645 GTX graphic card a GTX 960. When I replaced it I noticed the power cord was appropriate is more good in the power supply and can fluctuate a little. Now when I move

  • Stuck!

    I'm trying to get a loop reading a string of Word to Word, I tried several different things without success. For example: Who is this-->(for loop) [converted string]--> RT Whot ist It's killing me, thanks for the help!

  • Can't send or receive

    Direct mail has worked well in recent years with Win 7. I opened it the other day and all my emails have disappeared and I could not send or receive. Went to accounts, and enter my account information such as if to create a new account and hop, I got

  • How can I get rid of the error code 0 x 80010108 when you insert the SD card

    My SD card is good and I can access images using my computer to start up. I can also see my saved photo gallary pictures. What I can't do, is when I insert the SD card and select images I get the above error message. Help.