[android-developers] Re: Creating an XML file from Code

2008-04-23 Thread Dorothy
Thanks Dan, but could you show me how to custom in addition a text by extending TextImpl in DOM? I need it to set a element's text child node. I've tried but there is always null pointer exceptions in the constructor, and in CharacterDataImpl.setData()... I'm new in Android and I don't know very

[android-developers] Re: Creating an XML file from Code

2008-03-25 Thread Dan U.
I guess you are trying to use a Transformer to convert a Document to an xml String? Here's some more quick&dirty code for it: public String getXml(Node node) { StringBuilder buffer = new StringBuilder(); if (node == null) { return "

[android-developers] Re: Creating an XML file from Code

2008-03-25 Thread Dexter's Brain
Hell Yaaa...I should have guessed that.I thought u wud be catching exceptions everywhere On Mar 25, 2:12 am, "Dan U." <[EMAIL PROTECTED]> wrote: > I didn't see a solution for the xml attribute namednodemap == null > issues, so I decided to go ahead and fix it with some custom classes. > I

[android-developers] Re: Creating an XML file from Code

2008-03-25 Thread Vesin Duško
Tnx Dan, i have another problem, Android does not have TransformerFactory class so how to get data from generated document? It would be nice if I can get at list some string that contains XML. On 24/03/2008, Dan U. <[EMAIL PROTECTED]> wrote: > > > I didn't see a solution for the xml attribute na

[android-developers] Re: Creating an XML file from Code

2008-03-24 Thread Dan U.
I didn't see a solution for the xml attribute namednodemap == null issues, so I decided to go ahead and fix it with some custom classes. I'm sure Google will get it fixed, but in case they don't in time for the ADC submission, some people might want a solution now. It's real quick&dirty, so if som

[android-developers] Re: Creating an XML file from Code

2008-03-24 Thread Dan U.
There definitely is an issue with attributes which won't let you access them unless you know their names beforehand. If that isn't a problem, then it's easy to write some code to give you back an Xml string from a Document. On Mar 24, 12:09 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote: > Hey Vi

[android-developers] Re: Creating an XML file from Code

2008-03-24 Thread Dexter's Brain
Hey Vishal, This code will work with JDK.But, currently, there is some problem with the android SDK. The NamedNodeMap doesn't workI dont know how did you test it on android. There is also a bug reported for this issue with the SDK.. I guess.I tried using this, but it never worked for

[android-developers] Re: Creating an XML file from Code

2008-03-24 Thread vishal
I think i have a code for this which is general with any DOM document type... Here initially you have to pass root element. Plz tell me if im wrong and if errors in the code.. or any way to improve that private void addTagToTheFile(Element elem) throws IOException {

[android-developers] Re: Creating an XML file from Code

2008-03-24 Thread Dexter's Brain
Hello Vesin, I can give you the code, but its not a generalized one. It will work only for my XML file format. I dont think it will help u. On Mar 24, 8:32 pm, "Vesin Duško" <[EMAIL PROTECTED]> wrote: > Can you share your code with as? > > On 16/03/2008, Dexter's Brain <[EMAIL PROTECTED]> wrote:

[android-developers] Re: Creating an XML file from Code

2008-03-24 Thread Vesin Duško
Can you share your code with as? On 16/03/2008, Dexter's Brain <[EMAIL PROTECTED]> wrote: > > > Hi Nitin, > > I think this is not possible with the current SDK. We should wait till > some more packages are added to the SDK. Till then, everything has to > be done manually. > After banging my head f