Hi,
I have only a limited understanding about SDO and EMF, but what it looks
like is -
List custList = root.getList("CUSTOMER");
       for(int i=0; i<custList.size(); i++){
        System.out.println(XMLHelper.INSTANCE.save
          ((DataObject)custList.get(i), "whatever", "myname"));
       }
will give you details like
<?xml version="1.0" encoding="ASCII"?>
<whatever:myname xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:das="http:///org.apache.tuscany.das.rdb/das";
   xmlns:whatever="whatever" xsi:type="das:CUSTOMER"
   ID="1" LASTNAME="John" ADDRESS="USA"/>
<?xml version="1.0" encoding="ASCII"?>
<whatever:myname xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:das="http:///org.apache.tuscany.das.rdb/das";
   xmlns:whatever="whatever" xsi:type="das:CUSTOMER"
   ID="2" LASTNAME="Amita" ADDRESS="INDIA"/>
<?xml version="1.0" encoding="ASCII"?>

And in the tuscany-sdo side, when the save() happens, it works on
XMLResource which
contains the elements (in your case , it is a list of {DataGraphRoot and all
CUSTOMERS}),
and when EMF prints it to the writer, it writes as href, where as when the
list contains
individual CUSTOMER as above, when writing it, EMF explodes the complete
element.

Regards,
Amita

On 7/4/07, litaojian <[EMAIL PROTECTED]> wrote:

Hi All ,

       I write sample to test the das , when I get a root DataObject from
a DAS-RDB command ,
I use the follow code to output a xml string of the root DataObject .

String uri = companyDO.getType().getURI();
String typeName = companyDO.getType().getName();
System.out.println(XMLHelper.INSTANCE.save(root, "commonj.sdo",
"dataObject"));

but the output is

<das:COMPANY xmlns:das="http:///org.apache.tuscany.das.rdb/das"; href="
root.xml#/"/>


This result is not as my expected .

I need the result as this

<?xml version="1.0" encoding="ASCII"?>
<das:COMPANY xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:das="http:///org.apache.tuscany.das.rdb/das";
xsi:type="das:DataGraphRoot">
<COMPANY ID="1" NAME="IBM" EOTMID="88"/>
<COMPANY ID="2" NAME="HP" EOTMID="99"/>
</das:COMPANY>


Response expected.





litaojian
2007-07-04

Reply via email to