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
Similar Messages
-
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 -
Is it possible to put two different colors in tree parent
node background and child nodes background?
Any help will be very helpful.
ThanksHi PanosE,
Yes, you can set up another Standard Edition Server in child domain and then deploy pool pairing.
You need to deploy a new Front End Pool for the new Standard Edition Server.
A similar case for your reference.
https://social.technet.microsoft.com/Forums/office/en-US/eca4299c-8edb-481e-b328-c7deba2a79ba/lync-2013-standard-edition-lync-fe-pools-in-multiple-domain-single-forest-senario?forum=lyncdeploy
Best regards,
Eric
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected] -
Update xml column by inserting any missing child nodes from a M_V
Hello all,
I am trying to update a xml column(col1) of a table (abc) by looping through, by selecting from a materialized view and find any missing (child) nodes in the existing table (abc) of a xml column (col1) on each rows, and then do update the xml column (col1) of table (abc). How to do this in Oracle pl/sql?.
Thanks & Regards,
JoshYou do not need stored procedure for that. Use something like APPENDCHILDXML, INSERTCHILDXML or INSERTXMLBEFORE. For example, to insert a node into XML document:
SELECT APPENDCHILDXML(
XMLTYPE(
CURSOR(
SELECT ENAME,
SAL
FROM EMP
WHERE DEPTNO = 10
'//ROW',
XMLTYPE('<ROW><ENAME>user631757</ENAME><SAL>10000</SAL></ROW>')
) EMP_XML
FROM DUAL
EMP_XML
<?xml version="1.0"?><ROWSET><ROW><ENAME>CLARK</ENAME><SAL>2450</SAL><ROW><ENAME
user631757</ENAME><SAL>10000</SAL></ROW></ROW><ROW><ENAME>KING</ENAME><SAL>5000</SAL><ROW><ENAME>user631757</ENAME><SAL>10000</SAL></ROW></ROW><ROW><ENAME>MILL
ER</ENAME><SAL>1300</SAL><ROW><ENAME>user631757</ENAME><SAL>10000</SAL></ROW></R
OW></ROWSET>
SELECT INSERTXMLBEFORE(
XMLTYPE(
CURSOR(
SELECT ENAME,
SAL
FROM EMP
WHERE DEPTNO = 10
'//ROW[ENAME="KING"]',
XMLTYPE('<ROW><ENAME>user631757</ENAME><SAL>10000</SAL></ROW>')
) EMP_XML
FROM DUAL
EMP_XML
<?xml version="1.0"?><ROWSET><ROW><ENAME>CLARK</ENAME><SAL>2450</SAL></ROW><ROW>
<ENAME>user631757</ENAME><SAL>10000</SAL></ROW><ROW><ENAME>KING</ENAME><SAL>5000
</SAL></ROW><ROW><ENAME>MILLER</ENAME><SAL>1300</SAL></ROW></ROWSET>
SQL> SY. -
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 DelcroixThe 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. -
How to find out if a NODE has any CHILD NODES in a hierarchical tree?
I want to find out programmatically if a node in a tree has CHILDREN.
My requirement is this: I want to only show nodes for which the user has permission to execute the program that node is associated with.
Problem is, my tree population query will not show the child nodes, BUT the sub-menu nodes are displayed and I need to get rid of these nodes.
There is a function to find out the PARENT of a tree node (FTree.Get_Tree_Node_Parent), but noting to find out if children exist for a node or not?
What I thought of was to display the tree and then traverse it from the ROOT onwards and then if a NODE is a submenu node (I can find this out by checking the PROGRAM value. If this is NULL it is a sub-menu node) and IF IT HAS NO CHILD NODES then I can delete the node.Please provide the examples with DATA
as far as i know we cannot get the Child Nodes but NODE's Parents we can get
parent_node := Ftree.Get_Tree_Node_Parent(htree, :SYSTEM.TRIGGER_NODE);I faced the similar problem but i solved it with query.
Provide the data and your Tree query then we can help -
DMEE : how to make parent node disappear when child node is empty
Hi Friends ,
Currently i am working on DMEE , I have a problem . When Child node is empty I donot want the parent node to appear in the tree.Here I am uisng a field via exit function module for childnode. so not a fpay* strucutre field to write a condition.
Is there any other way for this ?
Please help.
KomaravoluI'm not sure if this can be done in DMEE tree, but there is BADI DMEE_BADI_01 that can be implemented to perform any kind of postprocessing right before the file is created. I used it, for example, to replace separators with tabs. I believe this can also be used to eliminate the unneeded nodes.
-
How to get Parent nodes and corresponding child nodes in BI Hierarchy
Hi all,
I have a standard function module 'RSNDI_SHIE_STRUCTURE_GET3' to get child node if i pass parent node. But I need child nodes along with the provided parent node as I use this in a loop in BI.
ThanksCould any one help me in this regards .
Thanks in advance
Regards,
sri -
Can we call singleton node as a child node?
Hi all, after reading the links i am not that much clear what i ahve understand is that non singleton node means parentnode? and singleton node means child node? but i want to know if i create two nodes emp and dept and emp node i will make as a singleton and dept will be normal then how the relationship
malcolmmc wrote:
BigDaddyLoveHandles wrote:
Rather than building a better mouse trap, why not ditch the singleton? It's a bad design choice.The alternative tends to be having some global configuration block which gets propagated to just about every object on the system. You can hide it behind stuff like JNDI contexts etc. but these aren't really more "pure OOP" than singletons.Yah pays yer money and takes yer chances. I like the Spring approach. No JNDI there, and while I didn't bring up OOPurity, it seems purer to me. It's easy to get rid of a Singleton and replace it with either an implementing object or a test mock. Sw33t. -
Select node based on another node
Hello - If I have XML code such as:
<ROWSET>
−<ROW>
<AREA>AAA</AREA>
<ACTIVITY>ACTIVE</ACTIVITY>
<TOTAL>4</TOTAL>
</ROW>
−<ROW>
<AREA>AAA</AREA>
<ACTIVITY>NOTACTIVE</ACTIVITY>
<TOTAL>1</TOTAL>
</ROW>
−<ROW>
<AREA>AAA</AREA>
<ACTIVITY>INOP</ACTIVITY>
<TOTAL>2</TOTAL>
</ROW>
−<ROW>
<AREA>BBB</AREA>
<ACTIVITY>NOTACTIVE</ACTIVITY>
<TOTAL>20</TOTAL>
</ROW>
−<ROW>
<AREA>BBB</AREA>
<ACTIVITY>OFFLINE</ACTIVITY>
<TOTAL>2</TOTAL>
</ROW>
−<ROW>
<AREA>BBB</AREA>
<ACTIVITY>INOP</ACT_LEVEL>
<TOTAL>32</TOTAL>
</ROW>
−<ROW>
<AREA>CCC</AREA>
<ACTIVITY>ACTIVE</ACTIVITY>
<TOTAL>2</TOTAL>
</ROW>
−<ROW>
<AREA>CCC</AREA>
<ACTIVITY>INOP</ACTIVITY>
<TOTAL>2</TOTAL>
</ROW>
</ROWSET>
How can I retrieve the TOTAL data based on the value of ACTIVITY?
Can I use something like:
<RowData>
<xsl:for-each-group select=".//ROW" group-by="AREA" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<Cell>
<xsl:if test="count(current-group()/ACTIVITY[.='INOP'])">
<xsl:value-of select="???????????????)" />
</xsl:if>
</Cell>
</xsl:for-each-group>
</RowData>I knew this would be ridiculously easy for a smart person out there. The final answer turned out to be:
<RowData>
<xsl:for-each-group select=".//ROW" group-by="AREA"xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<Cell>
<xsl:if test="current-group()/ACTIVITY[.='OFFLINE']">
<xsl:value-of select="current-group()[./ACTIVITY='OFFLINE']/TOTAL" />
</xsl:if>
</Cell>
</xsl:for-each-group>
</RowData>
I wasn't looking to sum the TOTAL values (I didn't explain myself well), I was looking to grab the individual value from the TOTAL node (I think I'm saying that right) based on what the value was in the ACTIVITY node - in this case, OFFLINE.
I did try the "current-group()/TOTAL" but that just gave me the first TOTAL value, which in my example, would have been 20 from NOTACTIVE node. -
How to select data with multiple child nodes
We have the following data:
me table ei table
m1 e1
m1 e2
m1 e3
m1 e4
m2 e5
m2 e6
m3 e7
m3 e8
I would like to display them as:
m1 e1
e2
e3
e4
m2 e5
e6
m3 e7
e8
How to best do this with sql?
I would like to produce this list with sql and then transform it to xml.
Thanks.Since you did not use tags it is not clear what results should be:
SQL> WITH TBL AS (
2 SELECT 'm1' me, 'e1' ei FROM DUAL UNION ALL
3 SELECT 'm1' me, 'e2' ei FROM DUAL UNION ALL
4 SELECT 'm1' me, 'e3' ei FROM DUAL UNION ALL
5 SELECT 'm1' me, 'e4' ei FROM DUAL UNION ALL
6 SELECT 'm2' me, 'e5' ei FROM DUAL UNION ALL
7 SELECT 'm2' me, 'e6' ei FROM DUAL UNION ALL
8 SELECT 'm3' me, 'e7' ei FROM DUAL UNION ALL
9 SELECT 'm3' me, 'e8' ei FROM DUAL
10 )
11 SELECT CASE ROW_NUMBER() OVER(PARTITION BY ME ORDER BY EI) WHEN 1 THEN ME ELSE NULL END ME,
12 EI
13 FROM TBL
14 ORDER BY TBL.ME,
15 TBL.EI
16 /
ME EI
m1 e1
e2
e3
e4
m2 e5
e6
m3 e7
e8
8 rows selected.or
SQL> WITH TBL AS (
2 SELECT 'm1' me, 'e1' ei FROM DUAL UNION ALL
3 SELECT 'm1' me, 'e2' ei FROM DUAL UNION ALL
4 SELECT 'm1' me, 'e3' ei FROM DUAL UNION ALL
5 SELECT 'm1' me, 'e4' ei FROM DUAL UNION ALL
6 SELECT 'm2' me, 'e5' ei FROM DUAL UNION ALL
7 SELECT 'm2' me, 'e6' ei FROM DUAL UNION ALL
8 SELECT 'm3' me, 'e7' ei FROM DUAL UNION ALL
9 SELECT 'm3' me, 'e8' ei FROM DUAL
10 )
11 SELECT CASE ROW_NUMBER() OVER(PARTITION BY ME ORDER BY EI) WHEN 1 THEN ME ELSE EI END ME,
12 CASE ROW_NUMBER() OVER(PARTITION BY ME ORDER BY EI) WHEN 1 THEN EI ELSE NULL END EI
13 FROM TBL
14 ORDER BY TBL.ME,
15 TBL.EI
16 /
ME EI
m1 e1
e2
e3
e4
m2 e5
e6
m3 e7
e8
8 rows selected.
SQL>
SY. -
How to generate parent node id and child node id from xmltable ?
Hi All, Below is a part of the xml data which is loaded in a table. I need help in generating the parent id for compensationReference say for the first occurence of compensationReference node it should be 1 and for subsequent nodes 2,3,4,.. Can some one please help me in getting this done using a sql query ?? VID 9100000013890660 ACN 5924112896 VID 9100000013890678 ACN 5924112896 VID 9100000013890611 ACN 5924112896 VID 9100000013890645 ACN 5924112896 Thanks, Bhaskar
that doesn't look like XML data to me.
Please post some correct example data and expected output as described in the FAQ: Re: 2. How do I ask a question on the forums? -
Get child nodes and only child nodes from a tree?
Hi all,
Relatively simple table
create table replaced_parts
old_part_number varchar(7),
replaced_part_number varchar(7),
updated_date date
insert into Replaced_parts values('AAAAA/1', 'BBBBB/1', '2012-Feb-16');
insert into Replaced_parts values('BBBBB/1', 'FFFFF/1', '2012-Feb-23');
insert into Replaced_parts values('YYYYY/3', 'ZZZZZ/3', '2012-Mar-17');
insert into Replaced_parts values('FFFFF/1', 'LLLLL/1', '2012-Mar-18');
insert into Replaced_parts values('LLLLL/1', 'HHHHH/1', '2012-Mar-19');The question is how do I issue a select using 'AAAAA/1' and get the result 'HHHHH/1'
i.e. (A... -> B, B->F, F->L, L->H)
and select using 'YYYYY/3' to get 'ZZZZZ/3' (Y... ->Z)?
It would be really nice if I could also get my original value, say, 'CCCCC/1' if there is no entry
for 'CCCCC/1' in the replaced_parts table (maybe NVL?).
I have googled and tried various combinations of CONNECT BY, PRIOR, ISLEAF... &c. but
am beating my head off a brick wall at the moment.
TIA,
Paul...>
Hi, Paul,Hi again Frank - couldn't sleep and am back at the "£$%^&* computer...
Yeah - it's a pity they weren't correct - I'll make doubly sure in future - see
my edited post (with DROP TABLE commands inter alia - I also removed
Order_Parts.User_Number since it was redundant - all that's needed is
Order_Number (normalisation) so now your SQL doesn't work - sorry
about that.
Just saying something "doesn't work" isn;t very helpful. What exactly is wrong with the SQL
statements I posted? Point out a couple of places where they are wrong, and explain how
you get the right results in those places.Nothing is wrong with your SQL - I meant *sorry* about the confusion in the DDL/DML from my end.
Now, I'm sorry again about the ambiguity of my English.
I'll reconstruct the original data that I gave you and re-run your SQL against that data - again,
this is *totally* my fault.
My tables creation script seems to work fine now - I've edited my reponse to Solomon - the definitive scripts
are now there - with Order_Parts.User_Number gone and the TO_DATE(...) as
you suggested - the VARCHARs seemed to give the right result though - but I
agree that if there's a correct way of doing it, then it should be done that way.
Remember why you need to go to the trouble of posting CREATE TABLE and INSERT statements
for some sample data here. It's to allow the people who want to help you to re-create the prolem
and test their ideas. I know, and that's why I did it - the OR REPLACE that I added (stupidly and without thinking or testing) was
so that people wouldn't have to go to the trouble of dropping the tables - I have now added
DROP TABLE blah... to the beginning of the script so it won't be necessary.
I have over 600 posts on this forum and only 26 questions - most of my time
spent here is trying to help (to the best of my limited ability - I'm not a guru
like yourself) and learning - it's amazing the number of times problems that
I've seen here have subsequently arisen at work - and I am frequently
frustrated by some posters' inability to explain their problem or at least give test
cases.
I can forgive bad English (except my own) - not everybody is a fluent speaker of the language,
but SQL should run no matter what language one speaks.
I appreciate that people are volunteering their time and effort here and I really do
try and make it as easy as possible for them when I ask questions - I messed up
this time, I'm afraid. It might also be the fact that I'm moving between SQL*Plus
and SQL Developer and a text editor that I got confused (plus, fatigue didn't help...)
In general, other people are not going to test anything on your system. I'm going to test
things on my system, Solomon will test things on his system, and other people will test things
on other systems. Well, if ever you're in Dublin ;). Again, I appreciate the effort that you, Solomon and sKr have
gone to in helping me.
Your INSERT earlier statements did not work on my system, because you were using a VARCHAR2
in a place where a DATE was required. The correct thing to do is to use DATEs where DATEs are required. Indeed, and I agreed with you that if there's a right way of doing it, then it should be done that way.
If your NLS settings are such that this is not causing you any errors right now, it's still a good
idea for you to fix it; but, at any rate, whether it works on your system isn't what's important in
this case; you're posting it to run on other peoples' systems.Ahhh.... <the blinding light of a moment of epiphany descends on Paul> I didn't realise it was
an NLS setting - of course Americans will be different - it's just that I thought that YYYY-Mon-DD
worked everywhere (I tried to avoid the day-first/month-first pitfall ) but now that you've explained
it to me, I'll *never* make that mistake again.
Yes - my mistake - I've now corrected the error
Where are the desired results? Don't merely hide them in an old message; post them in a new message.OK. I'll put it in a reply to this post. I really am endeavouring to be as clear as possible - please
excuse my errors - I will do better in future. I'm also very annoyed at my own incompetence and at
having put you to more trouble than you would have had to go to if I had my wits about me.
- should I keep Order_Parts.User_Number even
if it isn't conformant to normalisation rules?
If you have a good reason, it's okay to store de-normalized data. For example, some address tables in
the US contain both state and ZIP code, even though state is fucntionally depenedent on ZIP code. I think that in this case, denormalisation is not called for.
Re. the ZIP code thing, yeah, sure AIUI, the first two digits are dependent on the state, but the
last three? They're more or less random - at least in the sense that there's no way to type
in an address and calculate (mathematically, using a formula) them - so unless one were
to have weird SQL lookups to a "State" table for the first two digits and then take the final
three from a user-entered string field, then do a TO_CHAR on the returned 2-digit state number and add
this to the 3-character one - I can't see how the ZIP code is an example of this? But, maybe
(unless you wish to discuss that) we're getting side-tracked. Perhaps I'll ask this question
on comp.databases.theory?
Oracle actually added a new feature in version 11 (virtual columns) to make de-normalizing easier.Hmmm... is adding virtual columns denormalisation per se? My favourite "cheap'n'cheerful"
db server (Firebird) has had a COMPUTED BY clause (same idea) for yonks (> 12yrs) - no data
is actually stored - rather it is calculated on the fly. Another one for comp.databases.theory
perhaps?
BTW, wouldn't triggers remove all this hassle? It was my first idea, but trying to do it
purely through SQL is now *obsessing* me ;)
That would be another example of de-normalization. If the benefits of doing that outweigh the
costs, then go ahead. A trigger will take some effort to maintain, and it will make all DML slower, regardless
of how often that derived value is needed. Having the extra column will make some queries simpler and faster. Disk is cheap. Have an Original_Orders table (never changes) and a Revised_Orders table. When
a part replacement occurs - for orders that haven't been fulfilled (boolean flag?), change the
old part number to the new one. I can't imagine that replacement occurs very frequently, so
the expense of a trigger would IMHO be minimal - plus the down side of any trigger would
be mitigated by greatly simplifying the production of the Revised_Orders report?
... I'll experiment with what you've given me so far - but it's 23:40 here now, so I won't
get a chance to do it tonight - unfortunately, I *do* have to sleep.
If you haven't tested it yet, why did you start this message saying "your SQL doesn't work"?Sorry - what I meant was it obviously doesn't work when this eejit (i.e. me) has changed
the table structure - I did run it quickly (your 1st statement) against the (revised table
structure, the one you hadn't seen and I don't think even a man of your great SQL talents
can be expected to write working queries against unknown table structures :)).
Again, thanks for your help so far - I'll post the *_correct_* DDL and DML as a reply to this post
with the desired result. I'll also reconstitute the old (i.e. the one you worked against) tables
and data and let you know - again as a reply to this post - if I can at least learn something
from my fiasco, it won't have been a total waste of my time, and again, apologies for
wasting yours.
Thanks again and rgs.
Paul...
Edited by: Paulie on 22-Mar-2012 02:50 -
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 -
Analysis Authorization based on Hier node with multiple display hierarchies
Hi guys - I've got a problem where s.o. might have an idea of how to switch on the light at the end of the tunnel, I am currently standing in:
Requirement:
Cost Center Authorization should be given through RSECADMIN, reporting should be possible for any hierarchy that exists for the authorization relevant info object.
Preferred solution:
The Cost Center Analysis Authorization should be given through RSECADMIN - Hierarchy node assignment.
u2022 A dedicated Authorization Cost Center Hierarchy will be maintained in ECC6 as an alternative cost center hierarchy and extracted into BW.
u2022 The RSECADMIN Hierarchy node assignment should be based on a particular node (Type 2).
u2022 The display level will be specified as required (here: Level 7)
u2022 The Authorization granted should be independent of hierarchy name and version (validity 3).
Reporting Scenario and technical impact:
As mentioned above, when designing and running a query the user should be able to freely select other (i.e. than the authorization) display hierarchies for the authorization relevant reporting object 'Cost Center' as well. The technical names of the semantically relevant hierarchy nodes could therefore vary. E.g. cost centers 1, 2 and 3, being assigned under hierarchy node u2018Au2019 of the RSECADMIN relevant authorization hierarchy, could be subsumed by hierarchy node u2018Bu2019 in another display hierarchy, which the user may want to display in accordance to his reporting needs. Ideally, the alternative display hierarchy should therefore display node u2018Bu2019.
My findings so far (based on prototyping) turn out that this is not possible as long u2018Bu2019 (and its hierarchy) is not authorized in RSECADMIN. Can these findings be confirmed? And if not, would anyone have an idea of how to facilitate the reporting scenario?
Would there be any other way to grant access, possibly based on RSECADMIN single values, and also enable the user to flexibly display hierarchies with only those hierarchy nodes whose single cost center values the user has been given access to?
Thanks everyone for your input...
Claus
Edited by: Claus64 on Jul 13, 2009 4:10 AMHI CLause,
On Jul 14 2009, you wrote in SDN and said:
FYI: Found a solution...
The hierarchy analysis authorization will be based on a navigational attribute of cost center.
With analysis authorizations it is possible to declare the Auth object (e.g. 0COSTCENTER__RACCAUT0) as authorization relevant and leave the superior object 0COSTCENTER auth irrelevant.
The auth will be given for 0COSTCENTER__RACCAUT0. This object will be placed as a filter of the query, being restricted by an Authorization variable for hierarchy nodes.
Due to the concept of Analysis Authorizations, this variable will automatically pick up the nodes granted as part of RSECADMIN Hierarchy based Authorization.
As mentioned above, 0COSTCENTER as the regular reporting characteristic remains auth irrelevant and can therefore take any hierarchy thatu2019s available. Reporting on single values will be possible, too. Only those nodes show up that hold the authorized cost centers in accordance to the authorization.
If the auth relevant 0COSTCENTER__RACCAUT0 is not used in the query definition by either not taking it in as a filter or skipping the Auth variable, the query will launch the message that the authorization is missing. No data show up at all.
Claus
See this thread:
Analysis Authorization based on Hier node with multiple display hierarchies
I am also in the same situation as you and need to understadn your solution. I understand that you created a Nav Attr on 0COSTCENTER and made this auth relevant whilst ensuring that 0COSTCENTER is NOT auth relevant. This is all fine. The issue was you have multiple hierachies for 0COSTCENTER, how did the new Nav Attr help you solve your issue. When loading 0COSTCENTER what values did you load ino the new Nav Attribute and how did that link to the hierachies? Also, in RSECADMIN you created hiearchy nodes based on the Nav Attribute but I am confused as to what values you have in the Nav Attr.
I appreciate if you can share your solution from the past in more details.
many thanks
Maybe you are looking for
-
How to choose a right server for Oracle Database!
Hi all, Is there any formular that allows me to find the appropriate server configuration for Oracle database 11g? Please help! Thank you all. Dan. Edited by: Dan on 01:45 06-01-2013
-
Payment Advice with DME format
Hi Experts, I have done a settings for DME format for Canada. It is generating properly, but while making payment run I am unable to get Remittance Payment advice using same settings. My abaper said that there is some print program needs to be attach
-
A year or two ago I purchased a KDL-40BX450 HDTV for our vacation home. This product has had little use - well less than 100 hours. A couple of days ago it came on by itself emitting a high pitched, siren like, sound. I turned it off and then back
-
Why the system hangup with iPhoto ?
Dear Sir, Really surprised, Apple, being such a good name in market, and I have been using it for last 8 years, and now when the problem comes, there is no any response from your end. Would you please be kind to reply me or guide me how to settle thi
-
Failed accept invitation in Family share
Hi, I sent an invitation to my wife and when she choose to share her location a label comes up by writing "failed accept invitation" !!! My wife has iPhone 6 Plus (iOS 8.3) Any idea or help? Thanks in advance Harris