Sun Eclipse capabilities with Schema creation - eclipse

I have two questions that pertian to each other. I have to switch from XML Spy over to Sun Eclipse and there are some things that XML Spy does magically for me that I want to know if Eclipse can handle the same way:
Given a sample XML document, generate a minimum XML Schema that it will comply with. It need not have type, occurrence or size restrictions, but it will have the structure. It will also take care of the element variations if present in the data, coming up with the greatest common structure.
Given an XML Schema with all its included type declarations, generate a sample XML document, with options to have or not have the optional elements, to include one or many occurrences of repeated elements.
Any Help....

You can create a sample XML from an XSD file in Eclipse. Here are the instructions for the Juno version of Eclipse (with Web Tools Platform):
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.wst.xmleditor.doc.user%2Ftopics%2Ftcrexxsd.html
I'm not aware of a tool to go from an XML to an XSD file... you could search the Eclipse plugin market place for one...

Related

Custom XML formatter for Eclipse

Is it possible to define a new XML formatter in an Eclipse plugin? I have some XML files that must follow specific formatting rules, but see how way of plugging in to the formatter engine.
I can tie this formatter to files that are part of a project with a specific facet.
For context, I am maintaining the Sling IDE Tooling for Eclipse, and part of that application is concerned with synchronising local state with a remote JCR repository.
The synchronisation is based on XML files and folders stored on disk, following a well defined format - FileVault DocView. These XML files can contain metadata attached to files and folders, but also arbitrary hierarchical data.
The CLI tool that is used as an alternative to the IDE tooling and almost always in production follows strict set of rules regarding indentation, XML attribute ordering, etc and also rewrites files when pushing them to the repository.
I would like to follow this model and allow the users of the IDE to format the XML files following the exact same preset. The formatting model is actually quite simple, shown below:
format = new OutputFormat("xml", "UTF-8", true);
format.setIndent(4);
format.setLineWidth(0);
format.setBreakEachAttribute(true);
format.setSortAttributeNamesBy(AttributeNameComparator.INSTANCE);
The name comparator is also quite simple, sorting xmlns instructions first, then the namespaced properties, and then the other properties.
This was requested in https://bugs.eclipse.org/460055 , but not implemented.

XML schema for GWT UIBinder

I'm wonderring whether Google is ready to publish (or there is at least any chance to "produce") the full formal xml schema for GWT UIBinder.
I've searched the latest entire GWT-SDK-2.4 distribution but found nothing. Does GWT simply look up java sources or reflect the classes of the widgets to validate the UIBinder xml counterparts, assuming that the xml schema was actually by no means predefined thus adopted to govern the validation?
#EDIT
According to the answer from #Ganesh Kumar, I've looked into ui.xsd (r6836) and found something e.g. in lines 496-499:
<!--
A complex type that contains both text and elements. There is no schema
for the elements, they can be any elements.
-->
There're also other similar occurrences indicating no schema for the elements alike. It seems that Google has not yet fully defined even agreed on the xml schema for UIBinder xml instances, doesn't it?
AFAIK, the XSD is only there to help the Google Plugin for Eclipse doe autocomplete.
There's no schema per se, UiBinder generator directly matches the elements with classes and the attributes with setters (with a few exceptions, such as addStyleNames, this is documented in the UIObject javadoc). There are a bunch of element parsers specific to some widgets (each widget that uses one has some specific documentation in its javadoc), and there are attribute parsers to unmarshal attribute values into Java objects to pass to setters.
Yes, Google is publishing the XSD for UiBinder as part of GWT source. You can get the latest GWT source which is available at http://google-web-toolkit.googlecode.com/svn/trunk/. You can view the XSD at here

IBM Eclipse WSDL Editor: How do I include an external wsdl/schema?

I am trying to create Web Services from the Top-Down approach. I downloaded Eclipse and am using the WSDL gui editor in it to build my WSDL files.
I am splitting up my Services based on "modules". The Types I am adding to the WSDLs all need to reference common stuff, such as PersonEntity, AddressEntity, States enumeration (simple type), Countries enumeration (simple type), and AbstractEntity. Since those items are all common I created a seperate WSDL file (named Commons.wsdl) that contains the type information for those types.
I want to "import" that WSDL into my other WSDL files to use:
For example, I have an entity named RegistrationEntity which inherits from AbstractEntity and contains a PersonEntity as well as an AddressEntity. I'm not sure how to do this... I saw that the WSDL spec has "import" and "include" and am not sure which one to use. Also, how do I actually import (or include) the Commons.wsdl file so that I can use the Types defined within it?
Thanks!
Oh, and I'm not sure if I'm supposed to stick this stuff in a seperate WSDL but another type of file such as an xsd or something. I really wanna follow best practices so if that's the proper way to do it then I'd rather do that.
I found out that the problem I had was I was creating a WSDL file for my commons and using an inline scheme for that, rather than creating an XSD file to be imported by my other WSDLs.
So instead I just created an Commons.XSD as my "Common Schema".

Create and bind a GUI from xsd file automatically in eclipse rcp app

I want to create GUI components from XSD files. The generated GUIs should be used for concrete xml instances of the corresponding schema with databinding to "interesting" elements or attributes content.
I have considered these solutions:
jaxfront. (commercial tool). This does not generate source code. This is important for me because I want communication between the generated GUIs and other components of the GUI.
Use xsd2emf and try to generate an editor from that. The generated model is to complex, as well as the generated editor and it is buggy.
Do it myself e.g. generate an xml from the xsd, load xml as dom, select the interessting parts and generate data binding using one method described at http://www.vogella.de/eclipse.html.
Has anyone another idea or already successfully solved that problem? I would prefer a free open source solution which generates a SWT GUI.
Have you looked at the Sapphire framework at eclipse?
With it you have to create a model based on a few simple java interface files with some annotations that would model your XSD. Then once you have the model defined, you create the SWT GUI with a single xml file (sdef file) that wires various property editors to your model. The property editors can be simple widgets like label, text, lists, combo boxes but also it can be complex editors like a GEF-based diagram editor. So basically if you have a few interfaces that describe your model, then can have a graphical editor for editing nodes in that model with less than 100 lines of XML.
See lines 22 to 121 of this sample file.

XML schema for Eclipse target definition files

Where can I find the XML schema and/or documentation for Eclipse target definition files (*.target)?
May be this schema might fit the target files created for an RCP platform.
Part of that schema file is visible in the Eclipse help page.
There is no schema or documentation defining the structure of a target definition file (.target). This is because the file structure is not intended to be API (it may change between release).
The structure has changed several times already. The code used to serialize/deserialize the file can be found in the following classes:
org.eclipse.pde.internal.core.target.TargetDefinitionPersistenceHelper
org.eclipse.pde.internal.core.target.TargetPersistence38Helper
org.eclipse.pde.internal.core.target.TargetPersistence36Helper
org.eclipse.pde.internal.core.target.TargetPersistence35Helper
org.eclipse.pde.internal.core.target.TargetPersistence34Helper