473,387 Members | 1,791 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,387 software developers and data experts.

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

//*****************************Testxml************** *****************
<?xml version="1.0" encoding="utf-8" ?>
<DATA>
<REPORT_DATE>02-Sep-2004</REPORT_DATE>
<IP_RECORD>
<ADDRESS>00.00.00.00</ADDRESS>
<HOSTNAME>superfries.net</HOSTNAME>
<OWNER>VanGoghlaan 12, 2011 JL Amsterdam</OWNER>
</IP_RECORD>

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

//*****************************bookmarksxml********* **********************
<?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>URIDictionary</key>
<dict>
<key></key>
<string>http://superfries.net/</string>
<key>lastVisitedDate</key>
<string>118508122.5</string>
<key>title</key>
<string>superfries.net</string>
</dict>
<key>URLString</key>
<string>http://superfries.net/</string>
<key>WebBookmarkType</key>
<string>WebBookmarkTypeLeaf</string>
<key>WebBookmarkUUID</key>
<string>53C04206-154C-11D9-87E6-000A27AF41A0</string>
</dict>
<dict>
<key>URIDictionary</key>
<dict>
<key></key>
<string>http://groups.google.com/groups?hl=en&amp;lr=&amp;ie=UTF-8&amp;oe=UTF-8&amp;threadm=3f5c2d06%40news.comindico.com.au&amp ;rnum=2&amp;prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Dmac%2Bbittorent%2Bsites%26btnG%3DSearch</string>
<key>lastVisitedDate</key>
<string>104930396.2</string>
<key>title</key>
<string>Google Groups:ViewThread "huge bittorent site
list"</string>
</dict>
<key>URLString</key>
<string>http://groups.google.com/groups?hl=en&amp;lr=&amp;ie=UTF-8&amp;oe=UTF-8&amp;threadm=3f5c2d06%40news.comindico.com.au&amp ;rnum=2&amp;prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Dmac%2Bbittorent%2Bsites%26btnG%3DSearch</string>
<key>WebBookmarkType</key>
<string>WebBookmarkTypeLeaf</string>
<key>WebBookmarkUUID</key>
<string>2632B284-99CF-11D8-97AF-000A27AF41A0</string>
</dict>
<dict>
<key>URIDictionary</key>
<dict>
<key></key>
<string>http://www.apple.com/</string>
<key>title</key>
<string>Apple</string>
</dict>
<key>URLString</key>
<string>http://www.apple.com/</string>
<key>WebBookmarkType</key>
<string>WebBookmarkTypeLeaf</string>
<key>WebBookmarkUUID</key>
<string>52B43353-97CE-11D8-80C7-000A27AF41A0</string>
</dict>
</array>
<key>Title</key>
<string>QuickTime</string>
<key>WebBookmarkType</key>
<string>WebBookmarkTypeList</string>
<key>WebBookmarkUUID</key>
<string>52B65E14-97CE-11D8-80C7-000A27AF41A0</string>
</dict>
</array>
<key>Title</key>
<string>Imported IE Favorites</string>
<key>WebBookmarkType</key>
<string>WebBookmarkTypeList</string>
<key>WebBookmarkUUID</key>
<string>52B52DFC-97CE-11D8-80C7-000A27AF41A0</string>
</dict>
</array>
<key>WebBookmarkFileVersion</key>
<integer>1</integer>
<key>WebBookmarkType</key>
<string>WebBookmarkTypeList</string>
<key>WebBookmarkUUID</key>
<string>52B42B9F-97CE-11D8-80C7-000A27AF41A0</string>
</dict>
</plist>
Jul 20 '05 #1
0 1554

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

Similar topics

2
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...
9
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...
0
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...
8
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...
10
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...
4
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...
4
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...
2
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...
2
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
0
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.