Re: [PHP] Parsing XML

2008-12-01 Thread Nathan Rixham
Per Jessen wrote: Ashley Sheridan wrote: [/snip] :p XSL(T) an xslt processor, along with an XSLT stylesheet, should be used to transform XML documents in to other XML, human readable or structured documents. DOM a class implementing the DOM interface should be used to traverse, analyse and

Re: [PHP] Parsing XML

2008-12-01 Thread Per Jessen
Ashley Sheridan wrote: >> Roughly like this: (this is from a project I'm currently working >> on). >> >> -- >> // create the xslt processor object >> if ( FALSE===($xp=new XSLTProcessor()) ) { print "unable to create >> xslt engine"; return FALSE; } >> >> // Load the XML source >> $

Re: [PHP] Parsing XML

2008-12-01 Thread Ashley Sheridan
On Mon, 2008-12-01 at 21:35 +0100, Per Jessen wrote: > Ashley Sheridan wrote: > > > I still disagree, as using XSL is essentially converting the XML to > > another format, > > Which is all you're doing when you're extracting parts of an XML > document. > > > which is then being used by PHP. X

Re: [PHP] Parsing XML

2008-12-01 Thread Per Jessen
Ashley Sheridan wrote: > I still disagree, as using XSL is essentially converting the XML to > another format, Which is all you're doing when you're extracting parts of an XML document. > which is then being used by PHP. XSL is great for some tasks, but for > this, I think having a good PHP X

Re: [PHP] Parsing XML

2008-12-01 Thread Ashley Sheridan
On Mon, 2008-12-01 at 11:28 +0100, Per Jessen wrote: > Peter Ford wrote: > > > Per Jessen wrote: > >> > >> That's cool, but XSL is still the more appropriate tool IMO. It does > >> exactly what you need - it parses and validates the XML document, > >> allows you to extract the bits you need and

Re: [PHP] Parsing XML

2008-12-01 Thread Per Jessen
Peter Ford wrote: > Per Jessen wrote: >> >> That's cool, but XSL is still the more appropriate tool IMO. It does >> exactly what you need - it parses and validates the XML document, >> allows you to extract the bits you need and in virtually any format >> you need - which could be a text documen

Re: [PHP] Parsing XML

2008-12-01 Thread Peter Ford
Per Jessen wrote: > Ashley Sheridan wrote: > >> On Fri, 2008-11-28 at 10:15 +0100, Per Jessen wrote: >>> Ashley Sheridan wrote: >>> Do any of you have a copy of this extension, or failing that, a suggestion of how I can parse XML files without having to install anything on the remot

Re: [PHP] Parsing XML

2008-11-29 Thread Ashley Sheridan
On Fri, 2008-11-28 at 20:39 +0100, Per Jessen wrote: > Andrew Ballard wrote: > > >> XSL will only allow me to convert it into a different document > >> format, which is not what I want as I need to keep a local copy of > >> information in a database for searching and sorting purposes. Nathans > >>

Re: [PHP] Parsing XML

2008-11-28 Thread Per Jessen
Andrew Ballard wrote: >> XSL will only allow me to convert it into a different document >> format, which is not what I want as I need to keep a local copy of >> information in a database for searching and sorting purposes. Nathans >> class allows me to have the entire document put into an array tr

Re: [PHP] Parsing XML

2008-11-28 Thread Andrew Ballard
On Fri, Nov 28, 2008 at 5:45 AM, Ashley Sheridan <[EMAIL PROTECTED]> wrote: > On Fri, 2008-11-28 at 10:15 +0100, Per Jessen wrote: >> Ashley Sheridan wrote: >> >> > Do any of you have a copy of this extension, or failing that, a >> > suggestion of how I can parse XML files without having to install

Re: [PHP] Parsing XML

2008-11-28 Thread Ashley Sheridan
On Fri, 2008-11-28 at 13:14 +0100, Per Jessen wrote: > Ashley Sheridan wrote: > > > On Fri, 2008-11-28 at 10:15 +0100, Per Jessen wrote: > >> Ashley Sheridan wrote: > >> > >> > Do any of you have a copy of this extension, or failing that, a > >> > suggestion of how I can parse XML files without h

Re: [PHP] Parsing XML

2008-11-28 Thread Per Jessen
Ashley Sheridan wrote: > On Fri, 2008-11-28 at 10:15 +0100, Per Jessen wrote: >> Ashley Sheridan wrote: >> >> > Do any of you have a copy of this extension, or failing that, a >> > suggestion of how I can parse XML files without having to install >> > anything on the remote server, as I do not ha

Re: [PHP] Parsing XML

2008-11-28 Thread Ashley Sheridan
On Fri, 2008-11-28 at 10:15 +0100, Per Jessen wrote: > Ashley Sheridan wrote: > > > Do any of you have a copy of this extension, or failing that, a > > suggestion of how I can parse XML files without having to install > > anything on the remote server, as I do not have that level off access > > to

Re: [PHP] Parsing XML

2008-11-28 Thread Per Jessen
Ashley Sheridan wrote: > Do any of you have a copy of this extension, or failing that, a > suggestion of how I can parse XML files without having to install > anything on the remote server, as I do not have that level off access > to it. Parsing XML is best done with XSL - if that's out of the qu

[PHP] Parsing XML

2008-11-27 Thread Ashley Sheridan
Hi All, I've run into a bit of a problem. I need to parse some fairly detailed XML files from a remote website. I'm pulling in the remote XML using curl, and that bit is working fine. The smaller XML documents were easy to parse with regular expressions, as I only needed bit of information out of

RE: [PHP] Parsing XML with DTD

2007-11-22 Thread Andrés Robinet
> -Original Message- > From: Skip Evans [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 22, 2007 5:35 PM > To: Jochem Maas > Cc: PHP-General > Subject: Re: [PHP] Parsing XML with DTD > > Hey Jochem & all, > > Thanks much for this tip. I will c

Re: [PHP] Parsing XML with DTD

2007-11-22 Thread Skip Evans
Hey Jochem & all, Thanks much for this tip. I will check it out. A little further reading looks like PEAR provides some XML and DTD capabilities? Anyone have any experience with this? Also, the reason I asked about the DTD is that these XML files are really extensive, providing lots of var

Re: [PHP] Parsing XML with DTD

2007-11-22 Thread Jochem Maas
Skip Evans wrote: > Hey all, > > I've been asked if it's possible to parse XML files given a DTD file > that describes the elements within it, so I've been looking through the > docs at php.net. > > So far I've found this: > > http://us.php.net/manual/en/ref.xml.php > > Which has some samples o

Re: [PHP] Parsing XML with DTD

2007-11-22 Thread Per Jessen
Skip Evans wrote: > I've been asked if it's possible to parse XML files given a DTD file > that describes the elements within it, Yes it is. > Which has some samples on, but nothing that I see > will take a DTD file and parse the XML accordingly. > I'm thinking something like this is probably

[PHP] Parsing XML with DTD

2007-11-22 Thread Skip Evans
Hey all, I've been asked if it's possible to parse XML files given a DTD file that describes the elements within it, so I've been looking through the docs at php.net. So far I've found this: http://us.php.net/manual/en/ref.xml.php Which has some samples on, but nothing that I see will tak

Re: [PHP] Parsing XML with php

2005-05-16 Thread Christian Stocker
On 5/12/05, Burhan Khalid <[EMAIL PROTECTED]> wrote: > Merlin wrote: > > Hi there, > > > > I am curious if PHP is now able to pars xml without aditional tools like > > xmlrpc. > > If yes which version is required? Is the current php 4.x tree sufficient? > > 4.x requires the expat parser (so I gues

Re: [PHP] Parsing XML with php

2005-05-12 Thread Burhan Khalid
Merlin wrote: Hi there, I am curious if PHP is now able to pars xml without aditional tools like xmlrpc. If yes which version is required? Is the current php 4.x tree sufficient? 4.x requires the expat parser (so I guess it would require external libs). 5.x has the simplexml extension (which I bel

[PHP] Parsing XML with php

2005-05-11 Thread Merlin
Hi there, I am curious if PHP is now able to pars xml without aditional tools like xmlrpc. If yes which version is required? Is the current php 4.x tree sufficient? Thanx, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] parsing xml the right way

2004-04-01 Thread Merlin
Hi there, I think I am parsing xml documents the wrong way. There must be a better way to access the results laterone like objects. For example I would like to search in a free form for a city name inside an xml document and php should return the country name and continent. This is the xml structu

[PHP] Parsing XML CDATA errors?

2003-03-30 Thread Toby Coleridge
I am trying to parse an XML file that looks like the following snippet: 12/03/03 New benefits to members however it will not parse (doesnt display anything) when I put the CDATA line on

Re: [PHP] Parsing XML files, logic involved...

2002-11-27 Thread Khalid El-Kary
hi, If you are sure that all your files come with attributes double quoted (not single quoted) you may want to use this parser class: http://creaturesx.ma.cx/kxparse/ hint: use the function has_attribute() to verify whether an attribute is available Regards, khalid ___

[PHP] Parsing XML files, logic involved...

2002-11-27 Thread Jeff Lewis
I have to write a script to parse XML files we receive daily. The XML files are all individual stories but there is an index page that comes with each batch that contains blocks of information for each story as follows (below). I need to run through this index file and for each story I need to g

Re: [PHP] Parsing XML into PHP array.

2002-08-02 Thread Analysis & Solutions
> I send the XML request in a string to the > credit bureau through cURL and vice versa. Most of the PHP scripting I > found everywhere spoke about breaking up the xml tag into the array only > when they come from the file and is use for parsing. The example on my page you looked at does get the

[PHP] Parsing XML into PHP array.

2002-08-02 Thread Scott Fletcher
I'm having trouble getting the XML string to be broken up into the PHP array. Here's how it work. I send the XML request in a string to the credit bureau through cURL and vice versa. Most of the PHP scripting I found everywhere spoke about breaking up the xml tag into the array only when they c

[PHP] PHP parsing XML from Shoutcast

2002-05-19 Thread Johan Ekström
Anyone that has knowledge about this program, regarding it's XML output and php fetching that info and placing it on a php-page for user's to view? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Parsing XML

2002-04-30 Thread Fredrik Arild Takle
Hi, this might be a silly question, but I really haven't used XML alot with PHP. I've parsed som XML, when I do xml_parse it outputs the html-codes. I want to make a variable out of it.. I've tried $output = xml_parse(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

Re: [PHP] parsing xml/string

2002-01-16 Thread Hank Marquardt
I guess I'd setup a global array $TAGS, create an entry in the array with your open_tag handle, $TAGS[$tagnamepassedtohandler], use the data handler to populate it $TAGS[$currenttag].=$data; When you're done parsing the xml you have one big array with all the tags that you can either use extract

[PHP] parsing xml/string

2002-01-16 Thread Sandeep Murphy
Hi, I have an xml output with tags like 123 sands I could parse the output using expat to display it the way i want or as a string but what I need is to store the values separately in different variables like $id for sessionid, $user for user and so on.. to be manipulated later... Any suggest

Re: [PHP] Parsing XML

2001-11-13 Thread Ben Gollmer
Oops, forgot a line: On Tuesday, November 13, 2001, at 08:58 PM, Ben Gollmer wrote: > Do something like this: > > function parseXML($xmlFile) > { global $attributeArray; > $theParser = xml_parser_create(); > xml_set_element_handler($theParser, "startElementHandler", > "endE

Re: [PHP] Parsing XML

2001-11-13 Thread Ben Gollmer
Do something like this: function parseXML($xmlFile) { $theParser = xml_parser_create(); xml_set_element_handler($theParser, "startElementHandler", "endElementHandler"); //parse your XML here return $attributeArray; } function startElementHandler($theParser, $the

[PHP] Parsing XML

2001-11-13 Thread Michael Harris
Can anybody tell me if there is a way to build an array or some other means of collecting the attributes from the Start Element Handler so I can return them back to my main application? Thanks for any help, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

Re: [PHP] parsing XML turorials, suggestions

2001-10-29 Thread Christian Reiniger
On Monday 29 October 2001 16:25, bill wrote: > Need to get started parsing XML documents. I've developed a program to > write them XML a database, but now I need to read them to obtain, for > example, the (cdata) value of which is nested inside , > etc. > > What's the best place to start? Does

[PHP] parsing XML turorials, suggestions

2001-10-29 Thread bill
Need to get started parsing XML documents. I've developed a program to write them XML a database, but now I need to read them to obtain, for example, the (cdata) value of which is nested inside , etc. What's the best place to start? Does DOMXML have a future? Tutorials? Suggestions? kind re

[PHP] PArsing xml document with php

2001-07-11 Thread Francis Fillion
I'm trying to parse a xml document in php and to get in an array, but it sometime give me really strange result. Like if I have: $simple=" test "; $parser = xml_parser_create(); xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); xml_parse_into_struct($parser,$simple,$vals,$index); xml_par

Re: [PHP] Parsing XML CDF format in PHP3 - Stumbling over

2001-03-29 Thread David Robley
On Fri, 30 Mar 2001 14:34, Mike Gifford wrote: > Hello, > > For some reason I am now having real difficulties removing and parsing > some XML files. I think that if I can just strip out the that > I should be able to parse the XML (.CDF) file. This should do it: > $pagetext = eregi_replac

[PHP] Parsing XML CDF format in PHP3 - Stumbling over

2001-03-29 Thread Mike Gifford
Hello, For some reason I am now having real difficulties removing and parsing some XML files. I think that if I can just strip out the that I should be able to parse the XML (.CDF) file. This should do it: $pagetext = eregi_replace('','',$pagetext); I've attached the whole CDF file at

Re: [PHP] Parsing XML

2001-02-11 Thread Richard Lynch
> I want to parse an XML from nasdaq, but I allways get a blank page when > doing so. You're gonna have to provide more info than that... > I also get the notice: undefined index when parsing. What does this mean? If error_reporting is set to include E_NOTICE, and if you attempt to access an a

Re: [PHP] Parsing XML the Sequel :)

2001-02-10 Thread Matt McClanahan
On Sat, Feb 10, 2001 at 07:37:32PM +0100, Steve Haemelinck wrote: > The page I want to parse is: > > http://213.224.136.110:8080/test.xml > > And this is my code: > > > //Define Opening Tags of XML > $open_tags = array( > 'STORY' => '', > 'STOCK_NAME' => '', > 'LAST_SALE' => '', > 'PREVIOUS_

[PHP] Parsing XML the Sequel :)

2001-02-10 Thread Steve Haemelinck
The page I want to parse is: http://213.224.136.110:8080/test.xml And this is my code: '', 'STOCK_NAME' => '', 'LAST_SALE' => '', 'PREVIOUS_CLOSE' => '', 'NET_CHANGE_PCT' => '', 'STOCK_URL' => ''); //Define Closing Tags of XML $close_tags = array( 'STORY' => '', 'STOCK_NAME' => '', 'LAST_SALE

[PHP] Parsing XML

2001-02-10 Thread Steve Haemelinck
I want to parse an XML from nasdaq, but I allways get a blank page when doing so. I also get the notice: undefined index when parsing. What does this mean? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC