XMLUnit: Element and Attribute ordering problem - XML (Korean)

My question is similar to:XMLUnit: Element and Attribute ordering problem Let's say my original xml is: <top>      <child 1>  </child 1>      <child 2>                  <sub child 21>  </sub child 21>                  <sub child 22>  <sub child 22>      </child 2>      <child 3>                 <sub child 31>  </sub child 31>                 <sub child 32>  </sub child 32>                 <sub child 33>  </sub child 33>      </child 3>      <child 4>  </child 4>      <child 5>  </child 5></top>                  I modified the xml to be tested, by moving the child 3 section into child 2: <top>      <child 1>  </child 1>      <child 2>                  <sub child 21>  </sub child 21>                  <sub child 22>  <sub child 22>                  <child 3>                              <sub child 31>  </sub child 31>                              <sub child 32>  </sub child 32>                              <sub child 33>  </sub child 33>                 </child 3>      </child 2>      <child 4>  </child 4>      <child 5>  </child 5></top> When I run XMLUnit Detailed Diff, the output is: Similar? falseIdentical? false***********************Expected number of child nodes '5' but was '4' - comparing <top..> at .........**********************************************Expected number of child nodes '2' but was '3' - comparing <child 2...> at ...**********************************************Expected presence of child node 'null' but was 'child 3' - comparing  at null to <child 3...> at .....**********************************************Expected presence of child node 'child 3' but was 'null' - comparing <child 3...> at ......**********************************************Expected sequence of child nodes '4' but was '3' - comparing <child 4...> at ....**********************************************Expected sequence of child nodes '5' but was '4' - comparing <child 5...> at ....*********************** My code uses:    XMLUnit.setIgnoreAttributeOrder(true);    XMLUnit.setIgnoreComments(true);    XMLUnit.setIgnoreWhitespace(true);    XMLUnit.setNormalizeWhitespace(Boolean.TRUE);       Diff diff = new Diff(fr1, fr2);    diff.overrideElementQualifier(new ElementNameAndAttributeQualifier());    DetailedDiff detDiff = new DetailedDiff(diff); My question is:Just because I changed the position of child 3 from being top->child 3   to    top>child 2->child 3, I get so many difference messages for the nodes below the problem node. I understand that they are differences too as they have shifted to top because I removed child 3. But is there a way to not show the extra messages for the nodes below the problem node? Please advise.

Related

Query to fetch child of child records of a given party

Hi,
We have requirement to fetch the child records(child of child records also) of a given party name.
We had written the below query:
SELECT distinct hp.party_name
FROM hz_parties hp,
hz_relationships hzr,
hz_parties hp2
WHERE hzr.direction_code = 'C'
AND hp.party_id = hzr.subject_id
AND hzr.object_id = hp2.party_id
AND relationship_type ='Parent-Child Hierarchy'
--'Org Structure'
--'Parent-Child Hierarchy'
AND hz_utility_v2pub.get_lookupmeaning
('AR_LOOKUPS',
'PARTY_RELATIONS_TYPE',
hzr.relationship_code
) = 'Child of'
AND hp2.party_name = :P_CUSTOMER
This query fetches only one level of parent and child records.
Please help us in fetching the child of child records also. We tried using 'Connect By', but its not working as expected.
Thanks in advance.

Creating dimension

create dimension location_DIM
LEVEL REPORT IS (ACTIVITY_COUNTS.REPORT_ID)
LEVEL POST_CODE IS (ACTIVITY_COUNTS.POST_CD)
level district IS (ACTIVITY_COUNTS.DISTRICT_CD)
LEVEL county IS (ACTIVITY_COUNTS.COUNTY_CD)
LEVEL CITY_TOWNSHIP IS (ACTIVITY_COUNTS.city_TWNSHIP_NUM)
HIERARCHY REP_ROLLUP
(REPORT CHILD OF
POST_CODE CHILD OF
DISTRICT CHILD OF
COUNTY CHILD OF
CITY_TOWNSHIP
)
ATTRIBUTE POST_CODE DETERMINES (activity_counts.POST_DESC)
ATTRIBUTE DISRICT DETERMINES (activity_counts.DISTRICT_desc)
ATTRIBUTE COUNTY DETERMINES (activity_counts.COUNTY_desc)
ATTRIBUTE CITY_TOWNSHIP DETERMINES (activity_counts.CITY_TWNSHIP_DESC);
I followed this example.
CREATE DIMENSION products_dim
LEVEL product IS (products.prod_id)
LEVEL subcategory IS (products.prod_subcategory)
LEVEL category IS (products.prod_category)
HIERARCHY prod_rollup (
product CHILD OF
subcategory CHILD OF
category
)
ATTRIBUTE product DETERMINES
(products.prod_name, products.prod_desc,
prod_weight_class, prod_unit_of_measure,
prod_pack_size,prod_status, prod_list_price, prod_min_price)
ATTRIBUTE subcategory DETERMINES
(prod_subcategory, prod_subcat_desc)
ATTRIBUTE category DETERMINES
(prod_category, prod_cat_desc);
But I get this error
Error at Command Line:15 Column:12
Error report:
SQL Error: ORA-30342: referenced level is not defined in this dimension
30342. 00000 - "referenced level is not defined in this dimension"
*Cause:    A reference to a level not defined within the dimension was found.
------------------------------Even this one is giving me reference error. The two tables do not have referential integrity constraints
create dimension location
LEVEL REPORT IS (ACTIVITY_COUNTS.REPORT_ID)
LEVEL POST_CODE IS (DISTRICT_COUNTY_POST_CITY.POST_CODE)
level district_code IS (DISTRICT_COUNTY_POST_CITY.DISTRICT_CODE)
LEVEL county_nbr IS (DISTRICT_COUNTY_POST_CITY.COUNTY_NBR)
LEVEL CITY_TOWNSHIP IS (DISTRICT_COUNTY_POST_CITY.city_township_nbr)
HIERARCHY GEOG_ROLLUP
(report CHILD OF
post_CODE CHILD OF
DISTRICT_CODE CHILD OF
COUNTY_NBR CHILD OF
CITY_TOWNSHIP
JOIN KEY (activity_counts.CITY_TWNSHIP_NUM) REFERENCES CITY_TOWNSHIP)
ATTRIBUTE POST_CODE DETERMINES (DISTRICT_COUNTY_POST_CITY.POST_DESC)
ATTRIBUTE DISRICT_CODE DETERMINES (DISTRICT_COUNTY_POST_CITY.DISTRICT_NAME)
ATTRIBUTE COUNTY_NBR DETERMINES (DISTRICT_COUNTY_POST_CITY.COUNTY_NAME)
ATTRIBUTE CITY_TOWNSHIP DETERMINES (DISTRICT_COUNTY_POST_CITY.CITY_TOWNSHIP_NAME);
tried to create this but not getting through got stuck in reference key
CREATE DIMENSION customers_dim
LEVEL customer IS (customers.cust_id)
LEVEL city IS (customers.cust_city)
LEVEL state IS (customers.cust_state_province)
LEVEL country IS (countries.country_id)
LEVEL subregion IS (countries.country_subregion)
LEVEL region IS (countries.country_region)
HIERARCHY geog_rollup (
customer CHILD OF
city CHILD OF
state CHILD OF
country CHILD OF
subregion CHILD OF
region
JOIN KEY (customers.country_id) REFERENCES country
)
ATTRIBUTE customer DETERMINES
(cust_first_name, cust_last_name, cust_gender,
cust_marital_status, cust_year_of_birth,
cust_income_level, cust_credit_limit)
ATTRIBUTE country DETERMINES (countries.country_name)
;

HGrid Entry Page Implementation

Hi Experts, I'm trying to implement HGrid for an entry page. The concept is: Firstly in the PR method, data will populate in the HGrid. The data result set will present in two levels of hierarchy.For E.g:Hierarchy                --      Qty---------                --      ---  - WV-CT-TR            --      75 --- A15-101-GN1      --      45------- FG-34          --      10 ------- FG-36          --      15------- FG-38          --      20      --- A15-101-RB1      --      10 ------- FG-32          --      5------- FG-36          --      5 --- A15-115-BL1      --      20------- FG-40          --      20  - WV-CP-JK             --      50     --- A15-132-BG1      --      50------- FG-50          --      25------- FG-60          --      25 Now, If u closely look into the Qty values for each node then u'll notice that the group nodes are actually carrying the total value of the details. This is what i need to take input from the user. I mean, the user can choose to enter a summarized value in the group nodes (in this case after user enters we'll need to internally distribute the sum value into the child nodes, based on certain rules) or else the user can enter directly in the child nodes (in this case we'll internally sum up the values and initiate the group nodes) Plz help me accomplish this. I dunno how to prepare the BC4J and HGrid design for this particular model.RegardsAri 
Hi, I forgot to attach the data results based on which this design has to be prepared.Here it is ... CategorySub CategoryItemWV-CT-TRA15-101-GN1FG-34WV-CT-TRA15-101-GN1FG-36WV-CT-TRA15-101-GN1FG-38WV-CT-TRA15-101-RB1FG-32WV-CT-TRA15-101-RB1FG-36WV-CT-TRA15-115-BL1FG-40WV-CP-JKA15-132-BG1FG-50WV-CP-JKA15-132-BG1FG-60 We need to transform the above data into the above hierarchical view.RegardsAri 
Hi, Thanks for the views folks.Please share even the smallest of information (it may be of great value).RegardsAri 
Hi, Thanks for all your support.I've pulled it off now. RegardsAri 
Hi Ari,Here is one sample Ex:Step 1) Created three view objects using following queries:XxParentVOselect 1 parent from dualunion allselect 2 parent from dualunion allselect 3 parent from dualXxChildVOselect 2 parent, 'A' child from dualunion allselect 2 parent, 'B' child from dualunion allselect 1 parent, 'C' child from dualXxChildOfChildselect 'A' child, 'AB' childOfchild from dualunion allselect 'B' child, 'BA' childOfchild from dualunion allselect 'A' child, 'AA' childOfchild from dualunion allselect 'A' child, 'AC' childOfchild from dualunion allselect 'B' child, 'BB' childOfchild from dualStep 2) Create two view LinksXxParentChildVLSource Attribute: XxParentVO --> parent  (attribute selection)Destination Attribute: XxChildVO --> parent (attribute selection)View Link Properties: Destination View object checked named given to Accessor as XxChildVOAccXxChildsVLSource Attribute: XxChildVO --> child (attribute selection)Destination Attribute: XxChildOfChildVO --> child (attribute selection)View Link Properties: Destination View object checked named given to Accessor as XxChildOfChildAccStep 3) Add into Application Module likeXxParentVO --> XxChildVO --> XxChildOfChildVOStep 4) HGrid Region Creation:hgridRN--> treeRN--> members----> nodedef1 (ViewInstance: XxParentVO and ViewAttribute: Parent)----> childNode1 (ViewLinkAccessor: XxChildVOAcc)-------->members--------> nodedef2(ViewInstance: XxChildVO and ViewAttribute: Child )-------->  childNode2 (ViewLinkAccessor: XxChildOfChildAcc)------------->members---------------> nodedef3(ViewInstance: XxChildOfChild and ViewAttribute: Childofchild) Swati
Hi Swati, I tried exactly the same thing. Which actually worked somewhat, but still a issue was there which was that i was only getting the top node and not the corresponding child nodes. Which later on started working .. when i did the following:I changed the hierarchical level in the AM shuttling. I mean earlier i was shuttling all the VOs in the AM separately,then i shuttled the VOs likeCategoryVO     -->     SubCategoryVO Via VL          -->     ItemVO via VL This is how it started working. I guess u meant the same by the following line in the above post:
Swati wrote:
Step 3) Add into Application Module like
XxParentVO --> XxChildVO --> XxChildOfChildVO
Thanks a ton Swati, u helped me a lot in this  RegardsAri

MDX Syntax Error

hello, noob MDX question: this query works no problem:SELECT [APN].Children ON ROWS,
[Product].Children ON COLUMNS
FROM [COMP]
 But this one gives error on line 1 at token 'ON':SELECT [APN] ON ROWS,
[Product] ON COLUMNS
FROM [COMP]
 This one gives error on line 2 at token ',':SELECT [Calendar].Children ON ROWS,
[APN].Children, [Product].Children ON COLUMNS
FROM [COMP]
 What am i doing wrong? thx
SELECT [APN] ON ROWS,   [Product] ON COLUMNS   FROM [COMP]  On this one, since you are only selecting a single member it needs to be a tuple enclosed in parens (Actually, all of them should be sets enclosed in brackets Try this SELECT {([APN])} ON ROWS,   {([Product])} ON COLUMNS   FROM [COMP]  This oneSELECT [Calendar].Children ON ROWS,   [APN].Children, [Product].Children ON COLUMNS   FROM [COMP] fails because you are trying to have two sets of members on one axis. Youhavetou use a cross join and have tem as setsSELECT {[Calendar].Children} ON ROWS,   Crossjoin({[APN].Children}, {[Product].Children}) ON COLUMNS   FROM [COMP]   
thanks!

Sql Query Doubt!!!

i have two tables. A(master tbl) and B(slave tbl).
Table A ( 1 record)
________
Name : Senthi      
Age:     25
Id:     1234
Pst: SA
Table B ( 2 - records)
________
Name : Senthi , Senthi
Add: XYZ , XYZ
Bank: IOB , SBI
When i'm retreiving the records by using a join query, it
displays the records twice. but the only difference is the Bank
column. Now i want the record to be displayed as 1 record like
this
Name: Senthi
Add: 25
Bank: IOB
Bank: SBI
and not as 2 records like below.
Name: Senthi
Add: 25
Bank: IOB
Name: Senthi
Add: 25
Bank: SBI
Please advise n help... 
What you're saying is that you would like to qualify the values
in the first bank column to match one value, and the values in
the second bank column to match another value.
In order to do this, you need to:
a) use two (2) instances of the child table in your FROM clause
b) include difference Aliases for each
c) write two outer-joins (one per child table)
d) write two separate line items for qualifying the values in
each of the two bank columns.
SELECT a.description, b1.bank_code, b2.bank_code
FROM parent_table a, bank_table b1, bank_table b2
WHERE a.PK = b2.FK (+)
AND a.PK = b1.FK (+)
AND b2.bank_code = 'CODE 1'
AND b1.bank_code = 'CODE 2';
If you don't use the outer-join, only those parent records with
BOTH exact child bank records, will be returned.
Let me know,
Dan

Categories

Resources