Yeah, I ran into this problem as well and ended up rolling my own
code. If you just need the basics, it's fairly trivial to write a
recursive function to traverse the Document object and write it to
file. My function is about 50 lines and that includes try / catch
lines, comments, and spacing.

On Oct 28, 7:53 am, qlimax <[email protected]> wrote:
> that's S**T because I'm searching for that also!
>
> no way? :(
>
> On 9 Set, 12:06, Guijoye <[email protected]> wrote:
>
> > Hi all,
>
> > I'm using org.w3c.dom.Document to create a document and I need now 
> > towriteit into a .xmlfile. I saw tutorials refering the
> > javax.xml.transform.Transformer package but this one is not avalaible
> > in the Android platform.
>
> > My code looks like this :
>
> > [...]
>
> > org.w3c.dom.Document document = null;
>
> > DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
> > DocumentBuilder docBuilder;
>
> > try
> > {
> >   docBuilder = dbfac.newDocumentBuilder();
> >   document = docBuilder.newDocument();
>
> >   processDocument(document);}
>
> > catch (ParserConfigurationException e)
> > {
> >   // TODO Auto-generated catch block
> >   e.printStackTrace();
>
> > }
>
> > if (document != null)
> > {
> >   documentToFile(document, filename); // this is what I need!
>
> > }
>
> > [...]
>
> > I've been looking for hours now and I can't find a way to get this
> > working!
>
> > Thanks for any help.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to