views:

625

answers:

2

Hi, I want to create an XML in blackberry as there are classes for that like Document and Element but i want the xml in String format is it any way to that .Is any API avialable in blackberry for doing the same

+1  A: 

There really aren't APIs for creating XML documents in the BlackBerry API. You can sort of fake it by using net.rim.device.api.xml.jaxp.XMLWriter, and manually calling methods as if your program was a SAX parser, but that doesn't really buy you much.

Your best bet for structured XML writing is to use KXML, which is small and runs quickly on BlackBerry. Specifically look at the org.kxml2.kdom package and the org.kxml2.io package (for the KXmlSerializer class).

Anthony Rizk
I tried KXML but it does not recognizes the XML pullparser interface and not allowing me to compile any other option plz .
Sam97305421562
Yeah, KXML doesn't include that dependency - I can kind of understand why. Anyway, you can get the pullparser interface from www.xmlpull.org (download the source zip, and just include the 4 files in the java/api folder in your project).
Anthony Rizk
Hi , I have created XML using KXML but i am facing the issue how to convert that xml to string format just like how transformerFactory works in java but which is not available in blackberry so how to proceed ?
Sam97305421562
A: 

I would advise beginning with JSR-172. If it is not available on blackBerry, Sun's reference implementation is pure java and probably open source as part of PhoneME.

QuickRecipesOnSymbianOS