Dynamic nSXD Translation in OSB 12c

152 Views Asked by At

I have an xsd file projectName/Resources/Schema.xsd (namespace http://www.mycompany.com/SomeSchema) for translation but need to set an element name dynamically. For Static option I may manually select an element (btw Types are not displayed), say named someElement1, then 2 elements are added to nxsdTranslation:

<con3:nxsd ref="projectName/Resources/Schema"/>
<con3:schemaElement xmlns:ns="http://www.mycompany.com/SomeSchema">ns:someElement1</con3:schemaElement>

When I select Dynamic and choose XQuery Expression, I'm allowed to enter any xquery element expression but I didn't find any information, what should be specified there. I tried several guesses, but each time received an error

XML to Native nXSD translation failed for the nXSD   : null

Does anybody know what exactly should be returned by Dynamic nXSD Schema?

1

There are 1 best solutions below

0
Dmytro On

The XQuery for dynamic NXSD translation is similart to dynamic validation:

<translate xmlns="http://www.bea.com/wli/sb/context">
    <schema>$schemaPath</schema>
    <schemaElement>
        <namespaceURI>$elementNamespace</namespaceURI>
        <localname>$elementName</localname>
    </schemaElement>
</translate>

where $schemaPath - absolute path to the xsd file, without .xsd extension, like my-project/Resources/my-schema

$elementNamespace and $elementName - element namespace and local name

xquery root element name (i.e. translate in this example) doesn't matter at all