xml parsing in android from local file -


I purse the XML data several times successfully, though it does this for the first time in my Android. I usually try to use dom, but every time. An error occurs on the error method. I searched online and tried many times without success. I need to do something to get XML data from a local file in order to place logic in some functions. I have implemented the code in the main method of the CREAT method. This is what I am doing, but this time without any success:

  try {file xmlFile = new file ("C: \\ Users \\ gg90 \\ Desktop \\ testxml .xml "); Documentbilder factory dbfc = documentbilderfactor.Newinstance (); DocumentBuilder debugger = DBFTC NE DocumentBuilder (); Document doctor = debugger Parse (xmlfile); Doc.getDocumentElement () Normal () .;   

Hope you can help me thanks!

There is no concept of Drive C: Android, so I think your file is invalid and parser Choke on it Android uses a Unix file system, so the path looks like /data/file.xml and so on.

To parse XML file in the Asset folder, which opens the folder, receives the file and opens an input stream and then calls.

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -