I don't have any progress to bring javax.xml.xpath to android 2.0.1 I am rewriting my application using dom4j. Downloaded the dom4j- full.jar I have seen some tutorial at http://www.javabeat.net/articles/44-introduction-to-dom4j-1.html
Everything is working fine with this api. But i am unable to get attribute names/values In this case it is behaving differently For example my xml file is as follows <Database name="App" format="text"> <Info format="plain" level="2">Name</Info> </Database> I want to get attributes of Info Node This is my sample code String xmlFileName = "sample.xml"; String xPath = "//Database/Info"; Document document = getDocument( xmlFileName ); List<Node> nodes = document.selectNodes( xPath ); for (Node node : nodes) { String value = node.valueOf( "@format" ); This is giving null value If i queering for attribute name it is working fine. I observed that only the first attribute it is recognizing } } The same code is working fine in pure java application Is any one tested this on android Any help please On Dec 28, 4:40 pm, kiran <saikiran....@gmail.com> wrote: > I gone through the following post > > http://stackoverflow.com/questions/4367855/attempt-to-include-a-core-... > > Now the compilation is success. But during run time i got the > following error messages as follows > > 12-28 16:42:33.096: INFO/dalvikvm(281): Could not find method > javax.xml.xpath.XPathFactory.newInstance, referenced from method > com.android.util.createxml > 12-28 16:42:33.106: WARN/dalvikvm(281): VFY: unable to resolve static > method 1071: Ljavax/xml/xpath/XPathFactory;.newInstance ()Ljavax/xml/ > xpath/XPathFactory; > 12-28 16:42:33.106: DEBUG/dalvikvm(281): VFY: replacing opcode 0x71 at > 0x0001 > 12-28 16:42:33.106: DEBUG/dalvikvm(281): Making a copy of Lcom/sct/ > syncml/dm/client/common/utils/Util;.checkForNode code (210 bytes) > 12-28 16:42:33.116: INFO/dalvikvm(281): Could not find method > javax.xml.transform.TransformerFactory.newInstance, referenced from > method com.android.util.saveXml > 12-28 16:42:33.126: WARN/dalvikvm(281): VFY: unable to resolve static > method 1061: Ljavax/xml/transform/TransformerFactory;.newInstance > ()Ljavax/xml/transform/TransformerFactory; > 12-28 16:42:33.126: DEBUG/dalvikvm(281): VFY: replacing opcode 0x71 at > 0x0000 > > On Dec 21, 3:30 pm, saikiran n <saikiran....@gmail.com> wrote: > > > > > > > > > Hi, > > android is supporting javax.xml.xpath.XPath in api level 8 ie 2.2 > > But i am writing some application for 2.0.1 in that there is a need for > > XPath parser. > > I downloaded jar file from findjar.com > > But when i added the jar file to my application i got the following build > > error > > > trouble processing "javax/xml/XMLConstants.class": > > [2010-12-21 15:49:59 - Client] > > Attempt to include a core class (java.* or javax.*) in something other > > than a core library. It is likely that you have attempted to include > > in an application the core library (or a part thereof) from a desktop > > virtual machine. This will most assuredly not work. At a minimum, it > > jeopardizes the compatibility of your app with future versions of the > > platform. It is also often of questionable legality. > > > If you really intend to build a core library -- which is only > > appropriate as part of creating a full virtual machine distribution, > > as opposed to compiling an application -- then use the > > "--core-library" option to suppress this error message. > > > If you go ahead and use "--core-library" but are in fact building an > > application, then be forewarned that your application will still fail > > to build or run, at some point. Please be prepared for angry customers > > who find, for example, that your application ceases to function once > > they upgrade their operating system. You will be to blame for this > > problem. > > > If you are legitimately using some code that happens to be in a core > > package, then the easiest safe alternative you have is to repackage > > that code. That is, move the classes in question into your own package > > namespace. This means that they will never be in conflict with core > > system classes. If you find that you cannot do this, then that is an > > indication that the path you are on will ultimately lead to pain, > > suffering, grief, and lamentation. > > > [2010-12-21 15:49:59 - Client] 1 error; aborting > > [2010-12-21 15:49:59 - Client] Conversion to Dalvik format failed with error > > 1 > > > Any help please, > > Thanks > > saikiran -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en