That works fine.  What I want is all the employees irrespective of the
department grouped together in a single collection.

-----Original Message-----
From: Frank Budinsky [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 23, 2007 5:01 PM
To: [email protected]
Subject: RE: XPath

I see. Sorry, I didn't notice before, but you need an index on
departments 
like this:

root.get("departments[1]/employees");

or this:

root.get("departments[2]/employees");

Frank.




"Murtaza Goga" <[EMAIL PROTECTED]> 
03/23/2007 04:28 PM
Please respond to
[email protected]


To
<[email protected]>
cc

Subject
RE: XPath






"root" is the company instance.  The first expression results in a
ClassCastException and the second returns a null.

This is what my graph looks this:

<?xml version="1.0" encoding="ASCII"?>
<sdo:datagraph xmlns:company="company.xsd" xmlns:sdo="commonj.sdo">
  <company:CompanyType>
    <departments location="Test Location - [0]">
      <employees name="Test Name - [0][0]"/>
    </departments>
    <departments location="Test Location - [1]">
      <employees name="Test Name - [1][0]"/>
      <employees name="Test Name - [1][1]"/>
    </departments>
  </company:CompanyType>
</sdo:datagraph>

created in my test case with SDOUtil.createDataGraph() and
DataObject.createDataObject for the rest of the containment.

 -----Original Message-----
From: Frank Budinsky [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 23, 2007 2:34 PM
To: [email protected]
Cc: [email protected]
Subject: Re: XPath

What object is "root"? Is it a company instance? If so, this should
work:

root.get("departments/employees");

If it's not, then maybe you need something like this:

root.get("company/departments/employees"); 

How did you load the instances?

Frank.


"Murtaza Goga" <[EMAIL PROTECTED]> wrote on 03/23/2007
01:26:48 
PM:

> Are wildcards supported in the XPath implementation within Tuscany to
> group collections.  For instance in the company example in the spec I
> would like to get a list of all the employees in the company.
> 
> Tried the following in vain:
> 
> 
> 
> root.get("/*/employees")
> 
> root.get("//employees") 
> 
> root.get("/departments/employees") 
> 
> 
> 
> Thanks,
> 
> Murtaza.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to