Kxml and NanoXml

Hi!
I wonder if anyone used this API on the client side, i.e., has someone use this as an extension of MIDP??? How??
Can you put this jar on some J2ME compliant device and use it in many other applications???
I'd really appreciate some hint about this...
Thanks
Marco

Never mind!!
I've downloaded kNanoXML which only contains 4 basic classes xml related... In order to use them on a application I must import the packages/classes I want, and they will be included in the final jar file...
But I think the problem will persist because this is not the best solution... If I develop 5 apps which need xml API, that 5 jars will include those XML classes...
If we could extend the MIDP with other API......
Thanks any way
Marco

Similar Messages

  • KXML and Netbeans

    Hello everyone,
    I wish to manipulate some simple XML on my J2ME application. From what i can find the best method seems to be using kXML.
    However, I am having trouble integrating this into my application as a namespace.
    Does anyone have any experience with this please?
    I am running Netbeans 5.5
    Thank You
    James

    Thanks Peace,
    But I am facing the same problem even when I use the source java files of kXML and include those in my project and use them as additional classes to my class.
    It again builds properly when I don't use the highest obfuscation level.
    But if I try to obfuscate using Level HIGH it throws the same error.
    However when I try to run this project from J2ME Wireless Toolkit, it is running fine on the emulator.
    I guess the error is something specific to Netbeans IDE. Have anyone of you encountered such a bizzare error.
    Thanks,
    Vikas

  • KXML and ksoap

    Hi
    SOAP communication + JAXM and RPC use to communicate on XML base messaging and attachments.
    What is ksoap?Can soap run on midp emulators and palm tops?
    What is KXML?
    What is the status of kxml and ksoap ?? (relesed or still beta versions)
    Thanks

    See http://ksoap.enhydra.org
    kSOAP provides a SOAP runtime for MIDP.
    I've used kSOAP 1.0 and it seems pretty stable.
    kXML is an XML Parser for MIDP, which kSOAP uses.

  • KXML and J2ME

    Okay, i've been reading up on the tutorials, and I think i'm grasping things alot better.
    I will make two classes, one called "Card" for each individual card - and a collection of "Card" types will create a "Stack" class - in this manner I will only have to code the collection once.
    I was hoping someone could give and example of how to translate this:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!-- Not sure if the encoding is right, i don't know much about that. -->
    <Stack>
    <Card>
    <Num> 1 </Num>
    <SideA> This is a question. </Side A>
    <SideB> This is a answer. </Side B>
    </Card>
    <!-- If this comment symbol is even correct, the flashcards would follow in the same suit -->
    </Stack>
    Into my Classes, using kXML.

    Well, yes.
    I have added the kXML package to the project, I just don't know which clas to use if the XML exists on the device, rather than a server - or if I need more than one.

  • Preverification Error while using kXML with Netbeans IDE

    Hello All,
    I am using Netbeans IDE for wrting a program that parses a xml using
    kXML and display some results on screen.
    The Netbeans IDE gives the various obfuscation levels.
    The code is properly compiled at any level less than the
    highest obfuscation level. If I compile it at HIGH obfuscation level then it gives the following error-----
    Error preverifying class e
    VERIFIER ERROR e.a(Ll;)Lorg/kxml/kdom/Element;:
    Cannot find class org/kxml/kdom/Element
    D:\Netbeans_Workspace\TestObfuscation\nbproject\build-impl.xml:269: Preverification failed with error code 1.
    BUILD FAILED (total time: 4 seconds)
    How can we obfuscate the program using highest level of obfuscation.
    Thanks
    Vikas

    Thanks Peace,
    But I am facing the same problem even when I use the source java files of kXML and include those in my project and use them as additional classes to my class.
    It again builds properly when I don't use the highest obfuscation level.
    But if I try to obfuscate using Level HIGH it throws the same error.
    However when I try to run this project from J2ME Wireless Toolkit, it is running fine on the emulator.
    I guess the error is something specific to Netbeans IDE. Have anyone of you encountered such a bizzare error.
    Thanks,
    Vikas

  • MHP + NanoXML combo

    Hi,
    I'm trying to read an XML file using xletview and nanoXML, using the following code:
    try {
    IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
    IXMLReader reader = StdXMLReader.fileReader("books.xml");
    parser.setReader(reader);
    IXMLElement xml = (IXMLElement) parser.parse();
    XMLWriter writer = new XMLWriter(System.out);
    writer.write(xml);
    } catch (Exception e) {
    e.printStackTrace();
    It compiles without a problem, but it won't read the file. I get a FileNotFoundException, and I have no idea why. I also tried absolute URLs, but without success.
    Has anyone else encountered this problem? Does anyone knows how to fix it?

    Alright, I switched to nanoXML Lite, and parsing a local file works fine now.
    However, I'm still having problems with parsing xml files located on a web server. Is this even possible in MHP?
    If so, what is the correct approach? Right now I'm trying to get access via URL and InputStream classes, but without success.

  • Kxml vs kxml2 vs wbxml4j

    Hi, All
    Could you explain differences between kxml and kxml2 java libs? The main question - what versions of oma dm supports kxml2 wbxml parcer ? Only 1.2 or previous too ?
    Also, what is better - wbxml4j or kxml or kxml2 ? What opensource stuff can I use, what to have best support of wbxml transformations ?
    Thanks in advance.

  • Parsing the xml data

    Hi,
    i have the mehtods in proxy class. those methods are return the data as string. and all the data is in an XML format. now i want to parse that data to normal doc and convert into string form. give me the solution.
    Thanks

    sailesh is right! kXML is very popular pasrer for J2ME apps.
    Its pull type parser, 3 main things about kXML
    1. Reads a little bit of a document at once.
    2. Parser goes through the document by repeatedly requesting the next piece.
    3. Best suitable for J2ME application as take comparatively less memory and processing than other type of parser.
    For resource-constrained devices following parsers are frequently used -
    1. kXML
    Written exclusively for the J2ME platform (CLDC and MIDP).
    http://kxml.objectweb.org/software/downloads/
    2. NanoXML
    Version 1.6.8 for MIDP, supports DOM parsing.
    http://nanoxml.cyberelf.be/download.html
    I have used kXML and found it the best!
    Regards,
    Rohan Chandane

  • Where to locate Class XmlParser??

    Hi,
    I compiled sample code from this site and I got error while building it....can anybody quickly point the solution?
    I am using WTK 2.0...This is the output ...
    C:\WTK22\apps\Sun\src\RSSParser.java:40: cannot find symbol
    symbol : class XmlParser
    location: class RSSParser
    XmlParser parser = new XmlParser(reader);
    ^
    C:\WTK22\apps\Sun\src\RSSParser.java:40: cannot find symbol
    symbol : class XmlParser
    location: class RSSParser
    XmlParser parser = new XmlParser(reader);
    ^
    C:\WTK22\apps\Sun\src\RSSParser.java:41: cannot find symbol
    symbol : class ParseEvent
    location: class RSSParser
    ParseEvent pe = null;
    ^
    C:\WTK22\apps\Sun\src\RSSParser.java:44: cannot find symbol
    symbol : variable Xml
    location: class RSSParser
    parser.read(Xml.START_TAG, null, "rss");
    ^
    C:\WTK22\apps\Sun\src\RSSParser.java:46: cannot find symbol
    symbol : variable Xml
    location: class RSSParser
    parser.read(Xml.START_TAG, null, "channel");
    ^
    C:\WTK22\apps\Sun\src\RSSParser.java:52: cannot find symbol
    symbol : variable Xml
    location: class RSSParser
    if (pe.getType() == Xml.START_TAG) {
    ^
    C:\WTK22\apps\Sun\src\RSSParser.java:57: cannot find symbol
    symbol : variable Xml
    location: class RSSParser
    while ((pe.getType() != Xml.END_TAG) ||
    ^
    C:\WTK22\apps\Sun\src\RSSParser.java:60: cannot find symbol
    symbol : variable Xml
    location: class RSSParser
    if (pe.getType() == Xml.START_TAG &&
    ^
    C:\WTK22\apps\Sun\src\RSSParser.java:65: cannot find symbol
    symbol : variable Xml
    location: class RSSParser
    else if (pe.getType() == Xml.START_TAG &&
    ^
    C:\WTK22\apps\Sun\src\RSSParser.java:70: cannot find symbol
    symbol : variable Xml
    location: class RSSParser
    else if (pe.getType() == Xml.START_TAG &&
    ^
    C:\WTK22\apps\Sun\src\RSSParser.java:79: cannot find symbol
    symbol : variable Xml
    location: class RSSParser
    while ((pe.getType() != Xml.END_TAG) ||
    ^
    C:\WTK22\apps\Sun\src\RSSParser.java:84: cannot find symbol
    symbol : variable Xml
    location: class RSSParser
    if (pe.getType() == Xml.END_TAG &&
    ^
    12 errors
    com.sun.kvem.ktools.ExecutionException
    Build failed
    regards,
    Momi

    thanks Supareno!!
    anyways,i didnt create any package..Do i still need to add external jar???
    here is the output:
    C:\WTK22\apps\XMLTEST\src\XMLTest.java:79: newPullParser() in org.xmlpull.v1.XmlPullParserFactory cannot be applied to (java.io.InputStreamReader)
               XmlPullParser xpp =factory.newPullParser(in);
                                         ^
    C:\WTK22\apps\XMLTEST\src\XMLTest.java:101: cannot find symbol
    symbol  : class ParseEvent
    location: class XMLTest
                ParseEvent event = xpp.read();
                ^
    C:\WTK22\apps\XMLTEST\src\XMLTest.java:101: cannot find symbol
    symbol  : method read()
    location: interface org.xmlpull.v1.XmlPullParser
                ParseEvent event = xpp.read();
                                      ^
    C:\WTK22\apps\XMLTEST\src\XMLTest.java:103: cannot find symbol
    symbol  : variable Xml
    location: class XMLTest
                    case Xml.START_TAG:
                         ^
    C:\WTK22\apps\XMLTEST\src\XMLTest.java:108: cannot find symbol
    symbol  : variable Xml
    location: class XMLTest
                    case Xml.END_TAG:
                         ^
    C:\WTK22\apps\XMLTEST\src\XMLTest.java:113: cannot find symbol
    symbol  : variable Xml
    location: class XMLTest
                    case Xml.TEXT:
                         ^
    C:\WTK22\apps\XMLTEST\src\XMLTest.java:118: cannot find symbol
    symbol  : variable Xml
    location: class XMLTest
                    case Xml.END_DOCUMENT:
                         ^
    7 errors
    com.sun.kvem.ktools.ExecutionException
    Build failedCode:
    import java.io.*;
    import java.util.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import org.kxml2.io.*;
    import org.xmlpull.v1.XmlPullParser;
    import org.xmlpull.v1.XmlPullParserException;
    import org.xmlpull.v1.XmlPullParserFactory;
    * Simple MIDlet that demonstrates how an XML document can be
    * parsed using kXML or NanoXML.
    public class XMLTest extends MIDlet {
        // Our XML document -- normally this would be something you
        // download.
        private static String xmlDocument =
            "<list><item>apple</item>" +
                  "<item>orange</item>" +
                  "<item>pear</item></list>";
        private Display display;
        private Command exitCommand = new Command( "Exit",
                                                   Command.EXIT, 1 );
        public XMLTest(){
        protected void destroyApp( boolean unconditional )
                           throws MIDletStateChangeException {
            exitMIDlet();
        protected void pauseApp(){
        protected void startApp() throws MIDletStateChangeException {
            if( display == null ){ // first time called...
                initMIDlet();
        private void initMIDlet(){
            display = Display.getDisplay( this );
            String [] items;
            items = parse( xmlDocument );
            display.setCurrent( new ItemList( items ) );
        public void exitMIDlet(){
            notifyDestroyed();
        // Parses a document using kXML, looking for "item"
        // nodes and returning their content as an
        // array of strings.
        private String[] parse( String xml ){
            try {
                ByteArrayInputStream bin =
                                new ByteArrayInputStream( xml.getBytes() );
                InputStreamReader in = new InputStreamReader( bin );
            XmlPullParserFactory factory = XmlPullParserFactory.newInstance(
               System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null);
               factory.setNamespaceAware(true);
               XmlPullParser xpp =factory.newPullParser(in);
                //XmlParser parser = new XmlParser( in );
                Vector items = new Vector();
                parseItems( xpp, items );
                String[] tmp = new String[ items.size() ];
                items.copyInto( tmp );
                return tmp;
            catch( IOException e ){
                return new String[]{ e.toString() };
        private void parseItems( XmlPullParser xpp, Vector items )
                                         throws IOException {
            boolean inItem = false;
            while( true ){
                ParseEvent event = xpp.read();
                switch( event.getEventType() ){
                    case Xml.START_TAG:
                        if( event.getName().equals( "item" ) ){
                            inItem = true;
                        break;
                    case Xml.END_TAG:
                        if( event.getName().equals( "item" ) ){
                            inItem = false;
                        break;
                    case Xml.TEXT:
                        if( inItem ){
                            items.addElement( event.getText() );
                        break;
                    case Xml.END_DOCUMENT:
                        return;
        // Simple List UI component for displaying the list of
        // items parsed from the XML document.
        class ItemList extends List implements CommandListener {
            ItemList( String[] list ){
                super( "Items", IMPLICIT, list, null );
                addCommand( exitCommand );
                setCommandListener( this );
            public void commandAction( Command c, Displayable d ){
                if( c == exitCommand ){
                    exitMIDlet();
    }

  • XML parser for commercial application.

    J2ME doesn't have a built in XML parser, which is actually pretty surprising. I know several J2ME compatible parsers exist like kXML and Xparse, but they are both licensed under the GNU Public License. In using these, doesn't that mean the entire project has to be "open source" to honor the license? This doesn't seem to be a good idea for a commercial product, so can anyone recommend any other way to parse XML?
    Thanks

    How can we parse a XML file without giving the tagname(Element name for checking)?........

  • Threading long operations

    Hi
    In our J2ME-project we execute long operations like parsing (with KXml) and network activity in a separate worker thread, so the UI keeps "responsive" . Whats about operations like inserting or retrieving small amount of data (until 15 KB) from the recordstore? Is the recordstore perfomant enough or do you recommend to put it's operations in a separate thread too?
    Regards
    Michael

    v$session_longops will keep only the portions it can calculate the timed operations for and that are taking over a certain period of time. These would include full table scans, parallel query, sorting and a few others. The table being queried must also meet certain criteria. A long running session could have multiple parts to it thus some portions of the execution are obtainable through v$session_longops and others or not. You have probably had a couple that were eligible, but the transaction is still taking place but is not eligible for v$session_longops.
    Lee

  • TinyXML,NanoXML,KXML etc..

    Hi there..
    I need to use any one the above parser for parsing the xml document which is in String format..Can u help
    in how to actually put all the required parser classes into Midp applications..or either to set classpath for that parser..
    Mail me ASAP..[email protected],[email protected]
    with regds,
    Senthil.

    I have been using KXML successfuly. I recommend downloading the code and compiling it along with the rest of your application.
    The code is available through www.kxml.org.
    Go to the downloads section (on the left hand side) and download the kxml-source.zip.
    You will also find some examples there that are fairly straight forwards.
    Post back if you need more help than this.

  • How to use the API Tinyxml or Nanoxml?

    Hi all,
    I'm developing a application that need to read a XML file. I researched in the internet and found some API's for read xml files (KXML, Nanoxml and Tinyxml).
    I made a xml parser using the kxml but I want to make other parsers using others API's for to see the best API for to use.
    thanks

    I found the following tutorial. But this is in C language.
    http://www.grinninglizard.com/tinyxmldocs/tutorial0.html
    I achieve make a XML parser using KXML, but the others API cited above I found C tutorial only.

  • How to parse xml (kXML)

    I have some problems when I try to parse xml with the kXML parser. My xml doc looks like this:
    <?xml version="1.0" encoding="utf-8" ?>
    - <dsGreenRoom>
    - <Rooms>
    - <RoomsInfo>
    <ID>1</ID>
    <Name>Rum 101</Name>
    <Type>Dubbelrum</Type>
    <NumberOfBeds>2</NumberOfBeds>
    <Rate>980,00</Rate>
    <Currency>SEK</Currency>
    <Description>Ett genomtrevligt rum</Description>
    </RoomsInfo>
    - <RoomsInfo>
    <ID>2</ID>
    <Name>Mellanrummet</Name>
    <Type>Enkelrum</Type>
    <NumberOfBeds>1</NumberOfBeds>
    <Rate>650,00</Rate>
    <Currency>SEK</Currency>
    <Description>Ett litet tr?ngt rum i mitten</Description>
    </RoomsInfo>
    - <RoomsInfo>
    <ID>3</ID>
    <Name>Rum 102</Name>
    <Type>Flerb?ddsrum</Type>
    <NumberOfBeds>3</NumberOfBeds>
    <Rate>1250,00</Rate>
    <Currency>SEK</Currency>
    <Description>Ett ?nnu trevligare rum</Description>
    </RoomsInfo>
    </Rooms>
    </dsGreenRoom>
    And my code looks like this:
    KXmlParser parser = new KXmlParser();
                   parser.setInput(is, null);
                   Document doc = new Document();
                   doc.parse(parser);          
                   int child_count = root.getChildCount();
                   System.out.println("child = " + child_count + "\n");
                   for (int i=0; i < child_count; i++) {
              if (root.getType(i) == Node.ELEMENT) {
                   Element kid = root.getElement(i);
                        System.out.println("kid = " + kid.getName());
                   int babies = kid.getChildCount();
                   System.out.println("babies = " + babies);
                   for (int j=0; j < babies; j++) {
                        if (kid.getType(j) == Node.ELEMENT) {
                             Element room = kid.getElement(j);
                             System.out.println("room.getType() = " + room.getType(j));
                        if (room.getName().equals("ID")) {
              System.out.println("elName.getName() = " + room.getName());
              System.out.println("elName.geText() = " + room.getText(j));
              else if (room.getName().equals("Name")) {
              System.out.println("elName.getName() = " + room.getName());
              System.out.println("elName.geText() = " + room.getText(j));
                   } // end for(int j...)
              } // end if (root.getType(i)
              } //for (int i...)
    The problem is that I don't know how to get the values out of the tags:
    <ID>1</ID>
    <Name>Rum 101</Name>
    <Type>Dubbelrum</Type>
    <NumberOfBeds>2</NumberOfBeds>
    <Rate>980,00</Rate>
    <Currency>SEK</Currency>
    <Description>Ett genomtrevligt rum</Description>
    It's no problem to get the value from the firsts i.e. <ID> but I don't know how to get the value from <Name> ... <Description>. I have looked att examples but I don't understand how to do this. Can someone please help me =)

    okay, sorry, I only read the half of your problem ;-)
    You can read the content using the getText(0) method. the 0 indicates the number of the children which you want to get. That is always a 0 because you have always just one text-children in your text-tags. The content is again a children of type text!
    hth
    Kay

  • Query on using kXML parser

    Hi everyone,
    I am writing code to parse a xml document using the kXML parser. My xml document consists of attributes within the tag. My code compiles but when i run i get org.kxml.io.ParseException.
    Something which i found was that, this exception occurs only when there is some attribute within the tag.
    Why is this happening. anyone can help me?
    I would be grateful
    Thanks

    I am using kxml as well to parse a xml file and it's attributes. It works great for me. The ParseException is probably only thrown when you got an illegal xml file (no correct format) I guess.
    But post some code and check your xml file.

Maybe you are looking for

  • While installing the query,i am getting one error

    Hi all, I am installing the inventory queries with grouping options only necessary and install option is simulate installation and i collected the object and install. this is the process i followed,but i am getting the below stated error. can anyone

  • Color shift printing from Lightroom 1.3

    Windows Vista, HP officejet Pro L7580 printer, Lightroom 1.3, Photoshop CS3. All that being said and having used Photoshop since ver 5 with a variety of printers I find myself stumped with my latest soup of hardware and software. Screen colors do not

  • Responsibilities missing in Oracle Applications

    Hi, I have a Production Environment of Oracle Application in 12.0.4. After assigning certain responsibilities, we are not able to view those responsibilities after logging into application. As per metalink note: 417439.1, I have followed the below st

  • W2k file migration to 10.4 server

    after transfering 800gb from a win 2k box via FTP to the xserve with 10.4 i've run into issues with illustrator files. I believe this is a resource fork issue. The problem is with fonts and barcodes, and linked images in some illustrator files. what

  • Restoring System Preferences in Mavericks with Time Machine

    I'm trying to get back to an earlier version of the System Preferences with Time Machine.  All goes well until I hit restore, and then I get the notification that ""System Preferences" can't be modified or deleted because it's required by OS X."    A