Friday, 15 March 2013

java - JAXB - namespace handling in XML output -


I'm already trying to create an XML document.

So I used XSD for some XML using some tools (I remember with one that ships with the Visual Studio compiler), and then Jacob classes were developed through Eclipse. Now I am able to successfully store an XML output with a slight difference in the context of the original XML document. All namespace elements are not present in the XML output.

The namespace structure is similar to the following in the original document :

   

Me Martial Output XML:

   

I have the package-info.java class generated as follows:

  @ javax.xml.bind.annotation. XmlSchema (name space = "http://www.example.com/in-CLASS/1.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package com.test.xml; Please help me get namespace elements similar to  original document . You are probably missing the name 1 namespace because it's any sub-section of the classpackage object.  

Not used in part.

If other objects are not related to those namespaces, they will not be printed.

You can announce additional namespaces in your XmlSchema annotation:

  @ javax.xml.bind.annotation.xmlSchema (elementFormDefault = javax.xml.bind.annotation .xmlNsForm qualified, namespace = "http://www.example.com/in-CLASS/1.0", xmlns = {@ XmlNs (prefix = "name1", namespace "ERI =" http: //www.example .org / Schemas / XMLSchema "))  

But you should check that your generated XSD schema was named because of the information, because it is suspicious that the additional name in the XML Place announcements were Since the XML schema is generally defined for a namespace, you should have an extra XSD document for your name 1 schema that has been imported into Man XDD document. / P>

It is difficult to say whether the namespace is artistic or should be used by some elements in fact without seeing the entire XML document.


No comments:

Post a Comment