You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Venkat Ramana Karpuram <vr...@gst.fnc.fujitsu.com> on 2000/10/10 01:13:11 UTC

Xml writer

Hi!
      I am working with generation of Xml files from Java objects. wherever i have
read, i didn't get a way to generate an xml document from a DOM tree. The way
parser generates a DOM tree from xml file, i am expecting that there should be
some way to generate an xml file from a DOM tree. I could not find any API which
does this job in the Xerces-1_2_0  documentation.  If anyone knows it, please let
me know.
Thanks & Regards
Venkat Ramana

Re: Xml writer

Posted by Dane Foster <df...@equitytg.com>.
JDOM provides something like that.  JDOM uses real java objects (linked
lists, arrays, etc....)  to represent the XML documents instead of
interfaces.  This means you can manipulate the objects like you would any
java objects via your standard get and set methods and your change will show
up in the document.  Naturally, there are bound to be limitations to what
you can do plus you may have to pay the price of non portability of your
code, but depending on your needs portability may not matter.  You can check
it out at http://www.jdom.org  Happy hunting.

Dane
----- Original Message -----
From: "Joe Faith" <fa...@runtime-collective.com>
To: <ge...@xml.apache.org>
Cc: "Guillaume" <gu...@runtime-collective.com>
Sent: Tuesday, October 10, 2000 5:06 AM
Subject: Re: Xml writer


> Venkat and Dane;
>
> It would also be worth looking at XML-Java data binding, in which a Java
object
> tree is bound to an XML document such that updates to the objects are
reflected
> in the document:
>
>  http://www-4.ibm.com/software/developer/library/data-binding1/?dwzone=xml
>
> There is also an implementation for this for the Enhydra system, but I
don't
> know how reliable it is.
>
> Joe Faith
> Runtime Collective, Web Engineers
>  http://www.runtime-collective.com/
>
> Dane Foster wrote:
>
> > Use the XML serializer.  It's located in org.apache.xml.serialize.  You
> > should review the java docs to get a feel for how to use it.
> > ----- Original Message -----
> > From: "Venkat Ramana Karpuram" <vr...@gst.fnc.fujitsu.com>
> > To: <ge...@xml.apache.org>
> > Sent: Monday, October 09, 2000 7:13 PM
> > Subject: Xml writer
> >
> > > Hi!
> > >       I am working with generation of Xml files from Java objects.
> > wherever i have
> > > read, i didn't get a way to generate an xml document from a DOM tree.
The
> > way
> > > parser generates a DOM tree from xml file, i am expecting that there
> > should be
> > > some way to generate an xml file from a DOM tree. I could not find any
API
> > which
> > > does this job in the Xerces-1_2_0  documentation.  If anyone knows it,
> > please let
> > > me know.
> > > Thanks & Regards
> > > Venkat Ramana
> > >
> >
>
> --------------------------------------------------------------------------
--
> > ----
> >
> > > ---------------------------------------------------------------------
> > > In case of troubles, e-mail:     webmaster@xml.apache.org
> > > To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: general-help@xml.apache.org
> >
> > ---------------------------------------------------------------------
> > In case of troubles, e-mail:     webmaster@xml.apache.org
> > To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> > For additional commands, e-mail: general-help@xml.apache.org
>
>
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
>
>


Re: Xml writer

Posted by Brett McLaughlin <br...@lutris.com>.

Joe Faith wrote:
> 
> Venkat and Dane;
> 
> It would also be worth looking at XML-Java data binding, in which a Java object
> tree is bound to an XML document such that updates to the objects are reflected
> in the document:
> 
>  http://www-4.ibm.com/software/developer/library/data-binding1/?dwzone=xml
> 
> There is also an implementation for this for the Enhydra system, but I don't
> know how reliable it is.

They are actually the same thing ;-) I wrote the article, I wrote the
implementation.

Thanks,
Brett

> 
> Joe Faith
> Runtime Collective, Web Engineers
>  http://www.runtime-collective.com/
> 
> Dane Foster wrote:
> 
> > Use the XML serializer.  It's located in org.apache.xml.serialize.  You
> > should review the java docs to get a feel for how to use it.
> > ----- Original Message -----
> > From: "Venkat Ramana Karpuram" <vr...@gst.fnc.fujitsu.com>
> > To: <ge...@xml.apache.org>
> > Sent: Monday, October 09, 2000 7:13 PM
> > Subject: Xml writer
> >
> > > Hi!
> > >       I am working with generation of Xml files from Java objects.
> > wherever i have
> > > read, i didn't get a way to generate an xml document from a DOM tree. The
> > way
> > > parser generates a DOM tree from xml file, i am expecting that there
> > should be
> > > some way to generate an xml file from a DOM tree. I could not find any API
> > which
> > > does this job in the Xerces-1_2_0  documentation.  If anyone knows it,
> > please let
> > > me know.
> > > Thanks & Regards
> > > Venkat Ramana
> > >
> >
> > ----------------------------------------------------------------------------
> > ----
> >
> > > ---------------------------------------------------------------------
> > > In case of troubles, e-mail:     webmaster@xml.apache.org
> > > To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: general-help@xml.apache.org
> >
> > ---------------------------------------------------------------------
> > In case of troubles, e-mail:     webmaster@xml.apache.org
> > To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> > For additional commands, e-mail: general-help@xml.apache.org
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org

-- 
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc. 
1200 Pacific Avenue, Suite 300 
Santa Cruz, CA 95060 USA 
http://www.lutris.com
http://www.enhydra.org

Re: Xml writer

Posted by Joe Faith <fa...@runtime-collective.com>.
Venkat and Dane;

It would also be worth looking at XML-Java data binding, in which a Java object
tree is bound to an XML document such that updates to the objects are reflected
in the document:

 http://www-4.ibm.com/software/developer/library/data-binding1/?dwzone=xml

There is also an implementation for this for the Enhydra system, but I don't
know how reliable it is.

Joe Faith
Runtime Collective, Web Engineers
 http://www.runtime-collective.com/

Dane Foster wrote:

> Use the XML serializer.  It's located in org.apache.xml.serialize.  You
> should review the java docs to get a feel for how to use it.
> ----- Original Message -----
> From: "Venkat Ramana Karpuram" <vr...@gst.fnc.fujitsu.com>
> To: <ge...@xml.apache.org>
> Sent: Monday, October 09, 2000 7:13 PM
> Subject: Xml writer
>
> > Hi!
> >       I am working with generation of Xml files from Java objects.
> wherever i have
> > read, i didn't get a way to generate an xml document from a DOM tree. The
> way
> > parser generates a DOM tree from xml file, i am expecting that there
> should be
> > some way to generate an xml file from a DOM tree. I could not find any API
> which
> > does this job in the Xerces-1_2_0  documentation.  If anyone knows it,
> please let
> > me know.
> > Thanks & Regards
> > Venkat Ramana
> >
>
> ----------------------------------------------------------------------------
> ----
>
> > ---------------------------------------------------------------------
> > In case of troubles, e-mail:     webmaster@xml.apache.org
> > To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> > For additional commands, e-mail: general-help@xml.apache.org
>
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org


SDExpo 2001 West

Posted by Elliotte Rusty Harold <el...@metalab.unc.edu>.
I will once again be chairing the XML Track for the SD2001 West
Conference in San Jose, next April 8-12. We're looking for solid
technical presentations on XML in both 90-minute and full-day formats
(though if you haven't presented before, it's probably best to start
with a couple of 90-minute seminars rather than proposing a full-day
tutorial.)

What we really want is in-depth, tutorial material; for
example, how to use XSLT, how to use XNI; how to use schemas, etc. This
is a developer conference, and we find that our audience is fairly bored
with managerial presentations like "How to manage your web site by
integrating XML with E-Commerce" or political presentations like "Why
RELAX is better than W3C schemas". We're looking for as much information
about how to use the technology as you can cram into 90 minutes. For
more details or to submit a proposal please go to the SDExpo speaker web
site at http://www.sdexpo.com/speakers/2001w_infomain.html. The 
deadline is officially tomorrow, Friday the 13th but we'll
probably let that slide a bit for interesting proposals.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+

Re: Xml writer

Posted by Venkat Ramana Karpuram <vr...@gst.fnc.fujitsu.com>.
Hi!
    As suggested by Dane, i am using serialize API to write a DOM document  as
an xml file. I have been using the format as "UTF8" and indent as "true" in
OutputFormat. The way it is printing is ok except that the new tags are not
starting on the new line. I mean a child node tag starts at the end of its
parent tag, but not on the new line. If anyone of you know a way to print the
xml in a way that every new tag starts on new line. Please let me know if there
is a way. Thanks for taking time
Thanks & Regards
Venkat Ramana

Dane Foster wrote:

> Use the XML serializer.  It's located in org.apache.xml.serialize.  You
> should review the java docs to get a feel for how to use it.
> ----- Original Message -----
> From: "Venkat Ramana Karpuram" <vr...@gst.fnc.fujitsu.com>
> To: <ge...@xml.apache.org>
> Sent: Monday, October 09, 2000 7:13 PM
> Subject: Xml writer
>
> > Hi!
> >       I am working with generation of Xml files from Java objects.
> wherever i have
> > read, i didn't get a way to generate an xml document from a DOM tree. The
> way
> > parser generates a DOM tree from xml file, i am expecting that there
> should be
> > some way to generate an xml file from a DOM tree. I could not find any API
> which
> > does this job in the Xerces-1_2_0  documentation.  If anyone knows it,
> please let
> > me know.
> > Thanks & Regards
> > Venkat Ramana
> >
>
> ----------------------------------------------------------------------------
> ----
>
> > ---------------------------------------------------------------------
> > In case of troubles, e-mail:     webmaster@xml.apache.org
> > To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> > For additional commands, e-mail: general-help@xml.apache.org
>
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org

Re: Xml writer

Posted by Dane Foster <df...@equitytg.com>.
Use the XML serializer.  It's located in org.apache.xml.serialize.  You
should review the java docs to get a feel for how to use it.
----- Original Message -----
From: "Venkat Ramana Karpuram" <vr...@gst.fnc.fujitsu.com>
To: <ge...@xml.apache.org>
Sent: Monday, October 09, 2000 7:13 PM
Subject: Xml writer


> Hi!
>       I am working with generation of Xml files from Java objects.
wherever i have
> read, i didn't get a way to generate an xml document from a DOM tree. The
way
> parser generates a DOM tree from xml file, i am expecting that there
should be
> some way to generate an xml file from a DOM tree. I could not find any API
which
> does this job in the Xerces-1_2_0  documentation.  If anyone knows it,
please let
> me know.
> Thanks & Regards
> Venkat Ramana
>


----------------------------------------------------------------------------
----


> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org