Dear Wiki user, You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.
The following page has been changed by KelvinGoodson: http://wiki.apache.org/ws/Tuscany/Java/SDO/ThinkingAloud/OpenContent ------------------------------------------------------------------------------ ((DataObject)oq).set(pc, "TBA"); }}} + '''Note:''' in the future it will be possible to do '''dob.set("<property>", value);''' to set into a wildcard (not sure how the namespace is selected in the property argument.) + but there's a problem with the code at the moment I think (I've submitted http://issues.apache.org/jira/browse/TUSCANY-396) so at the moment you have to do something like this ... @@ -88, +90 @@ == Open content with max occurs > 1 == + As seen above in the workaround for setting values into single valued wildcards, you can set multiple values by setting a List value against a Property. - TBD + Considering the schema ... + adhering to the schema ... + {{{ + <?xml version="1.0" encoding="UTF-8"?> + <xsd:schema xmlns:simple="http://www.example.com/open" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/open"> + + <xsd:element name="openStockQuote" type="simple:OpenQuote"/> + + <xsd:element name="company"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="name" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="note" type="xsd:string"/> + <xsd:element name="count" type="xsd:int"/> + + <xsd:complexType name="OpenQuote"> + <xsd:sequence> + <xsd:element name="symbol" type="xsd:string"/> + <xsd:any maxOccurs="1" namespace="##any"/> + </xsd:sequence> + </xsd:complexType> + + </xsd:schema> + }}} + + What I cant yet reconcile with the API is how to create the following document, where the unbounded cardinality wildcard has instances of more than one property against it + + {{{ + <?xml version="1.0" encoding="UTF-8"?> + <open:openStockQuote xmlns:open="http://www.example.com/open"> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.example.com/open open.xsd "> + <symbol>ww</symbol> + <open:note>TBA</open:note> + <open:count>1</open:count> + </open:openStockQuote> + }}} + + Using the DataObject.set(Property, Object) API, we only get a chance to set multiple values of a single property. +
