Sample XML from XSD - bind elements between namespaces?
Posted: Tue Jan 27, 2015 11:21 pm
Good day! Fairly new to Oxygen and looking for a bit of help. I'm attempting to generate sample XML from a schema XSD file using the "Generate Sample XML File.." tool. The sample XML correctly nests an element from one namespace under an element from the default. It then nests the next element under that namespace. However, the generator won't nest an element from the default namespace under that element from this other namespace. For example, I'd like the sample XML to do this:
Instead, the generator stops at <ns2:element2></ns2:element2> even though I've indicated in the generator Options to generate XML for ANY ns1 element.
I can fill in the content manually with the editor in the generated XML that stops where I indicated and it will validate just fine. But there are a good number of further nestings under ns1:element2 that I don't want to fill in manually. If I declare what amounts to a copy of ns2:element1 as an element under ns1 within the XSD, the generator works just fine as well but this isn't how the data is supposed to be modeled. So, I'm not positive what I have to do in the XSD to bind element2 in ns1 to element2 in ns2 so the sample XML will generate the nesting properly.
Thanks for any suggestions!
Code: Select all
<ns1:element1>
<ns2:element1>
<ns2:element2>
<ns1:element2>
...
I can fill in the content manually with the editor in the generated XML that stops where I indicated and it will validate just fine. But there are a good number of further nestings under ns1:element2 that I don't want to fill in manually. If I declare what amounts to a copy of ns2:element1 as an element under ns1 within the XSD, the generator works just fine as well but this isn't how the data is supposed to be modeled. So, I'm not positive what I have to do in the XSD to bind element2 in ns1 to element2 in ns2 so the sample XML will generate the nesting properly.
Thanks for any suggestions!