You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by Mark Salamon <ms...@advisen.com> on 2003/12/30 21:16:28 UTC

Creating an XML Document from an XML Schema

I have created a fairly complex XML schema and turned it into java
objects using JAXB.  I now wish to build XML documents based on that
schema.  My hope was to automate this process, so that the schema could
be read and transformed into an HTML form (using servlets), which would
include validation of the data entered (at least on the back end), and
then the servlet would actually produce the XML file from the user's
input, conforming to the schema.

To date, I have not seen anything like this, other than possibly
commercial software (like XML Spy).  As I mentioned, I want to include
this in a webapp, so the whole thing can be included as a servlet in a
.war file.  Thus, XML Spy would not work.

The closest I have seen to this (an incomplete version) is discussed in
http://www.xml.com/pub/a/2003/04/30/editing.html.  This solution uses
XSLT, XPath, XUpdate, etc.  However, it seemed to me quite logical to
use JAXB instead.  Since the process of generating JAXB objects from a
schema is conceptually similar to creating a GUI from a schema, I
thought perhaps I could go from the JAXB objects to the GUI and cut down
on the complexity of the job.

If there is any JaxMe project working towards this goal, or anyone knows
of any solution to this problem, I would appreciate hearing about it.

Thanks

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Creating an XML Document from an XML Schema

Posted by Mark Salamon <ms...@advisen.com>.
Thanks for that info.  Sounds like it has not been built yet.  :)

I actually came across something interesting.  It's a swing app (not a
servlet), although I guess you could try to run it in an applet to have
it work over the web:

http://www.felixgolubov.com/XMLEditor/



On Wed, 2003-12-31 at 09:52, Jochen Wiedmann wrote:
> Hi, Mark,
> 
> Mark Salamon wrote:
> 
> > The closest I have seen to this (an incomplete version) is discussed in
> > http://www.xml.com/pub/a/2003/04/30/editing.html.  This solution uses
> > XSLT, XPath, XUpdate, etc.  However, it seemed to me quite logical to
> > use JAXB instead.  Since the process of generating JAXB objects from a
> > schema is conceptually similar to creating a GUI from a schema, I
> > thought perhaps I could go from the JAXB objects to the GUI and cut down
> > on the complexity of the job.
> > 
> > If there is any JaxMe project working towards this goal, or anyone knows
> > of any solution to this problem, I would appreciate hearing about it.
> 
> for what its worth, here are my thoughts on the topic:
> 
> - If I had to create a quick solution, I would try the following:
> 
>    a) Create a mapping between XPath expressions and JAXB objects; my
>       hope would be that JXPath (http://jakarta.apache.org/commons/jxpath/)
>       could be used.
> 
>    b) Create a mapping between forms and object names, for example this
>       could be done via a hidden input field.
> 
>    c) Use XPath expressions as names of the input fields in the HTML form.
> 
>    To sum it up, a typical form might look like
> 
>      <form action="my.jsp">
>        <input name="root$object" value="Address"></input>
>        <input name="name/surname" value="Wiedmann"></input>
>        <input name="name/firstname" value="Jochen"></input>
>        ...
>      </form>
> 
> - This is the *quick* solution. I'd reject to take this solution for
>    any project requiring more than two peoples work. The reason is, that
>    the system wouldn't be controllable by any compiler or similar thing.
> 
> - For larger projects, I would definitely recommend a generative
>    approach, which creates JSP pages, XSP pages or similar stuff, where
>    the mapping in a) can be verified at compile time. A simple approach
>    might be to reduce the supported XPath syntax to a small subset and
>    create a JaxMe generator that converts XPath expressions into getFoo()
>    or setFoo() calls.
> 
> 
> Jochen


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Creating an XML Document from an XML Schema

Posted by Jochen Wiedmann <jo...@ispsoft.de>.
Hi, Mark,

Mark Salamon wrote:

> The closest I have seen to this (an incomplete version) is discussed in
> http://www.xml.com/pub/a/2003/04/30/editing.html.  This solution uses
> XSLT, XPath, XUpdate, etc.  However, it seemed to me quite logical to
> use JAXB instead.  Since the process of generating JAXB objects from a
> schema is conceptually similar to creating a GUI from a schema, I
> thought perhaps I could go from the JAXB objects to the GUI and cut down
> on the complexity of the job.
> 
> If there is any JaxMe project working towards this goal, or anyone knows
> of any solution to this problem, I would appreciate hearing about it.

for what its worth, here are my thoughts on the topic:

- If I had to create a quick solution, I would try the following:

   a) Create a mapping between XPath expressions and JAXB objects; my
      hope would be that JXPath (http://jakarta.apache.org/commons/jxpath/)
      could be used.

   b) Create a mapping between forms and object names, for example this
      could be done via a hidden input field.

   c) Use XPath expressions as names of the input fields in the HTML form.

   To sum it up, a typical form might look like

     <form action="my.jsp">
       <input name="root$object" value="Address"></input>
       <input name="name/surname" value="Wiedmann"></input>
       <input name="name/firstname" value="Jochen"></input>
       ...
     </form>

- This is the *quick* solution. I'd reject to take this solution for
   any project requiring more than two peoples work. The reason is, that
   the system wouldn't be controllable by any compiler or similar thing.

- For larger projects, I would definitely recommend a generative
   approach, which creates JSP pages, XSP pages or similar stuff, where
   the mapping in a) can be verified at compile time. A simple approach
   might be to reduce the supported XPath syntax to a small subset and
   create a JaxMe generator that converts XPath expressions into getFoo()
   or setFoo() calls.


Jochen

---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org