Delete parent node based on its child node value in XML

I have an xml like this:
<UPLOAD_REQUEST>
     <CUSTOMER_DETAIL>
     <NAME>Smith</NAME>
     <AGE>20</AGE>
     <GENDER>M</GENDER>
     </CUSTOMER_DETAIL>
     <CUSTOMER_DETAIL>
     <NAME>Nikita</NAME>
     <AGE>35</AGE>
     <GENDER>F</GENDER>
     </CUSTOMER_DETAIL>
</UPLOAD_REQUEST>
I want to delete CUSTOMER_DETAIL node where name = 'nikita' from xml. Also note that there is no identification number for CUSTOMER_DETAIL node.
I was trying to do it like this:
UPDATE request_xml
SET request= deleteXML(request, '/UPLOAD_REQUEST/CUSTOMER_DETAIL')
WHERE extractvalue(request, '/UPLOAD_REQUEST/CUSTOMER_DETAIL/NAME') = 'Nikita';
It gives error "*EXTRACTVALUE returns value of only one node*"
Final output should be
<UPLOAD_REQUEST>
     <CUSTOMER_DETAIL>
     <NAME>Smith</NAME>
     <AGE>20</AGE>
     <GENDER>M</GENDER>
     </CUSTOMER_DETAIL>
</UPLOAD_REQUEST>
Can anyone please help me how to do this?
Edited by: user10446917 on May 6, 2011 3:38 AM

Add a predicate in the XPath expression :
UPDATE request_xml
SET request = deleteXML(request, '/UPLOAD_REQUEST/CUSTOMER_DETAIL[NAME="Nikita"]')
;

Similar Messages

  • I want to delete parent record so that its child is automatically deleted

    Hi Gurus , i was trying to delete the child record as soon as parent is deleted.
    How do we do that?
    I can delete child 1st but it seems that there are lots of child data in different table.
    I have heard 'on delete cascade ' does that.
    Can you please help me out how to use that in delete statement???

    You should change your relationship to on delete = cascade. For example:
    alter table tb2 drop constraint fk;
    alter table tb2 add constraint fk foreign key (n) references tb1(n) on delete cascade;
    When you delete father table, will be deleted all children that have relationship like delete cascade.

  • How to avoid the selection of a Parent node and its child node at a time?

    Example:
    consider the below JTree.
    Parent1
    ---->Parent2
    -------->Child3
    Parent3
    ---->Parent4
    My requirement :
    Parent1 and Parent3 can be selected at a time(using ctrl keys)
    Parent2 and Parent4 can be selected at a time
    Parent1 and Parent2 should not allowed to select at a time.
    In general : A parent and any of its child should not be selected at a time.
    How to achieve this? Anyone please help me.

    Thanikai wrote:
    I am very sorry.Whatever for? It's a valid question.
    How do i implement a custom TreeSelectionModel?I would start by going through the source of DefaultTreeSelectionModel so see how the default selection is handled. Also probably check out JTree.EmptySelectionModel to see how selection is prevented.
    Which methods to override?Methods in the class you choose to extend, obviously. But before that you need to firm up certain design decisions: if a parent node is selected and the user attempts to select one of its child nodes, do you select the child and deselect the parent or do nothing/ and vice versa.
    etc.... may form the basis for a future, more specific question accompanied by a [_SSCCE_|http://mindprod.com/jgloss/sscce.html].
    luck, db

  • FTREE_NODE: Find parent node which has no child nodes

    Hi guys
    Does anybody know how to find a parent node which has no child node(s)?
    I couldn't find any build-in at the online help. Is there a trick to got this?
    Thanks in advance
    Remo

    Hi Remo,
    I misspoke, in my earlier post. The FTREE built-in has defined constants for the possible values that FTREE.NODE_STATE can have -- FTREE.COLLAPSED, FTREE.EXPANDED and FTREE.LEAF_NODE.
    If you wish, rather than testing for a value of '0', you can instead test for a value of FTREE.LEAF_NODE. Both are functionally identical, but using the constants can improve the readability of your code, eliminating the need for additional comments.
    Eric

  • HOw to get parent node name value through its child node?

    Hi,
    Experts,
    I am able to get child node name values but according to attribute name value i want to  get its parent name value how to achieve that. For that i have used If_Ixml_element->Get_parent. Please pass some idea on it.
    Thanks in advance,
    Shabeer ahmed.

    Hello Shabeer
    I think the coding should be straightforward:
    DATA: lo_element   TYPE REF TO if_ixml_element,
              lo_child        TYPE REF TO if_ixml_node,
              lo_parent      TYPE REF TO if_ixml_node.
    " NOTE: LO_ELEMENT holds your child node
      lo_child ?= lo_element.
      lo_parent = lo_child->get_parent( ).
    Regards
      Uwe

  • How to access a nested child tag values in  XML Object(getting error:No Such variable)

    Hi,
    I could see the XML object data and while accessing a perticular attribute let say "SlotA"  it is showing "No such variable Error".
    I appreciate any of your  inputs or suggestions to solve this error.
    You can find the screen snapshot of the problem as part of the attachment here.
    Thanks in advance
    CSNPrasad.

    Dear Natasha,
    Thanks for your mails & cooperation as well.
    This time i  have added the trace() and can see the value.Now the problem is "can't access a property or method of a null object reference"
    Noe: This code mxml file is called at Runtime based on the data defined in the XMLSocket data.
    I need to display Remote devices like davice1,device2 device3 etc. these are added/delete at any time ,so we need to show same changes in UI at Runtime.
    I implemented Polymorphism concept to construct the device object at runtime like follows
    var device:Object;
    for each (var deviceData:XML indeviceListXML..Device)
                        device = getBatteryBay(deviceData.deviceId)
                        // If device already exists with the deviceId, update the details
                        // Else create a newdevice and add it to the container for displaying it.
                                                                                    if (device == null)
                            if (device.Type == "DEVICE1")
                                device = new Device1();
                            else if (device.Type == "DEVICE2")
                            device = new Device2();
                            else
                                device = new DefaultDevice();
                            device.id = deviceData.deviceId;
                          device.name = deviceData.devicename;
                         device.setData(deviceData);
    Here new Device1(); and new Device2() are the UIComponents and created at Runtime, upto here no problem to display, when i try to setData to the devices it is throwing error
    "can't access a property or method of a null object reference". because Device1 and Device2 has Child components like "DataIndicator" and need to set properties to these components which are not created yet.
    I appreciate any of your Input or suggestions at the earliest
    Thanks in Advance
    Regards

  • Context Mapping: child-nodes of non-mapped parent nodes

    I am somewhat curious about Context Mapping in WebDynpro.
    Which parents nodes need to be mapped in order to map child nodes ? Does a child node has more than one parent node (e.g. grandparent - two steps above) ?
    A.1  -
    MAPPED----
    >    B.1
      - A1.1   NOT MAPPED
      - A1.2   NOT MAPPED
            - A.1.2.1     MAPPED TO>    B.1.2.4
            - A.1.2.2   NOT MAPPED
      - A1.3   NOT MAPPED
    Is it sufficient that only one of these parent nodes (e.g. direct parent node not mapped, but parent node of this parent node is mapped) need to be mapped so that the child node can be mapped ?
    Is this assumption true or not ?
    The SAP library states:
    "Conversely, child nodes of non-mapped parent nodes cannot be mapped, otherwise this would result in irresolvable conflicts at runtime with respect to the parent-child relation in the context and the mapping relation." (http://help.sap.com/saphelp_nw04/helpdata/de/51/a3384162316532e10000000a1550b0/content.htm)
    This statement is not absolutely clear on this issue.

    Let me put it this way
    You have a node vehicle and you have a child node for that the car. The car node have parameters car1, car2.
    Let the vehicle node have parameters veh1 and veh2
    Then if you map vehicle node one to any other node (say in the comp. controller) you have the option of mapping its children i.e veh1,veh2 and carnode.
    You can have that veh1 is mapped and veh2 is not mapped.
    vehicle node(mapped)
    veh1(may or may not be mapped)
    veh2(may or may not be mapped)
    car node(may or may not be mapped)
    If instead you try to map only the car node the vehicle node will also get mapped automatically but not it's child parameters like veh1 and veh2.
    vehicle node(mapped)
    veh1(may or may not be mapped)
    veh2(may or may not be mapped)
    car nodemapped)
    car1(may or may not be mapped)
    car2(may or may not be mapped)
    Hope this would help.
    Do revert for further clarification
    Regards
    Noufal

  • Delete a node containing a child node with specific value

    Hello,
    I wanted to know how to delete a node which contains specific value in one of its child node.
    Here is the xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <rows>
         <ROW>
              <part_num_ref ID="100124">1</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">2</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">3</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">4</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">5</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">6</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">7</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">8</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">9</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">10</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">11</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">12</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">13</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">14</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">15</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">16</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
         <ROW>
              <part_num_ref ID="100124">17</part_num_ref>
              <part_sht_nam_ref ID="100125">0</part_sht_nam_ref>
              <part_country ID="100026">0</part_country>
              <tot_cost__rtd ID="102281">0</tot_cost__rtd>
              <tot_cost__demo ID="102282">0</tot_cost__demo>
              <tot_cost__tra ID="102283">0</tot_cost__tra>
              <tot_cost__coor ID="102284">0</tot_cost__coor>
              <tot_cost__sprt ID="102285">0</tot_cost__sprt>
              <tot_cost__mng ID="102286">0</tot_cost__mng>
              <tot_cost__oth ID="102287">0</tot_cost__oth>
              <tot_cost ID="100135">0</tot_cost>
              <tot_rcpt ID="102016">0</tot_rcpt>
              <tot_grant ID="100136">0</tot_grant>
         </ROW>
    </rows>
    I would like to delete one of the node <ROW> which contains the value 1 for the child node <part_num_ref >
    Is it possible?
    Thanks in advance for your answers.
    Regards,
    Stessy Delcroix

    The following is a possibility on database version 10.2.x (what database version are you using?):
    Example from XMLDB Developers Guide 10.2
    Example 4-26 Deleting LineItem Element Number 222
    SELECT extract(OBJECT_VALUE,
                   '/PurchaseOrder/LineItems/LineItem[@ItemNumber="222"]')
      FROM purchaseorder
      WHERE existsNode(OBJECT_VALUE,
                       '/PurchaseOrder[Reference="AMCEWEN-20021009123336171PDT"]')
            = 1;
    EXTRACT(OBJECT_VALUE,'/PURCHASEORDER/LINEITEMS/LINEITEM[@ITEMNUMBER="222"]')
    <LineItem ItemNumber="222">
      <Description>The Harder They Come</Description>
      <Part Id="953562951413" UnitPrice="22.95" Quantity="1"/>
    </LineItem>
    1 row selected.
    UPDATE purchaseorder
      SET OBJECT_VALUE =
          deleteXML(OBJECT_VALUE,
                    '/PurchaseOrder/LineItems/LineItem[@ItemNumber="222"]')
      WHERE existsNode(OBJECT_VALUE,
                       '/PurchaseOrder[Reference="AMCEWEN-20021009123336171PDT"]')
            = 1;
    SELECT extract(OBJECT_VALUE,
                   '/PurchaseOrder/LineItems/LineItem[@ItemNumber="222"]')
      FROM purchaseorder
      WHERE existsNode(OBJECT_VALUE,
                       '/PurchaseOrder[Reference="AMCEWEN-20021009123336171PDT"]')
            = 1;
    EXTRACT(OBJECT_VALUE,'/PURCHASEORDER/LINEITEMS/LINEITEM[@ITEMNUMBER="222"]')
    1 row selected.

  • Parent nodes have themselves as childs, in contrast to BW hierarchy

    Hello Gurus,
    I have a problem concerning hierarchies and grouping in CR2008.
    Inserting the hierarchy works fine, but here's the problem:
    Every parent node has itself as child node, i.e. the hierarchy shown is:
    1
    1.1
    1.2
    1.2.2
    1.2.3
    instead of the correct:
    1
    1.2
    1.2.3
    That even occurs when I just include the Node ID, without any grouping and hierarchy settings.
    Such behaviour is undesirable for my purpose, so how can I make Crystal Reports behave like I expect/want? I am completely confused where these additional nodes are originating, as they are definitely not defined in the BW hierarchy. Therefore I suspect the problem somewhere in Crystal, although I have no actual evidence supporting this...
    Has anyone an idea how to solve that problem? I have crawled through SDN and unfortunately wasn't able to find a solution...
    Thanks!

    Hi Ingo,
    first I'd like to apologize for the late reply, I was very busy with another project during the last weeks.
    It seems to be the bookable nodes setting in the query, at least only such parent nodes are affected that have data posted to themselves. Obviously, the actual parent node as shown in Crystal is the one with data aggregated by Crystal and the child node is the one with the data that was posted to the node.
    I'll try to find some free time during the remainder of the week for further investigation and provide additional feedback.
    Thanks for your help so far!

  • Parent node showing in schema when child nodes not present

    I had several folks answer my questions on mapping from a flat file to an EDI 835 schema and I am down to just a couple of issues before I finish up. I have a conditional mapping issue that I have to solve before I can map the rest of the document. I am
    mapping three fields in a single non-repeating line in the flat file to a repeating segment in the 835. Basically I need to create a separate AMT_ClaimSupplementalInformation segment for each field in the flat file line. As you can see in the picture
    below I want to create a AMT_ClaimSupplementalInformation segment for CDISCOUNT, CINELIGIBLE and CALLOWED.
    You can see I have quite a bit of conditional logic attached to the three fields, but I have all three connected via a loop to the AMT_ClaimSupplementalInformation parent. I cannot attach the loop to the parent of the three fields because it only appears
    once in the file. And if I leave the loop out the AMT segments get stacked funny, like this:
    <AMT_ClaimSupplementalInformation>
    AMT1
    AMT1
    AMT2
    AMT2
    </AMT_ClaimSupplementalInformation>
    You can see how they should be stacked in the next pic.
    In some cases however, one of those fields may be blank so I will not need to create a AMT_ClaimSupplementalInformation segment for it. I was able to use some conditional mapping ideas you guys gave me using the Not-Equal and Value Mapping functoids, and
    that works great to keep blank child nodes from being created. However, Since I have a loop attached to the AMT_ClaimSupplementalInformation parent node it still creates an empty parent node even when the child nodes are not created. See the empty parent
    node in the pic below.
    Since looping functoids can only be attached to links I don't know how to make the parent node conditional.
    Any suggestions?
    Thanks.

    Boatseller, thanks for the tip. I did end up going the XSLT direction. It's a bit of a hack, but I'm using the following XSLT to eliminate empty nodes :
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="@*|node()">
            <xsl:if test=". != ''">
                <xsl:copy>
                    <xsl:apply-templates select="@*|node()"/>
                </xsl:copy>
            </xsl:if>
        </xsl:template>
    </xsl:stylesheet>
    I created a new map with the 835 schema on each side. I then created an XSLT file and pointed to it in the Custom XSLT Path property. It seems to work well. I call this map right after my FlatFile_To_835 map.
    I was hoping to use the scripting functoid with inline XSLT in the map so that I didn't have to worry about deploying the XSLT file(just another thing to keep up with in the future), but when I compile it I get the following error:
    The "Scripting" functoid has 1 input parameter(s), but 2 parameter(s) are expected.
    I'm wondering if I'm connecting the schemas incorrectly in the map:
    In any case, I'm past the empty nodes issue for now, which was a big roadblock. Now I have to deal with the CAS segments which are, as you said, a real pain. 
    Thanks for all of your input.

  • XML E4X Select nodes based on child node attribute.

    Hey,
    I am trying to make a selection on following XML.
    I want to retrieve a list of the variable node when its child nodes metadata attribute "name" is not equal to "transient". I have read through the documentation but have not been able to solve this and it should be rather simple. So far I have tried with something like.
    var variables:XMLList = classInfo.variable.(metadata.(@name != "transient"));
    var variables:XMLList = classInfo.variable.(metadata.@name != "transient");
    But it returns all variable nodes.
    <type name="com.sca.dataModel::PresentationDataEntity" base="com.sca.dataModel::BaseEntity" isDynamic="false" isFinal="false" isStatic="false">
      <extendsClass type="com.sca.dataModel::BaseEntity"/>
      <extendsClass type="Object"/>
      <variable name="subtitle" type="String">
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
          <arg key="pos" value="128"/>
        </metadata>
      </variable>
      <variable name="id" type="Number">
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
          <arg key="pos" value="153"/>
        </metadata>
      </variable>
      <variable name="tableName" type="String">
        <metadata name="transient"/>
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
          <arg key="pos" value="118"/>
        </metadata>
      </variable>
      <variable name="db_SortAsc" type="Boolean">
        <metadata name="transient"/>
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
          <arg key="pos" value="281"/>
        </metadata>
      </variable>
      <variable name="title" type="String">
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
          <arg key="pos" value="100"/>
        </metadata>
      </variable>
      <method name="setData" declaredBy="com.sca.dataModel::BaseEntity" returnType="*">
        <parameter index="1" type="Object" optional="false"/>
        <metadata name="__go_to_definition_help">
          <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/>
          <arg key="pos" value="330"/>
        </metadata>
      </method>
      <metadata name="__go_to_ctor_definition_help">
        <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
        <arg key="pos" value="167"/>
      </metadata>
      <metadata name="__go_to_definition_help">
        <arg key="file" value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/>
        <arg key="pos" value="42"/>
      </metadata>
    </type>

    Perfect, that worked!
    Thanks.
    Jonas

  • Regarding : Creation of child nodes in a outlinefield

    Hi,
    I am facing a few problems in creating a child node. I read elements from an array to populate the outline field. The array has exact definitions as to what should be a parent and child respectively. While I am able to create nodes at the parent level, I am unable to create child nodes for any parent. I discovered that the value for the parent node is getting lost. I have tried to use some of the methods to arrive at the parent node, but to no anvil. Could some one suggest how exactly to get the value of the parent node so that the child node can be assigned to the parent.
    Thanks In advance.
    Balasubramaniam Sures
    [email protected]
    P.S : I have seen the examples Simple Outline field and File Browser. No clues from here.

    I take it that you are traversing through the array and loading each
    element into the OutlineField. At the risk of stating the obvious, for
    each element you must also identify it's parent. This is necessary to
    set the relationship from the child to the parent or vise versa.
    If you are already doing this and are still having difficulty, the
    problem may be as simple as setting the IsFolder property of the parent
    node. Unless this is done, it's child nodes will not be visible.
    Van Vuong
    Lead Technical Analyst
    Office: 972.985.5289
    VoiceNow: 972.330.0822
    Internet: [email protected]
    PAGE NET
    From: bala[SMTP:[email protected]]
    Sent: Friday, October 03, 1997 12:32 PM
    To: '[email protected]'
    Subject: Regarding : Creation of child nodes in a outline field
    Hi,
    I am facing a few problems in creating a child node. I read elements from an
    array to populate the outline field. The array has exact definitions as to
    what should be a parent and child respectively. While I am able to create
    nodes at the parent level, I am unable to create child nodes for any parent.
    I discovered that the value for the parent node is getting lost. I have
    tried to use some of the methods to arrive at the parent node, but to no
    anvil. Could some one suggest how exactly to get the value of the parent node
    so that the child node can be assigned to the parent.
    Thanks In advance.
    Balasubramaniam Sures
    [email protected]
    P.S : I have seen the examples Simple Outline field and File Browser. No
    clues from here.

  • Need to chart attribute value of just one child node of XML document

    I have a XML document with (for example) 7 parent nodes, each
    parent node has 5 child nodes. The parent nodes have an attribute
    @EarlierDTS (DateTime type) that is the x-axis category of a chart.
    Each child node has an attribute @eventid which specifies the id of
    the event, and another atttribute @NumOccurs which specifies how
    many times that event occured in that period.
    How do I tell Flex I want a simple line chart of the eventID
    = 215? What if I want two lines, for both eventID=215 and
    eventid=307?
    I have studied the posts and blogs for over a week now, and
    have seen this question or similar come up quite a few places, with
    no answer.
    1) Should I focus on learning how to create a filterfunction
    for the XMLList that underlies my XMLListCollection so that the
    filtered data view is just one child node per parent node ( or two
    child nodes for the second case)? And set the filtered data view as
    the dataprovider of my chart's vertical series?
    2) Should I focus on learning how to create a XML Filter
    query that selects just one or two child nodes for each parent
    node, and set the charts' series' dataprovider to this filter
    expression? (I don't think this is allowed - but I'm checking with
    the forum members...)
    3) Should I focus on learning how to convert the
    XMLListCollection into a HierarchicalData object, and then learning
    how to filter this object so there is only one (or two) childs per
    parent? This seems like a lot of coding - I almost have to create a
    pair of classes - one for the parent and one for the child - so I
    can create nested ArrayObjects.
    4) Should I create a brand new XMLList by walking the
    original XML list, and inserting Parent nodes and just the child
    nodes that match the eventID(s) I want to chart, into the new
    XMLList?
    I believe that the easiest way would be to create a
    Filterfunction for the XMLList, and bind the chart series to the
    (filtered) XML List. But the problem with this approach is that I
    have seen more than 2 posts asking how to accomplish filtering that
    removes specific children from the view, with no solutions posted.
    Help! What is the best way to get just one child for each
    parent, from an XMLList?

    "whertzing" <[email protected]> wrote in
    message
    news:[email protected]...
    >I have a XML document with (for example) 7 parent nodes,
    each parent node
    >has 5
    > child nodes. The parent nodes have an attribute
    @EarlierDTS (DateTime
    > type)
    > that is the x-axis category of a chart. Each child node
    has an attribute
    > @eventid which specifies the id of the event, and
    another atttribute
    > @NumOccurs
    > which specifies how many times that event occured in
    that period.
    >
    > How do I tell Flex I want a simple line chart of the
    eventID = 215? What
    > if I
    > want two lines, for both eventID=215 and eventid=307?
    >
    > I have studied the posts and blogs for over a week now,
    and have seen this
    > question or similar come up quite a few places, with no
    answer.
    >
    > 1) Should I focus on learning how to create a
    filterfunction for the
    > XMLList
    > that underlies my XMLListCollection so that the filtered
    data view is just
    > one
    > child node per parent node ( or two child nodes for the
    second case)? And
    > set
    > the filtered data view as the dataprovider of my chart's
    vertical series?
    >
    > 2) Should I focus on learning how to create a XML Filter
    query that
    > selects
    > just one or two child nodes for each parent node, and
    set the charts'
    > series'
    > dataprovider to this filter expression? (I don't think
    this is allowed -
    > but
    > I'm checking with the forum members...)
    >
    > 3) Should I focus on learning how to convert the
    XMLListCollection into a
    > HierarchicalData object, and then learning how to filter
    this object so
    > there
    > is only one (or two) childs per parent? This seems like
    a lot of coding -
    > I
    > almost have to create a pair of classes - one for the
    parent and one for
    > the
    > child - so I can create nested ArrayObjects.
    >
    > 4) Should I create a brand new XMLList by walking the
    original XML list,
    > and
    > inserting Parent nodes and just the child nodes that
    match the eventID(s)
    > I
    > want to chart, into the new XMLList?
    >
    > I believe that the easiest way would be to create a
    Filterfunction for the
    > XMLList, and bind the chart series to the (filtered) XML
    List. But the
    > problem
    > with this approach is that I have seen more than 2 posts
    asking how to
    > accomplish filtering that removes specific children from
    the view, with no
    > solutions posted.
    >
    > Help! What is the best way to get just one child for
    each parent, from an
    > XMLList?
    I'd just look at a dataFunction. There's an example here that
    may point you
    in the right direction:
    http://flexdiary.blogspot.com/2008/08/charting-example.html
    HTH;
    Amy

  • RE: Regarding : Creation of child nodes in a outlinefield

    Hi, Balasubramaniam:
    Try to set the isFolder attribute of your parent display node to TRUE.
    This may solve your problem. Also, check isFilled attribute of display
    node, you might find the answer.
    Hope this helps.
    Tien Wang
    Indus Consultancy Services
    http://www.indcon.com
    Phone 201.261.3100 x233
    Fax 201.261.1399
    E-mail : [email protected]
    -----Original Message-----
    From: owner-forte-users [SMTP:[email protected]]
    Sent: Friday, October 03, 1997 5:32 PM
    To: '[email protected]'
    Subject: Regarding : Creation of child nodes in a outline field
    Hi,
    I am facing a few problems in creating a child node. I read elements =
    from an array to populate the outline field. The array has exact =
    definitions as to what should be a parent and child respectively. While =
    I am able to create nodes at the parent level, I am unable to create =
    child nodes for any parent. I discovered that the value for the parent =
    node is getting lost. I have tried to use some of the methods to arrive
    =
    at the parent node, but to no anvil. Could some one suggest how exactly =
    to get the value of the parent node so that the child node can be =
    assigned to the parent.
    Thanks In advance.
    Balasubramaniam Sures
    [email protected]
    P.S : I have seen the examples Simple Outline field and File Browser. No
    =
    clues from here.

    I take it that you are traversing through the array and loading each
    element into the OutlineField. At the risk of stating the obvious, for
    each element you must also identify it's parent. This is necessary to
    set the relationship from the child to the parent or vise versa.
    If you are already doing this and are still having difficulty, the
    problem may be as simple as setting the IsFolder property of the parent
    node. Unless this is done, it's child nodes will not be visible.
    Van Vuong
    Lead Technical Analyst
    Office: 972.985.5289
    VoiceNow: 972.330.0822
    Internet: [email protected]
    PAGE NET
    From: bala[SMTP:[email protected]]
    Sent: Friday, October 03, 1997 12:32 PM
    To: '[email protected]'
    Subject: Regarding : Creation of child nodes in a outline field
    Hi,
    I am facing a few problems in creating a child node. I read elements from an
    array to populate the outline field. The array has exact definitions as to
    what should be a parent and child respectively. While I am able to create
    nodes at the parent level, I am unable to create child nodes for any parent.
    I discovered that the value for the parent node is getting lost. I have
    tried to use some of the methods to arrive at the parent node, but to no
    anvil. Could some one suggest how exactly to get the value of the parent node
    so that the child node can be assigned to the parent.
    Thanks In advance.
    Balasubramaniam Sures
    [email protected]
    P.S : I have seen the examples Simple Outline field and File Browser. No
    clues from here.

  • Hierarchy node not displaying some of child nodes

    Hi all,
    In my bex query for one of the hierarchy node  is not showing sum of its child nodes even though the belownodes got some data in it.
    What could be the reason.as all the other nodes at the same level are showing the sum of their child nodes.
    Thanks

    Display as hierarchy : no sum on node level.
    If the rows are set as u2018display as hierarchyu2019, all the objects in the rows section must have as setting for result rows : u2018always displayu2019

Maybe you are looking for