2. Check Namespaces in Return Types This page last changed on Nov 27, 2008. .stickable, h1, h2, h3, h4, h5 false true Show Sticky notes Hide Sticky notes Save Cancel Oracle Data Service Integrator Documentation > Data Services Developer's Guide # How To Check Namespaces in Return Types This topic shows you how to make sure the namespaces used in your return type are correct. Check Prefix Bindings Edit the Namespace See Also ## Check Prefix Bindings In the return type, a child element must be in the same namespace as its parent. If a return type uses elements in different namespaces, you cannot deploy the logical data service to the server or test it from Workshop for WebLogic. The exception to this rule is when the parent and child are in different namespaces, but both namespaces have the same prefix binding. Check prefix bindings first, and then edit the namespace, if needed. To check prefix bindings in the Overview tab: Click the Overview tab. Click the Properties tab (if it's not visible, choose Window > Show View > Properties). To check prefix bindings in Source: Click the Source tab. Look for the XQuery namespace statements:
       import schema namespace myc="ld:logical/MyCustomer" at "ld:logical/schemas/MyCustomer.xsd";
       declare namespace cus= "ld:physical/CUSTOMER";
       import schema namespace myc1="ld:logical/MyCustomer" at "ld:logical/schemas/MyCustomer_KEY.xsd";
3. In both these examples, the myc and myc1 namespaces have the same prefix binding. You can have a parent element in one and a child element in another. But if you have a parent element in myc and a child in cus, you need to change one namespace in the return type. ## Edit the Namespace Once you check the prefix binding, you can check a namespace used in a return type and change it in the Query Map or Source view. To edit a namespace in Query Map view: Click the Query Map tab. Select the parent element in the return type, then click it. Be sure to select and then click; do not double-click. Select the child element in the return type, then click it. If the child element is in a different namespace, change it to the namespace of the parent. Right-click the title bar of the return type, and choose Save and Associate XML Type. Enter the correct location, namespace, and root element name for the return type. Click OK. To edit a namespace in Source view: Click the Source tab. Expand the primary Read function: Locate the namespace of the child element and change it to the namespace of the parent, both in the start and end elements:
       declare function myc:read() as element(myc:CUSTOMER)*{
       for $CUSTOMER in cus:CUSTOMER()
       return
           <myc:CUSTOMER>
           ...
          {
               for $ADDRESS in add:ADDRESS()
               where $CUSTOMER/CUSTOMER_ID eq $ADDRESS/CUSTOMER_ID
               return
               <myc:ADDRESS >
               ...
               </myc:ADDRESS>
          }
Save the changes. ## See Also ##### How To Create a Return Type Add a Complex Child Element to a Return Type ##### Other Resources XML Schema Tutorial at W3Schools XML Schema Part 1: Structures XML Schema Part 2: Datatypes

Document generated by Confluence on Jan 13, 2009 15:57