« Return to Thread: [MOXy] how to write out schema location?

[MOXy] how to write out schema location?

by polly.c.chang :: Rate this Message:

Reply to Author | View in Thread

Hi,

I have just noticed that my marshalled XML document does not contain the xsi:schemaLocation attribute in the root element.  What do I need to specify to get this to show up?  I already have this in my class mapping for the root element:

         <namespace-resolver>
            <namespaces/>
            <default-namespace-uri>http://www.foo.com/bar/baz</default-namespace-uri>
         </namespace-resolver>

         <schema xsi:type="schema-file-reference">
            <resource>..\..\..\..\..\blah.xsd</resource>
            <schema-context>/FooType</schema-context>
            <node-type>complex-type</node-type>
         </schema>

I expected the schemaLocation to be generated to be something like this:

xsi:schemaLocation='http://www.foo.com/bar/baz c:\stuff\blah.xsd'

Note that I noticed this for a basic one root-element to one Java class mapping, though I wouldn't be surprised if I hosed something in my experiments with multiple root-elements.

Any help would be greatly appreciated.

Thanks,
Polly

 « Return to Thread: [MOXy] how to write out schema location?