phpxpath-users Mailing List for Php.XPath (Page 20)
Brought to you by:
bs_php,
nigelswinson
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(346) |
Nov
(8) |
Dec
(21) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(30) |
Feb
(13) |
Mar
|
Apr
(3) |
May
(70) |
Jun
(26) |
Jul
(48) |
Aug
(22) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
|
2003 |
Jan
(3) |
Feb
(3) |
Mar
(11) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2004 |
Jan
(4) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(12) |
Aug
(8) |
Sep
(2) |
Oct
(2) |
Nov
(3) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2006 |
Jan
(3) |
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: <an...@is...> - 2001-10-08 16:05:30
|
On Wed, 18 Jul 2001, Ni...@Sw... wrote: > The class doesn't support this. More accurately the evaluate() > function doesn't support this. You'll have to break into the > $object->nodes array to get this information if you are not happy with > using string processing on the XPath addresses. > > I'm afraid this isn't an XPath question. There is no magic XPath expression that will do this for you. > > Try calling print_r($Object) and you will learn about the internal > structure of the class, and which array to examine. I would advise > that you do not use "back doors" into the class however, and that you > use string routines to obtain the array that you desire from running > evalutate('/publication/*'). Luckily/Unluckily PHP doesn't really > support the concept of 'private' class data. I found that class supports get_name($node) method, but it operates only on individual nodes. Might be nice to have get_names($nodes) as well. -Andrei * Ethernet n.: something used to catch the etherbunny. * -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 16:03:56
|
Hello, The following is not directly phpxml related but is strongly phpxml use related so I hope this will not annoy anybody. Question #1 =========== Is there somewhere a set of standard dtd to be used in a web site ? I know the easy quick answer to this is : docbook I had a quick look at the 26543658876 pages documentation without understanding how this works and how to use it in real life normal web site (I don't intend to publish a Boeing 747 documentation). Used in a "normal" web site context this looks very much like hunting a mosquito using missiles. What I'm looking for is a set of dtd describing a text, a menu, a newsfeed and so on. I use home made ones and I'm not sure there are the most clever possible :- ) Question #2 =========== What is the difference about attribute and element ? I know what the difference is. I mean in the context of phpxml is there a benefit to use one or the other. For example is : <address street_name= "foo street" street_number = "65" town ="foo city" country="foo land"/> the same in term of php processing efficiency, memory use and so on than : <address> <street_name>foo street</street_name> <street_number>65</street_number> <town>foo city</town> <country>foo land</country> </address> TIA Luc -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <mf...@mr...> - 2001-10-08 16:02:20
|
Hello Maciej Kus, > . Can you suggest a solution that might solve this problem. > I need to obtain paths to nodes in the same order as in xml. > waiting for help. :) > > Maciej Kus Use the cheap built in sequential XML parser functions of php like xml_parser_create - create an XML parser xml_set_element_handler - set up start and end element handlers xml_set_character_data_handler - set up character data handler xml_parse - start parsing an XML document ... and so on (see the php documentation searching with keyword "XML parser functions" ). They are exactly designed for sequential reading the xml file whereas the <phpxml/> or the xml dom are needed if you want to be independent from the sequential structure of the xml data. -- Marko Faldix M+R infosysteme Hubert-Wienen-Str. 24 52070 Aachen Tel.: 0241-93878-16 Fax.:0241-875095 E-Mail: mf...@mr... -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <bl...@io...> - 2001-10-08 15:59:11
|
Get! I will download and try... Thanks, Robby -----Original Message----- From: nig...@us... [mailto:nig...@us...] Sent: Friday, August 31, 2001 10:27 AM To: us...@li... Subject: [phpXML] Re: [phpXML] AW: [phpXML] get_file() function > > I am relatively new to the XML realm but have some good > > experience with PHP. > > I was wondering if anyone could send a code sample of a simple use of the > > get_file() function used as follows: > > > > 1. Read in XML and write out the contents to a new XML document. I am > > really just look for the behavior of the function. > > 2. Using a form to submit data, formatting that based on a coded template > > in XML string and writing out to file. > > > > If anyone has some code samples of this, I would greatly > > appreciate viewing > > them. > > > > Thank you, > > > > Robby > > If you are new to phpxml, then the very first thing you should do is get V1.N.4 from the below link. Otherwise you'll just end up finding all the bugs we found in the last 3 months. Also phpxmldb will give you examples of quite a lot of the calls, and there's quite good debugging to be found too. V1.0 won't do a very good job of read in and write back out to another XML file, but V1.N.4 will. Nigel =========================== For the most recent version of phpxml, V1.N.X, and an archive of this list visit: http://www.sourceforge.net/projects/phpxmldb -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <nig...@us...> - 2001-10-08 15:57:15
|
> Or if you don't have enough time, just tell me what is now the right > version of this code that worked with xml.php/1N4 : > > <buddy_list> > <buddy id="1"> > <lastname>Doe</lastname> > <firstname>John</firstname> > <isniceguy>Yes</isniceguy> > </buddy> > </buddy_list> > > $myatrributesarray = array(); > $listofmybuddies = $xml->evaluate('/buddy_list/buddy'); > foreach ( $listofmybuddies as $buddy ) > { > $myatrributesarray = $xml->get_attributes($buddy); > $id = $myatrributesarray['id'] > $firstname = $xml->get_attributes($buddy ."/firstname[1]"); > $lastname = $xml->get_content($buddy ."/lastname[1]"); > $isniceguy = $xml->get_content($buddy ."/isniceguy[1]"); > } Along the lines of: $myatrributesarray = array(); $listofmybuddies = $xml->evaluate('/buddy_list/buddy'); foreach ( $listofmybuddies as $buddy ) { $myatrributesarray = $xml->getAttributes($buddy); $id = $myatrributesarray['id']; // Well this is what you wrote, but for your XML fragment this will return a // null array.... $firstname = $xml->getAttributes($buddy ."/firstname[1]"); $lastname = $xml->getData($buddy ."/lastname[1]"); $isniceguy = $xml->getData($buddy ."/isniceguy[1]"); // Or: $lastname = $xml->substringData($buddy ."/lastname[1]"); $isniceguy = $xml->substringData($buddy ."/isniceguy[1]"); // Or $lastname = implode('', $xml->getDataParts($buddy ."/lastname[1]")); $isniceguy = implode('',$xml->getDataParts($buddy ."/isniceguy[1]")); } Should all be in the online documentation, ie what function replaces what: http://www.carrubbers.org/scripts/php/xmlphp/doc/PhpXmlDocumentation.php Nigel -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <nig...@us...> - 2001-10-08 15:55:41
|
I think there are many more places where you forgot to add the $this-> f= or example in the setAttribute function.=20 Agree, found another couple too =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D For the most recent version of phpxml, V1.N.X, and an archive of this list = visit: http://www.sourceforge.net/projects/phpxmldb -- This message has been sent through the <phpXML/> user discussion list. To u= nsubscribe, please visit https://sslsites.de/mailinglisten/user/user@lists.= phpxml.org/ |
From: <inf...@aj...> - 2001-10-08 15:44:47
|
Bonjour luc, Le samedi 7 juillet 2001 à 09:10:32, vous écriviez : lsec> '//agenda/month[@name="$month_name"]'); It's not phpXml but an error with your PHP coding : Between single quotes PHP doesn't calculate/evaluate the variables if you make this test : $month_name = 18; echo '//agenda/month[@name="$month_name"]'; You will obtain this output : //agenda/month[@name="$month_name"] To correct you must write : echo "//agenda/month[@name=\"$month_name\"]"; and you will have : //agenda/month[@name="18"] I prefer this : echo sprintf( '//agenda/month[@name="%s"]', $month_name) ; I use echo to demonstrate, you use this in strings.. (Sorry but my english is poor, I hope I help you) -- Cordialement, Daniel mailto:inf...@aj... ---------- Support-Assistance PHP/MySql de «Internet Pour Tous» http://www.i-p-t.com.fr/ :::XML/XSLT - Sablotron::: -- -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <inf...@aj...> - 2001-10-08 15:42:54
|
Bonjour luc, Le samedi 7 juillet 2001 à 09:59:31, vous écriviez : lsec> $sorties = $xml->evaluate('//agenda/month[@name="%s"]', $month_name); No write this : $sorties = $xml->evaluate( sprintf( '//agenda/month[@name="%s"]'), $month_name); -- Cordialement, Daniel mailto:inf...@aj... ---------- Support-Assistance PHP/MySql de «Internet Pour Tous» http://www.i-p-t.com.fr/ :::XML/XSLT - Sablotron::: -- -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <ga...@wh...> - 2001-10-08 15:42:31
|
Hi, We've been using your phpXML class in a project and have come across a problem. Basically, this section of XML below: <paragraph> This is the first <bold>paragraph</bold>. A second is below </paragraph> When we read it in from a file, and do some work on the XML and then re-export it as a file it becomes the following: <paragraph> This is the first . A second is below <bold>paragraph</bold> </paragraph> This obviously isn't correct according to the way the XML went it (and this is an accepted thing to do as in an XML document as far as I am aware) - it appears that phpXML is taking elements that occur within other elements (when the parent element has data) and putting them at the end of the parent's content. Has this problem been identified before and, if so, does anybody have a work-around for it as we're quite a way into the project now and we don't really want to remove phpXML from it. If anybody does have any ideas I'd appreciate hearing them :) Regards, Gareth Lancaster -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 15:40:56
|
Liz, I use phpxml for the same reason. In order to have a correct output I had to empty the array entities (near line 123 var $entities = array ( ); Luc At 03:09 24/07/01 +0000, you wrote: >HI > >I am using xmlphp on a site that retreives an XML file from another server. >The XML file contains >CDATA Sections. >When I try to display the contents of the XML file in a table in HTML to a >browser all the apostrophe characters within the CDATA Section are being >rendered as &apos as in (Picket's) (Picket&aposs). (I haven't checked to see >if other General Entity type characters do this also.) >The results page's source code shows (Picket&aposs)..... missing semi-colon? > >In the original XML file, the character is typed as a ' and not as the >entity '. > >Any ideas out there of what is going on and how I could correct the HTML >display? > >Thankz for any adive you can give. :-) > >Liz -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <tom...@di...> - 2001-10-08 15:39:21
|
As is described (aka RTFM ;-) in the ZVON tutorial http://www.zvon.org/xxl/XPathTutorial/General/examples.html //month[@name='January'] At 11:09 PM 7/6/01 +0000, lu...@sa... wrote: ><agenda> > <month name="January"> > <event> > <date/> > <location> > <name/> > <address/> > <town/> > <country/> > </location> > <phone/> > <email/> > <web/> > <description/> > </event> > </month> > >Thanks in advance > >Luc > > >-- >This message has been sent through the <phpXML/> user discussion list. To >unsubscribe, please visit >https://sslsites.de/mailinglisten/user/us...@li.../ -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <nig...@us...> - 2001-10-08 15:37:47
|
Just to let you know that the broken search facility at the geocrawler arch= ive is a known bug and I have posted a support request at sourceforge.net. = There seem to be several such postings, so it has been known about for som= e time, and sadly I don't think we'll see a resolution in the near future..= .. So in the mean time if we are very clear with our email subjects then we'll= all find the archive more useful. Nigel -- This message has been sent through the <phpXML/> user discussion list. To u= nsubscribe, please visit https://sslsites.de/mailinglisten/user/user@lists.= phpxml.org/ |
From: <pie...@si...> - 2001-10-08 15:36:13
|
I tried to use the phpxml package (latest version on http://www.phpxml.org/) but i encountered errors when running the included example files. Even a very simple test i made generated an error : <? require getenv('DOCUMENT_ROOT') . '/../common/xml.php'; $doc = new XML('base.xml'); echo $doc->get_file(); ?> The base.xml document contains only this : <?xml version="1.0" encoding="iso-8859-1"?> <test> </test> I expected this to just display this simple XML document, but instead it generated errors : <br> <b>Warning</b>: Undefined index: /test in <b>/www/wine/common/xml.php</b> on line <b>443</b><br> <br> <b>Warning</b>: Undefined index: in <b>/www/wine/common/xml.php</b> on line <b>456</b><br> <br> <b>Warning</b>: Undefined index: in <b>/www/wine/common/xml.php</b> on line <b>464</b><br> <test/> All examples in the package (governement, xpath) generated simular problems. What am i doing wrong ?.. Pieter Bosteels i-Merge -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <flo...@co...> - 2001-10-08 15:34:36
|
Actually, after a couple of hours of testing, I can't do something with it: I'm trying to get the value of an argument from a know element. for exemple, my xml file (successfully validated) begin like that: <list> <document> <content category=3D"journal" revision=3D"0.1.b"/> <date revision=3D"2000-12-31 15:54:00" = revision_datestamp=3D"9945456654" creation=3D"2000-12-31 15:54:00" creation_datestamp=3D"9945456654"/> . . . </document> </list> and I don't know how to get //list/document/date/@creation (those XPath request works with the enlightning script exemple) If i do (based on the German government reasearch tool): <? $xml =3D new XML("test.xml"); $test =3D $xml->evaluate("//list/*"); ?> here is the title : <? echo $xml->get_content($doc."/title[1]"); ## this works fine. ?><br> here is the creation date : I don't know how to get it!! Thank's for your help. -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <ti...@di...> - 2001-10-08 15:33:02
|
At 03:46 PM 9/27/2001 +0000, you wrote: > > I completely agree with this! :( > > HTML mails really s.... > >Well sorry I completely don't. :o) I'm sorry if this causes >inconvenience, but that is what multipart/alternative was created for, and >that's what I send and that's what I will continue to send. I know much of >the CS world uses Pine and other CMD line mailers, but the additional >formatting that html allows makes it my preferred choice of mail format First of all it's a long standing unwritten rule of listserves that you should only post plain text email messages. Also don't be sorry for causing inconvenience just stop causing that inconvenience in the first place. It's much easier for you send your email as plain text then for everybody else to switch their email readers. Exactly what do you get out of send out HTML email in the first place? >May I recommend IMAP to you all (as an alternative to POP or telnet), then >you can access your mailbox using any gui on any OS using a wide variety of >mail clients (including pine/elm/etc). Failing that just switch to a mailer >that supports multipart/alternative MIME body parts, then you'll never see >the "ugly" html body parts. Or perhaps you could write youself a mail >script that filters out "Content-Type: text/html;" MIME body parts when >there is a text/plain available? IMAP has nothing to do with it. And once again why should we have to write scripts or switch our favorite email clients just because you are too lazy click one button and turn off HTML email. >Sorry. Don't be sorry just turn it off. :wq Tim Uckun US Investigations Services/Due Diligence http://www.diligence.com/ -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <fra...@vi...> - 2001-10-08 15:31:26
|
Well what I think is that if you put <br> </br> in your text it will be evaluated as markup, well the xml_parser_* method of PHP do get it as markup because in a regular way it is. Well after testing it myself, since I never send html in my xml, it will remove your <br> </br> from your output data (get_content, get_attributes, didn't test they other one). phpxml convert < to get ride of bad xml or to be sure that 10<20 (< can not be use in xml data) will not be used as markup, it shouldn't need to convert > because that is a valid character ... For myself I strip all html data before going in that function (I have a list of tag that I accept, my xml markup) all they other have there < replaced with < and an error message is displayed. I wonder if people will like a little function that I have made, it's not perfect (still testing) but it use phpxml to get your xml document as array, like this: <myxml> <test> <data>Hello world</data> </test> </myxml> $myxml[test][data] = Hello World or something like this. ber...@or... wrote: > > Litl question: what is the array $entities for ? > The content is not converted as it should be, nothing happens - or I just > didnt get the point. > > Why I need this: a must use breaks ( <br> ), &, and other special > characters... > > Hope someone understands me.... > > Cheers ben > > -- > This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ -- Francis Fillion, BAA SI Broadcasting live from his linux box. And the maintainer of http://www.windplanet.com -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 15:29:53
|
Hello, I had a lot of problem with this entities array, problems that disappeared when I emptied the array. I don't know if this break something for a general XML use, but for parsing xml to be displayed as HTML, its much more convenient to empty it. Luc At 19:29 07/07/01 +0000, you wrote: >Hello, > >I have the following in an XML file: > ><title>DTD's & schema</title> > >Using <phpXML/>, I extract that string using get_content() and >display it on a web page. For some reason, the spaces around the >ampersand are removed. > >Does someone have a fix for this? Any help would be really >appreciated. > >Also, there is a bug on line 125: "&apos" should be "'". To >make things more troublesome, it looks like Internet Explorer (at >least mine!) doesn't recognize ' but will recognize '. > >Young -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 15:28:16
|
At 19:41 01/08/01 +0000, flo...@co... wrote: >Actually, after a couple of hours of testing, I can't do something with >it: >I'm trying to get the value of an argument from a know element. >for exemple, my xml file (successfully validated) begin like that: > ><list> ><document> > <content category="journal" revision="0.1.b"/> > <date revision="2000-12-31 15:54:00" revision_datestamp="9945456654" >creation="2000-12-31 15:54:00" creation_datestamp="9945456654"/> $blocs = $xml->evaluate('/list/date'); foreach ( $blocs as $bloc ) { $t = $xml->get_attributes( $bloc); $revision = $t['revision']; $revision_datestamp = $t['revision_datestamp']; $creation = $t['creation']; etc... <french> Les attributes sont dans un array </french Luc -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 15:26:41
|
To be clear about my message: It was by no mean an aggressive one, I just wanted to be clear about this new start. Ive suffered it several times, a fork is the best way to screw up things, and I use a lot phpxml so Id be very worried if it disappeared . XML is not something very supported in the PHP world, and they are not a huge lot of alternatives to phpxml. So congratulations to Nigel the new maintainer and keep cool every body : -) Luc En réponse à mf...@mr...: > Hoi, > > > Sorry if my question is stupid.. is this a fork ??? > > I don't know every technical term yet: What is a fork? > Instrument to eat? > > As long as sourceforge doesn't work I am very relieved > Nigel summarizes the > different fixes and want him to go ahead with it. > -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <aj...@ho...> - 2001-10-08 15:25:07
|
My file's header just says 1.0, no more details than that. But, I downloaded the latest and the suspect area seems to be unchanged. Here is what I believe is suspect. The are that begins as follows, on line 1492: // Check whether the operator is a - sign. if ( $operator == "-" ) My xpath looks like this: //map/association[translate(@from-class,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdef ghijklmnopqrstuvwxyz')='User']"; When I remove the hyphen from the dtd, schema, xpath, etc, the query works find. But, with a hyphen, the class strips the hyphen and returns an empty result. I could just remove the hyphen forever, but the hyphen is valid as far as I know. So, I'll continue to look at the code. -----Original Message----- From: nig...@us... [mailto:nig...@us...] Sent: Friday, August 24, 2001 5:22 PM To: us...@li... Subject: [phpXML] Re: [phpXML] xpath bug with hyphens > I have defined a schema that has nodes with attributes that contain hyphens. > The xpath processor appears to not like this. Has anyone experienced this? > Has anyone found this and already fixed it? I don't believe anyone has found this to be a bug yet. Are you using version 1.N.4? > Is there an archive of the mailing list? The links you are looking for are: http://www.sourceforge.net/projects/phpxmldb Follow the mail list links to find a geocrawler archive of this list. Nigel -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <an...@is...> - 2001-10-08 15:23:29
|
On Wed, 18 Jul 2001, Ni...@Sw... wrote: > //*[starts-with(name(),'image')] > > You could also use //*[contains(name(),'image')] but that will get slightly different results. > > Please read the tutorial at ZVON that Michael recommended. You'll find several answers there including this one. > > http://www.zvon.org/xxl/XPathTutorial/General/examples.html I did read it and tried to apply the expression. It seems that phpXML doesn't support nested function calls. phpXML error: While parsing an XPath expression there was found an error in the predicate "//*[contains(name(),'image')]", because after a closing bracket there was found something unknown. -Andrei Windows 2000 is certified not to crash more than once a day, so what is the bootup time, 24 hours? -- Sam Liddicott -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 15:21:56
|
Hello, Please forget my previous post, the answer is : $file = 'foo.xml'; $xml_data = $tpl->fetch($file); $xml = new XML(); // without mention if the file $xml->load_string ($xml_data); Luc At 18:55 24/07/01 +0000, lu...@sa... wrote: >Hello, > >void XML ([string $file]) loads a file. > >How to process a XML stream coming from another processing ? > >I need to do something like : > >$file = 'foo.xml'; >$xml_data = $tpl->fetch($file); >$xml = new XML($xml_data); > >But this fails... I don't find in the doc a constructor taking a XML file >as a string as argument. > >Thanks in advance > >Luc -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <jvo...@wi...> - 2001-10-08 15:20:21
|
Hello all, I'm new to using the phpxml script and I can't seem to get a basic example using the get_content() function to work. I was wondering if someone might be willing to point me in the right direction here. I feel as though I'd be on my way if I could only understand why such a simple example won't work. I've included the two files below (test.php and test.xml) Any help would be very much appreciated. Thanks in advance for your time, John Vollmer ******test.php********** <html> <head> <title>xpath testing</title> </head> <body> <?php //include the phpxml class include("xml.php"); // bring in the xml $xml = new XML("test.xml"); //get content of the item element $content = $xml->get_content("/root/item"); //print the node's content echo "Content: ".$content; ?> </body> </html> *********test.xml*********** <?xml version="1.0"?> <root> <item>content</item> </root> -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 15:18:36
|
Nigel, I'm not sure the problem lies in my XML files, I think it lies in the way I didn't modify my php file. At : http://www.interpasnet.com/1.N.5/examples/government/index.php You'll find Michael P. Mehl. government example with only two changes : 1) call to (include) php file xplath.class.php instead of xml.php 2) call to class XPath instead of XML (like in $xml = new XPath($file);) try it with for example the key word "Gerhard" The result is the same : phpXML error: While parsing an XPath expression there was an error in the predicate "Gerhard", because it was the null string. If you wish to seach for the empty string, you must use ''. Luc At 23:42 25/09/01 +0000, you wrote: > > Error is : > > phpXML error: While parsing an XPath expression there was an error in the > > predicate "1", because it was the null string. If you wish to seach for >the > > empty string, you must use ''. > >Try replacing line 1997 with: > > if (ereg('^[[:space:]]*$', $predicate)) > > >it was: > > if (ereg('^\w*$', $predicate)) > > >But I'm not sure if \w is trying to match a word, not whitespace. I can't >find a useful posix reference, but I know that it should be \s in perl >regexes... > >If you could hone down which evaluate() call makes this error, and perhaps >send a small subset of xml and evaluate call that makes the error, then we >can add a test to catch this error. As such I haven't been able to >reproduce the error, and I'm forbidden to access >http://www.interpasnet.com/xml_files/cachecache/cachecache.xml directly. -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <lu...@sa...> - 2001-10-08 15:13:42
|
Hello, Sorry if my question is stupid.. is this a fork ??? Luc At 23:55 22/07/01 +0000, Ni...@Sw... wrote: >Spotted a major blunder in 1.N.3. Well only major if you are using >operators in your XPath searches. They all end up getting evaluated as mod >as I missed the break statements from the switch block. This means you >often get div/0 errors as false is interpreted as 0. > >Oops. Sorry :o) > >Also made what I think is quite an important optimisation to some of the >evaluate() private functions so that searches with fully qualified node >positions will take 3 less function calls than they were. > >http://sourceforge.net/projects/phpxmldb/ > >Nigel -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |