[thelist] [PHP] parsing xml

Paul Bennett paul at teltest.com
Sun Aug 24 23:24:42 CDT 2003


Greetings fellow 'volters

I am parsing an xml file from a seperate application and placing the 
data into a database.
The parser I have developed is very simple and works. However, when I 
received a sample file from said "other application" developers, I 
noticed that there are multiple instances of the same tag which would 
currently choke my parser.

Example 1:
The parent tag for each major data grouping is:
"Programme"
This tag name also appears under the node "Fees", thus my parser thinks 
that when it hits this tag that the programme information is complete 
and all heckfire breaks loose.

Example 2:
The title of each "Programme" is contained within the tag "Title", but 
this tag also is present under a node named "Careers"
[Insert sobbing sound here]

I have discussed this with the developers who insist it cannot be changed.
My questions are:  will I be able to distinguish parent nodes with PHP 
xml parsing functions in order to determine if I at the end of a 
programme or merely parsing the "Programme" associated with the "Fees"?
If so, how? (links to tutorials etc or RTFM (I have) stuff  are fine)

Many thanks,

-- 
 ------------------------------
	Paul Bennett						
	Internet Developer				
	Teltest Electronic Design		
 ------------------------------			
Email: paul at teltest.com				
Phone: 64 4 237 4557					
Web: http://www.teltest.com		
Wap: http://wap.teltest.com			




More information about the thelist mailing list