[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Creating valid XML from the data bindings
Hi Steve,
I am including a test .java file which shows the process of creating GXL
from scratch using the data bindings. It also includes the validate method
which is available on all objects which you can use to validate the object
against the XML Schema def I've come up with.
You'll need to include in the classpath jaxen, xbean, and xbean_path and
any of the data_bindings (e.g., alpha-4-xmltypes.jar), all previous
bindings work with the code here.
The code has comments in case you want a closer look as to how you create
and populate the classes. It will take you more time than a straight
System.out.println(), but you it may help if there is any confusion on
valid (XML-wise) GXL. You are welcome to use the program to test individual
Objects on your own if you need a small scale validator.
Doing this exercise exposed a bug in XML Beans (truncates xmlns:xlink to
xmlns:xlin), and I have submitted it to Apache, I may poke around and fix
it my self, sounds easy enough.
Yuzo
Attachment:
CreatingGXLFromBindings.java
Description: Binary data
Attachment:
CreatingGXLFromBindings.class
Description: Binary data