XSLT or JAXB

Hi,
I've written an application in which JAXB is applied to transform XML to/from Java object instances. This is all working fine.
However, there is now a further requirement to transform the XML to match another schema for further processing, and both the definition and processing of that transformation will be far from trivial.
My feeling is that I should brush up on my XSLT skills as the appropriate technology and use that, but am tempted to make a technology choice based on familiarity :) That is, to manipulate the object instance from old schema to new within JAXB and then marshal out into a new XML file as required. I suppose this will also in fact be more efficient, as I am working directly with a previously parsed instance of the old schema.
Any advice from Java/XSLT/JAXB gurus on what the issues and tradeoffs are here?

Hi,
I've written an application in which JAXB is applied
to transform XML to/from Java object instances. This
is all working fine.
However, there is now a further requirement to
transform the XML to match another schema for further
processing, and both the definition and processing of
that transformation will be far from trivial.
My feeling is that I should brush up on my XSLT skills
as the appropriate technology and use that, but am
tempted to make a technology choice based on
familiarity :) That is, to manipulate the object
instance from old schema to new within JAXB and then
marshal out into a new XML file as required. I suppose
this will also in fact be more efficient, as I am
working directly with a previously parsed instance of
the old schema.
Any advice from Java/XSLT/JAXB gurus on what the
issues and tradeoffs are here?You may be interested in checking the javax.xml.bind.util.JAXBSource
class.See the API documentation. I have used it and loved it.
So I have my content tree which I manipulate. Then as you need, you can to transform it to another xml document using JAXBSource.
That may solve your requirement...
Similarly JAXBResult was also very useful.
Incase you run into problems will be glad to help.
Regards,
Bhakti Mehta
Sun Microsystems Inc.

Similar Messages

  • Approach on parsing an XML file (JAXP, JAXB, DOM, SAX, XSLT)

    I have a pretty basic xml file that contains a database table name, fields, and sort order. My job is to read the XML file, construct the query based on the information in the nodes, and then output it in various ways. I know I can use JAXP, JAXB, DOM, SAX, and XSLT for this.
    I have the experience doing this using DOM. I have read up on JAXP, JAXB, and XSLT. I'm having a little bit of a difficult time on chosing the most appropriate way to do this. Again, I've always done it using DOM, but I'm not so sure that is the best way to do it here. Just looking for some recommendations from people whom are more familiar with XML parsing and processing.

    markwagoner wrote:
    I tried several of those but found them rather tedious. Now I just use JDOM for everything, it make life much easier.It doesn't, actually. It kept your learning curve shallow, but that's all. If you were to invest some time in JAXB, you'd find it made life easier for some things. If you invested time in XSLT, it would make life easier. Endlessly working with JDOM is incredibly tiresome after a while. You just don't know it because you never invested enough in learning anything else.
    Don't bother posting any code to "enlighten" me as to how simple JDOM is. I've been using it for years.

  • JAXB - nested elements of same name

    Hi
    I have a schema which can represent elements with identical nested names like this:
    <Simple>
    <Strong>
    <Simple/>
    </Strong>
    </Strong>
    The nesting is not recursive. i.e. the two 'Simple' elements are not actually identical. Unfortunately when I bind the schema to java using JAXB, the generated code won't compile and i get error due to name collision:
    "Nested type SimpleType hides an enclosing type"
    Can external binding fix this problem? I have already tried it but without success because there doesn't seem to be a way to bind the 'SimpleType' to another name. I can only change the interface name, but i need to change the type interface as well.
    I am tearing my hair about it and only solution i can see is that i use XSLT to transfrom the names before reading the XMl files in and writing them out. I can not change the original schema unfortunately.
    Any clues will be much appreciated, Martin.

    Hi everybody
    In the interest of anyone having similar problem, i have discovered that if i used a schema which used complex types explicitly (as generated by XmlSpy for me) the problem went away. This is probably because the nesting becomes irrelevant. My original schema contained only one element with all the types being anonymous and nested within that element.
    Regards, Martin.

  • JAXB duplicates database records in the output XML file

    I am trying to export a database through XML file using JAXB. But i get an XML file having my records with the @XMLElement name i gave it (SMS_Database) and also another one following it with <list/> as the RootElement name. I don't know where it's coming from. Here is the code:
    import java.io.*;
    import java.sql.*;
    import java.util.ArrayList;
    import javax.xml.bind.*;
    public class Parse2Xml {
      static final String XMLBASE = "./SMS_Database.xml";
      static ArrayList<Intermed> dataList = new ArrayList<Intermed>();
      static Connection con = null;
      static PreparedStatement ps = null;
      static ResultSet rs = null;
      public static void main(String[] args) throws JAXBException, IOException {
            con = getConnection();
            try{
              ps = con.prepareStatement("SELECT * FROM SMS_Log");
              rs = ps.executeQuery();
              while (rs.next()) {
                  dataList.add(getData(rs));
              rs.close();
              ps.close();
              con.close();
            } catch (SQLException ex) {
                ex.printStackTrace();
            DataStore SMS_Database = new DataStore();
            SMS_Database.setList(dataList);
            JAXBContext context = JAXBContext.newInstance(DataStore.class);
         Marshaller m = context.createMarshaller();
         m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
         Writer w = null;
         try {
              w = new FileWriter(XMLBASE);
              m.marshal(SMS_Database, w);
         } finally {
              try {
                   w.close();
              } catch (Exception e) {
        static Connection getConnection(){
            String sqlURL = "jdbc:mysql://localhost:3306/SMSDB";
            String username = "SUNNYBEN";
            String password = "drowssap";
            try {
                try {
                    Class.forName("com.mysql.jdbc.Driver").newInstance();
                } catch (InstantiationException ex) {
                    ex.printStackTrace();
                } catch (IllegalAccessException ex) {
                    ex.printStackTrace();
            } catch (ClassNotFoundException ex) {
                ex.printStackTrace();
            try {
                con = DriverManager.getConnection(sqlURL, username, password);
            } catch (SQLException ex) {
               ex.printStackTrace();
            return con;
        static Intermed getData(ResultSet rs) throws SQLException {
                Intermed mediator = new Intermed();
                mediator.setSms_id(rs.getString("sms_id"));
                mediator.setSender_id(rs.getString("sender_id"));
                mediator.setMessage(rs.getString("message"));
                mediator.setPhone_no(rs.getString("phone_no"));
                mediator.setDate_sent(rs.getString("date_sent"));
                mediator.setSchedule_date(rs.getString("schedule_date"));
                mediator.setUsername(rs.getString("username"));
                mediator.setResponse(rs.getString("response"));
                return mediator;
    import java.util.ArrayList;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlRootElement;
    @XmlRootElement(namespace = "SMS_Database")
    class DataStore {
        @XmlElement(name = "SMS_Log")
        ArrayList<Intermed> dataList = new ArrayList<Intermed>();
        public ArrayList<Intermed> getList() {
            return dataList;
        public void setList(ArrayList<Intermed> dataList) {
            this.dataList = dataList;
    import javax.xml.bind.annotation.*;
    @XmlRootElement(name = "SMS_Log")
    @XmlType(propOrder = {"sms_id", "sender_id", "message", "phone_no", "date_sent", "schedule_date", "username", "response"})
    public class Intermed {
        private String sms_id;
        private String sender_id;
        private String message;
        private String phone_no;
        private String date_sent;
        private String schedule_date;
        private String username;
        private String response;
        public String getSms_id() {
            return sms_id;
        public void setSms_id(String sms_id) {
            this.sms_id = sms_id;
        public String getSender_id() {
            return sender_id;
        public void setSender_id(String sender_id) {
            this.sender_id = sender_id;
        public String getMessage() {
            return message;
        public void setMessage(String message) {
            this.message = message;
        public String getPhone_no() {
            return phone_no;
        public void setPhone_no(String phone_no) {
            this.phone_no = phone_no;
        public String getDate_sent() {
            return date_sent;
        public void setDate_sent(String date_sent) {
            this.date_sent = date_sent;
        public String getSchedule_date() {
            return schedule_date;
        public void setSchedule_date(String schedule_date) {
            this.schedule_date = schedule_date;
        public String getUsername() {
            return username;
        public void setUsername(String username) {
            this.username = username;
        public String getResponse() {
            return response;
        public void setResponse(String response) {
            this.response = response;
    }

    Dear All
    my requirement is to generate an xml file which looks similar to
    <?xml version="1.0" encoding="UTF-8"?>
    <?TestLine?>
    <test_mt>
    <field1>123</field1>
    <field2>234</field2>
    </test_mt>
    how to add <?TestLine?>  tag?
    Hi shabrasish and rajashekar
    i am new to java and xslt mapping can you guide me  or give me links which are similar to my requirement how to proceed with this kind of mapping
    thanks
    uday

  • Build page with screen definition in XML using XSLT in ADF 11.1.1.x

    Hi folks,
    I'm figuring out how best integrating Oracle Policy Automation/Webdeterminations in ADF. My idea is that in a ADF Taskflow I first call a Init-session webservice on OPA to initiate a session with facts queried from ADF Components.
    Then I would query a Determinations Server Webservice to get the next interview-screen definition. This gives me an xml with the definition of a screen to present. I could create an xslt that transform this to an HTML form. Then I would show a page with this (x)html form included in a container. The user could fill in the question-fields. Then on a command button I would read the values from the HTTP request and feed it into a webservice call to the Determinations Service.
    Is a scenario like this possible in ADF? And could you give me some hints to get me on track? Or would you suggest otherwise?
    The recommendation from OPA is to use data-adapters. But that are then java-classes based on an java-interface that are to be custom build on a datamodel. And I could imagine several security implications on that.
    Thanks in advance.
    Regards,
    Martien

    Can you use JAXB to unmarshall the XML document to a Java Class (and create a POJO data control out of the java class) and use it in the ADF pages as form or table or tree table?
    Take a look at the following sample how an XML document having a schema associated can be converted to a Java class and used in the UI:
    http://adftree.googlecode.com/svn/trunk/TreeSample.zip
    Thanks,
    Navaneeth

  • JAXB case insensitive

    Dear friends,
    is there a way to read a XML using JAXB in a case-insensitive way ?
    i.e., I have a XML from a legacy software, all ugly Upper Case written. And I'm creating a schema to represent the data from this xml.. I was dreaming to write the schema fulfilled with java-like elements, i.e., lower cases..
    is there a way to read an "UPPER CASE" xml in a set of Java classes - from a schema with regular names ?
    best regards,
    Felipe Ga�cho

    Some of us end up having to maintain FORTRAN for a living, so count yourself lucky (I've since left that job). Code so old you have to shout for the compiler to here you.
    You could always write a little XSLT than uppercases all the names in your schema.

  • Web Service Object Parameters and JAXB

    Hi All,
    This is my first post here and I'm hoping one of you might have encountered a similar problem before. One of our business partners provided us with a WSDL for their service, with an embedded XML schema. My job in this case is to write a message driven bean (MDB) that will take a message containing XML off of a queue and call this web service. However, their web service requires an object to be passed as input. So, I've used JAXB to generate a set of classes (from the schema I ripped out of their WSDL) that will unmarshal the XML document that comes off the queue. This works fine, however, the resulting object is an inherently different object than the object I need to pass to the web service, that one was created by auto-generating the Java proxy for the web service. Since these two classes come from the same schema definition, they have the same structure and can hold the same data, but they have different implementations. My plan is to write a method to copy the data from one object to another, but this feels redundant. Is there any approach I could use to make these two auto-generated sets of code be more compatible, other than the obvious answer of having written everything by hand? Thanks in advance for any replies.

    Are the XML instances coming from the queue and the request object to the WS defined by the same schema (from the business partner)? If they are different, there's no other option than to do a copy or some sort of XSLT (not that that's any easier though). But if the instances are defined by the same schema, just use some data binding framework that you can use for both reading the XML from the queue and that is incorporated into the WS toolkit you're using.
    For example, Axis2 allows you to use XMLBeans as a the data binding framework. Using the generated classes from Axis2, you can read in the XML instances from the queue and at the same time have the request object for the WS call.

  • JAXB Marshalling of "double" problem - exponent is in the way

    An element declared as "xsd:double" in the schema is marshalled by JAXB as "3.000404E-4" to represent 0.0003000404 . When I try to process this XML document using XSLT, the standard number() function returns "NaN" because of the exponent in the representation of the number.
    Is there any way to have JAXB marshall this number in a way that is acceptable to XSLT?
    Thanks,
    -Allan

    This seems to have a solution by using JAXB custom bindings. See http://forum.java.sun.com/thread.jsp?forum=34&thread=507037
    Thanks anyway.
    -Allan

  • Performance of XSLT

    We have an HTML page which user will use to get information. At the click of submit information is queried from 2 systems which is in XML format. This information is then merged into one before sending it back to the client.
    Couple of questions:
    1. My question, is it advisable to use XSLT for such kind of real time environment. I am not sure of the performance, if it's going to overload CPU, memory etc.
    2. What are the basic guidelines for writing efficient XSLT transformation.
    3. Is merging using XSLT slower than directly doing it in JAXB?

    In my experience, the decision to use Java code vs. XSLT is based on a couple of factors:
    1) Is what you want to do something that can be done in XSLT? XSLT is a very powerful tool but it is very quirky. It is very different from any other programming language I've used (and I have used a lot of them). So, the first test is "Can what I want to do be done easily in XSLT?"
    2) Next, who will make changes? If this is code to be shipped to a client and they will need to make minor changes over a period of time, and you don't want them to change the Java code, or the person who will be responsible for making those changes is not a Java programmer, then XSLT may be a better way than having the transformative code in Java. Also, changes might be done by an administrator with some training in XSLT more easily than having to teach them Java + XML + WebServices + database + + + .
    3) I've never heard of situations where XSLT caused stack overflows, or lengthy delays. That is not to say that you can be sloppy and XSLT will save you. XSLT does not have some "simple" constructs like mutable variables, or loops as in most for or while loops, one fallback is to use recursion. This can eat memory if not controlled and tested.
    4) Any work to fine tune the speed of this operation will probably be overshadowed by bad code in other parts of the application.
    I cannot think of anything that can be done in XSLT that cannot be done in Java code. There are many things that cannot be done in XSLT, however, that can be done in Java. Writing and debugging XSLT, especially the first 100,000 or so times is not simple for anything more complex than a textbook or tutorial exercise.
    So, there are no hard and fast rules on which is better. Each is the right choice for a set of problems. You have not given us enough information to make that decision. I've tried to help with your decision.

  • How to set a different parser  for JAXB ?

    from the FAQ https://jaxb.dev.java.net/faq/index.html
    A question about which jars are required says
    "The runtime also needs a JAXP-compliant parser. If your target environment is
    JRE 1.4 or higher , it is a part of JRE, so you don't need any more jar file.
    Otherwise you have to bundle a parser, too. Any parser would do the job, but we
    recommend the JAXP RI bundled in the JWSDP (which is what we test against.) "
    I am running jdk1.3 and want to use a different parser how do I specify it.
    Thanks
    Steve

    I think I worked it out.
    I just have to set the JAXP parser
    Q. How do I use a different JAXP compatible implementation?
    The JAXP 1.1 API allows applications to plug in different JAXP compatible implementations of parsers or XSLT processors. For example, when an application wants to create a new JAXP DocumentBuilderFactory instance, it calls the staic method DocumentBuilderFactory.newInstance(). This causes a search for the name of a concrete subclass of DocumentBuilderFactory using the following order:
    1. The value of a system property like javax.xml.parsers.DocumentBuilderFactory if it exists and is accessible.
    2. The contents of the file $JAVA_HOME/jre/lib/jaxp.properties if it exists.
    3. The Jar Service Provider discovery mechanism specified in the Jar File Specification. A jar file can have a resource (i.e. an embedded file) such as META-INF/services/javax.xml.parsers.DocumentBuilderFactory containing the name of the concrete class to instantiate.
    4. The fallback platform default implementation.

  • Problem unmarshalling xml using JAXB

    I am using JAXB for processing xml, which comes from an external source. Most often, the xml gets changed from external source which causes the error during unmarshalling as the xsd has not changed. Is there a way to process the xml in same way even if xsd hasn't changed, like converting new xml to one as per xsd etc. Someone has mentioned using xslt, but I would like to get more ideas on any other technologies or third party tools to overcome this issue so that I do not have to reply upon changing xsd everytime. Thanks

    Most often, the xml gets changed from external source which causes the error during unmarshalling as the xsd has not changed.So, you've got garbage input. Your goal should be to stop that from happening rather than trying to make it work.
    so that I do not have to reply upon changing xsd everytimeIf you have to keep changing the schema then perhaps JAXB wasn't a suitable technology choice here. Or maybe the design wasn't done properly. Or maybe (see earlier comment) the input files aren't being produced properly. At any rate you need to fix the underlying problem before writing code.

  • Using JAXB to edit XML documents

    I am trying to understand how (and whether) JAXB can be used to make the following types of changes to an existing XML document. I know that I can EDIT an XML document using the set methods that are generated by JAXB (in conformance with the XML Schema), and then I create a Marshaller and marshall the root element object.
    However, I have not figured out how to do any of the following:
    (i) insert a new element
    (ii) delete an existing element
    (iii) reorder elements.
    Here is an excerpt from an XML document:
    <directory name="dir">
    <file name="file1"/>
    <file name="file2"/>
    <file name="file3"/>
    </directory>
    The order in which the file elements appear is significant.
    If I want to add a new file (file4), how would I do this? Where would it be added, at the end? What if I wanted to add it after file2?
    If I want to delete file1, I don't know how to do that.
    Finally, if I want to move file2 after file3, I don't know how to do that.
    It seems as though I need access to the underlying com.sun.xml.bind.util.ListImpl (or similar collection object), which holds the actual file elements when JAXB unmarshals the xml file. However, this seems dangerous and I have gotten a concurrent access exception while trying to do something like this. (Another problem has to do with iterators, where I can't iterate through a list and then make a change to the list w/o messing up the iterator.)
    If there are any technologies other than JAXB that might accomplish this, but that provide data binding, I would be happy to hear about it. (I could try SAX/DOM/JDOM/DOM4J or XSLT, I guess, but I like the data binding of JAXB.)

    As is typical for me, I answered my own questions.
    if you are outside of an iterator, you can simply use the:
    add(object)
    add(position,object)
    remove(object)
    methods of the List interface to add and remove elements from the list of elements.
    Also, if you use a ListIterator, you can call the add() and remove() methods of ListIterator while iterating through the list.
    In order to reorder elements in the list, use:
    Collections.swap(list,pos1,pos2). Why this method is not built into the List interface itself is beyond me. This was only added in 1.4, btw.

  • JAXB using marshaller.setProperty to specify xalan

    Hi All,
    I'm developing an application using JAXB 1.0.4. I'm able to successfully generate xml from the JAXB compiled classes. My root element should look like
    <EzAp:Invoice xmlns:EzAp="http://siemens.com/einvoice" xmlns:xalan="http://xml.apache.org/xslt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://siemens.com/einvoice file:///C:/einvoice/xml/EzAp.xsd">.
    I'm not being able to specify the xalan namespace. Please let me know if I can do that through the marshaller.setProperty or any other work around.
    Thanks for the help
    Mahesh

    hai,
    i seen u r post.i am having problem with unmarshalling program.with your post i know u can definately solve my problem.because i am having problem in generating xml docemnt from the unmarshall program.pleae help me in thi regard.
    i wrote a sample xml file .and it's xml schema.i used this xml schma to jaxb compiler to generate the classes.it has generated the classes.
    then i wrote unmarshall program as follows
    public class indextestUnmarshal {
    public static void main(String args[]){
    try
         System.out.println("starting........");
         javax.xml.bind.JAXBContext jc= JAXBContext.newInstance("com.search");
         System.out.println("JAXB Instance.....");
         Unmarshaller unmarshaller = jc.createUnmarshaller();     
         System.out.println("calling unmarshal method.....");
         Searchblox coll = (Searchblox)unmarshaller.unmarshal(new File("search.xml"));
         System.out.println("searchblox...........");
    catch(JAXBException e)
         e.printStackTrace();
    program is unable to print the 4th stmt i.e searchblox.it's giving error as follows
    starting........
    JAXB Instance.....
    calling unmarshal method.....
    javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"searchblox"). Expected elements are (unknown)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:523)
         at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:199)
         at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:194)
         at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:71)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:920)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:364)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:345)
         at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:117)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:200)
         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:173)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:142)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:151)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:169)
         at indextestUnmarshal.main(indextestUnmarshal.java:39)
    please help me in this regard as soosn as possible
    Thanks in Advance
    -Rregards
    Rama

  • JAXB: How do I add a processing instruction?

    Hi there
    I am using XML with JAXB in a client/server environment. On the response of from the server to the client, I want to include a processing instruction in the XML response to indicate a stylesheet associated for example:
    <?xml-stylesheet type="text/xsl" href="test.xsl"?>
    Does anybody have any ideas on how to include a stylesheet while constructing the jaxb object? Or must this declaration be included in the building schema???
    Please help?
    Thanks
    Glen

    this is how I do it in jwsdp 1.4:
    marshaller.setProperty("com.sun.xml.bind.xmlHeaders", "<?xml-stylesheet type=\"text/xsl\" href=\"checker.xslt\"?>");
    This constant is defined as private in the generated marshal class.
    as of now this looks like an undocumented feature.

  • JAXP or JAXB?

    Hi all,
    I got an XSD and I want to build an HTML that reflected the XSD.
    For example if I got <xs:complex> tag with few elements I want to make a combobox.
    My questions are:
    1. What technology can help me here, JAXP or JAXB? (Don't forget there're few attributes and other types that should be in the object) .
    2. Is someone knows about new technology or there's something out there that do it? (I know about EMF).
    Thanks in advance,

    you need jaxb if you have to create/manipulate an xml file without knowing of xml technology. So it is not used for transforming.
    If I understood correctly, you are building a simple form, in this case starting from a simple well formed xml (not "valid") not binded to schema will do the job. In this case you can specify all attributes and transform easily with xslt.
    <field type="textarea" col="20".../>But all depends on where the data would go after pressing "submit". In a database ? Back into xml ?
    Also I suppose it is not correct (and not possible I guess) transforming an xsd directly into something else, as you could re-arrange all the data constraint. A schema has to keep its integrity, its only purpose is to validate file.

Maybe you are looking for