I have two xsd files with same root element name.Ideally,it is preferred to have two unique names in these 2 xsd files.
PROBLEM FACED:
If I want the JAXB to create classes with unique identifictaion ,how can we acheive through external binding?
Can anyone help me?
Related
In the intelliJ suite, xsd validation is performed automatically and you get an error if a given schema is not found. I tried to find an xsd file for the w3c widgets namespace but i couldn't.
If there is no such thing, what is the best practice here? Just add a rule to each file to ignore the error? (that is not a good one imo)
Generate a schema automatically from the file? (but if i add something i need to regenerate it?)
I am trying to create an xml by analyzing an xsd using Moxy. I will not be aware of how the xsd looks like.
The xsd will be provided on the fly. Using Moxy I am able to load the xsd and print details of all the XmlDescriptors. My question is, how to identify the root element.
Thanks
Having xsd, any global type can be root element of xml document. For such global type, use method
org.eclipse.persistence.oxm.XMLDescriptor#getDefaultRootElement
to get name of root element.
I created an XSD schema and have put in some documentation via the tag.
from the XSD i generated Java classes using Jaxb (from within eclipse - jdk1.6)
i now plan to use my java classes as "source" and modify them as per requirements that come up
I will generate XSD back from modified Java classes to keep the XSD in-sync.
in this process any "documentation" on the XSD gets lost. (i.e. when i generate it from Java). Is there some way to get around this? Thanks.
I want to write a java program, Input - XSD File I need to retreive all the element name from the xsd and need to create an xml file as an output with the retreived element name. If anyone of you have the sample code, please share it.
Thanks
You are not rephrasing your question,but still i found some suggestions for you.See if its useful for you.Please check the following link...
http://www.narendranaidu.com/2010/04/xsd-to-xml-and-vice-versa.html
Alright use JAXME or XSOM to parse your schema and use DOM or JDOM to write the element names to new xml
if you want to create a sample XML from schema ..you can use XMLspear tool to do that.
http://www.donkeydevelopment.com/
I have two XSD files (source and target)... on what basis should I map these two files to get an XSLT? I know how MapForce helps in mapping but I worked with the sample project ..Now I wanted to know on what basis should I map these file that my client sent me..
I don't think there could be any general way to generate an XSLT given two XSD (if this is what your are after). The XSDs describe the structure of the XML files, but they don't say anything about what is the data they contain (their semantics if you will).
E.g.
<Customer>
<Name>ACME</Name>
<Address>9 Main Street, Anytown, USA</Address>
</Customer>
and
<Customer Name="ACME" City="Anytown" Country="USA" Address="9 Main Street"/>
are two XML describing more or less the same thing - but there is no way to know reading their XSD that the <Address> element in one correspond to three different attributes Address, City and Country in the other.
I am afraid you have to create the XSLT manually - and my suggestion would be to start from sample XML files, not the XSDs - much easier.
am afraid you have to create the XSLT manually - and my suggestion would be to start from sample XML files, not the XSDs - much easier.