473,397 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How to get an XML DOM while offline?

I want to parse my iTunes Library xml. All was well, until I unplugged
and left for the train (where I get most of my personal projects
done). All of a sudden, I discovered that apparently the presence of a
DOCTYPE in the iTunes XML makes xml.dom.minidom insist on accessing
the Internet... So suddenly I was unable to do any work.

I don't want to modify the iTunes XML; iTunes rewrites it too often.
How can I prevent xml.dom.minidom from dying when it can't access the
Internet?

Is there a simpler way to read the iTunes XML? (It's merely a plist,
so the format is much simpler than general XML.)

-Wm
Mar 19 '08 #1
2 1252
"Diez B. Roggisch" <de...@nospam.web.dewrote:
The most pragmatic solution would be to rip the doctype out using simple
string methods and/or regexes.
Thank you, Diez and Paul; I took Diez's solution, and it works well
enough for me.
Diez
-Wm
Mar 31 '08 #2
william tanksley wrote:
I want to parse my iTunes Library xml. All was well, until I unplugged
and left for the train (where I get most of my personal projects
done). All of a sudden, I discovered that apparently the presence of a
DOCTYPE in the iTunes XML makes xml.dom.minidom insist on accessing
the Internet... So suddenly I was unable to do any work.

I don't want to modify the iTunes XML; iTunes rewrites it too often.
How can I prevent xml.dom.minidom from dying when it can't access the
Internet?

Is there a simpler way to read the iTunes XML? (It's merely a plist,
so the format is much simpler than general XML.)
Try lxml. Since version 2.0, its parsers will not access the network unless
you tell it to do so.

http://codespeak.net/lxml

It's also much easier to use than minidom and much faster:

http://blog.ianbicking.org/2008/03/3...r-performance/

Stefan
Apr 7 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: qwweeeit | last post by:
Hi all, with my last initiative (logging by intercepting open calls) I succeded (with the essential help of Fredrik Lundh), but I must confess that the method is too complicated... I think that...
0
by: moko | last post by:
This is a bit long-winded. Can somebody read thru these 2 use cases, and tell me if it is feasible ? :- Use Case : Replication before Offline Synch Scenario 1 : Oracle Server , MSDE client ...
1
by: pHines | last post by:
I have my entire source code directory available on my laptop via Offline Files. The directory structure is housed on my server and made available offline on the laptop using Windows 2000. When I...
3
by: Robert Scheer | last post by:
Hi. When IE is offline and I try to create a new web application, I receive an error that says that I need IE online in order to create the new application. What is the relationship of IE and...
2
by: John | last post by:
Hi I need to develop an app in vb 2005 which can work in both offline and online modes and will be running on client laptops. I have listened to the following web cast; ...
2
by: John | last post by:
Hi I need to write a vb2005/sql server2005 app running over a LAN. Some users who use laptop need to have the app to have an offline mode for when they are away. I am new to net and would like...
4
by: manwiththeaxe.70 | last post by:
I have recently begun to migrate our DB2 UDB v7.2 enterprise databases up to DB2 UDB v8.2. One question I can't seem to understand is why would I want to run an offline backup for a database now...
3
by: Alex | last post by:
Hello, I am running an Access 2003 database, quite modest in size, that is used by upwards of 5 users. I need to modify the database such that these users can work simultaneously and, in some...
2
by: ericthered | last post by:
Hi, I am trying to create an offline database in VB.NET 2005, both the online and offline database use SQL Server 2005. The code I am using seems to run OK with out an exception the DATASET has the...
10
by: Michael Hoffmann | last post by:
Hello, I hope this doesn't come across as totally newbieish, but I've been searching the web and the IBM docs until smoke is coming out of my head. Scenario: We are trying to take primitive...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.