473,806 Members | 2,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xml parsing: newby

I'm trying to parse a xml bookmarkpage with php. I found a very useful
example script about how you can parse a xml document with php. The
scriptworks really smooth. The xml test document (See ‘Testxml'
beneath) is parsed correctly and with the php sniplet:

$counting=count ($xmlC->obj_data->DATA[0]->IP_RECORD); //to find out
the number of elements in the array

I can figure out how much IP_RECORD elements (=2) there are in the
DATA array. But the bookmarks xml file (see the ‘bookmarks xml'
beneath the ‘Testxml' document ) has a totally different structure
which looks very strange to me if you compare it with the ‘Testxml'
document. There are no unique tagnames to seperate the different
bookmarks so I have no idea how to filter out the 6 bookmarks
elements.
I'm a xml newby so probably this notation is not strange at all and a
piece of cake....well I'm anctious to know if somebody can spread some
light on this matter.

Thank you for your attention,

Marco

//*************** **************T estxml********* *************** *******
<?xml version="1.0" encoding="utf-8" ?>
<DATA>
<REPORT_DATE> 02-Sep-2004</REPORT_DATE>
<IP_RECORD>
<ADDRESS>00.00. 00.00</ADDRESS>
<HOSTNAME>super fries.net</HOSTNAME>
<OWNER>VanGoghl aan 12, 2011 JL Amsterdam</OWNER>
</IP_RECORD>

<IP_RECORD>
<ADDRESS>11.11. 11.11</ADDRESS>
<OWNER>2011 JL Amsterdam, Netherlands</OWNER>
</IP_RECORD>
</DATA>

//*************** **************b ookmarksxml**** *************** ************
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Children </key>
<array>
<dict>
<key>Children </key>
<array>
<dict>
<key>URIDiction ary</key>
<dict>
<key></key>
<string>http://superfries.net/</string>
<key>lastVisite dDate</key>
<string>1185081 22.5</string>
<key>title</key>
<string>superfr ies.net</string>
</dict>
<key>URLStrin g</key>
<string>http://superfries.net/</string>
<key>WebBookmar kType</key>
<string>WebBook markTypeLeaf</string>
<key>WebBookmar kUUID</key>
<string>53C0420 6-154C-11D9-87E6-000A27AF41A0</string>
</dict>
<dict>
<key>URIDiction ary</key>
<dict>
<key></key>
<string>http://groups.google.c om/groups?hl=en&am p;lr=&amp;ie=UT F-8&amp;oe=UTF-8&amp;threadm=3 f5c2d06%40news. comindico.com.a u&amp;rnum=2&am p;prev=/groups%3Fhl%3De n%26lr%3D%26ie% 3DUTF-8%26oe%3DUTF-8%26q%3Dmac%2Bb ittorent%2Bsite s%26btnG%3DSear ch</string>
<key>lastVisite dDate</key>
<string>1049303 96.2</string>
<key>title</key>
<string>Googl e Groups:ViewThre ad "huge bittorent site
list"</string>
</dict>
<key>URLStrin g</key>
<string>http://groups.google.c om/groups?hl=en&am p;lr=&amp;ie=UT F-8&amp;oe=UTF-8&amp;threadm=3 f5c2d06%40news. comindico.com.a u&amp;rnum=2&am p;prev=/groups%3Fhl%3De n%26lr%3D%26ie% 3DUTF-8%26oe%3DUTF-8%26q%3Dmac%2Bb ittorent%2Bsite s%26btnG%3DSear ch</string>
<key>WebBookmar kType</key>
<string>WebBook markTypeLeaf</string>
<key>WebBookmar kUUID</key>
<string>2632B28 4-99CF-11D8-97AF-000A27AF41A0</string>
</dict>
<dict>
<key>URIDiction ary</key>
<dict>
<key></key>
<string>http://www.apple.com/</string>
<key>title</key>
<string>Apple </string>
</dict>
<key>URLStrin g</key>
<string>http://www.apple.com/</string>
<key>WebBookmar kType</key>
<string>WebBook markTypeLeaf</string>
<key>WebBookmar kUUID</key>
<string>52B4335 3-97CE-11D8-80C7-000A27AF41A0</string>
</dict>
</array>
<key>Title</key>
<string>QuickTi me</string>
<key>WebBookmar kType</key>
<string>WebBook markTypeList</string>
<key>WebBookmar kUUID</key>
<string>52B65E1 4-97CE-11D8-80C7-000A27AF41A0</string>
</dict>
</array>
<key>Title</key>
<string>Importe d IE Favorites</string>
<key>WebBookmar kType</key>
<string>WebBook markTypeList</string>
<key>WebBookmar kUUID</key>
<string>52B52DF C-97CE-11D8-80C7-000A27AF41A0</string>
</dict>
</array>
<key>WebBookmar kFileVersion</key>
<integer>1</integer>
<key>WebBookmar kType</key>
<string>WebBook markTypeList</string>
<key>WebBookmar kUUID</key>
<string>52B42B9 F-97CE-11D8-80C7-000A27AF41A0</string>
</dict>
</plist>
Jul 20 '05 #1
0 1593

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

Similar topics

2
2501
by: marco | last post by:
Hello to you all, A question from a PHP newby who is disorientated by the overwhelming amount of existing example scripts. -- What is the best/simplest way to parse out the links in a a HTML document and putting them in an array? -- Some hints, functions or snipplets would be highly appreciated.
9
2608
by: Damien | last post by:
I have just built a simple stopwatch application, but when i f5 to get things goings i get this message, An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll Additional information: Overflow or underflow in the arithmetic operation.
0
1841
by: Pete | last post by:
Hi All, A total Newby with, possibly, a daft question? However, until I can get a reasonable explanation I am disinclined towards going further. Here goes: I recently downloaded the latest stable release and once activated it requested access to the net. Without access it would come up with recognition and 'localhost' connection errors? Can anyone please tell me:
8
1835
by: Ask | last post by:
G'day All, Just thought I'd drop in and say hi. I'm new to Python, but old to software development. Python is one of the languages used in my new job, so I've just bought a book, read it, and downloaded Python; It's pretty good isn't it? It's particularly handy being able top run the same bytecode on different platforms.
10
2940
by: Fred Nelson | last post by:
Hi: I have programmed in VB.NET for about a year and I'm in the process of learing C#. I'm really stuck on this question - and I know it's a "newby" question: In VB.NET I have several routines that upload and process images. I can't get past "square one" with images in C#: This statement:
4
357
by: Fred Nelson | last post by:
I have an applicatioin that I'm writing that uses a "case" file that contains over 350 columns and more may be added in the future. I would like to create a dataset with all the column names and only one case record that is delivered by a stored procedure. (I have a stored procedure that works so my question is only on loading the DataSet.) The DataSet will only be used for printing form letters and then will be zapped. I would like...
4
1284
by: Fred Nelson | last post by:
Hi: I'm developing a web application that needs to have five values, each retrieved from cookies on many pages. If I have five "Request.Cookies" commands together does this cause five "round trips" to the browser or am I accessing one instance. If five round trips occur then I will develop some parsing algorithm to save everything I need in one cookie.
2
4161
by: Fred Nelson | last post by:
Hi: I'm working on a VS2005 web application and I have what is probabably a "newby" question. In VS2003 I could drag a textbox/button/etc on to a form and position it with the mouse. I converted an app to VS2005 and this still worked. In VS2005 I can't do this. I have examined the code for VS2003 and I see that there is a style="Z-INDEX... " in the asp code for the
2
3713
by: johnnyG | last post by:
Greetings, I'm studying for the 70-330 Exam using the MS Press book by Tony Northrup and there are 2 side-by-side examples of using the SHA1CryptoServiceProvider to create a hash value from a string. The vb example outputs "A94A8FE5CCB19BA61C4C0873D391E987982FBBD3" The cs example outputs "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8" for the string "password" Question: do the 2 applications use different automatic "salts" or "seeds" to...
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10623
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9192
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3852
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.