phpxpath-users Mailing List for Php.XPath (Page 6)
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: Jens H. <Jen...@we...> - 2002-07-22 11:57:09
|
I downloaded the new version (v3.2) of the class an half hour ago and = now i had to realise that the file output is no longer formatted. Example: (old php.xpath output to file) <aaa> <bbb/> <ccc>text</ccc> </aaa> (new php.xpath output to file) <aaa><bbb/><ccc>text</ccc></aaa> I cannot believe that this was intended... |
From: Peter R. <php...@pe...> - 2002-07-22 11:10:18
|
On Saturday 20 Jul 2002 21:15, Nigel Swinson wrote: > many thanks to all who > submitted reports. many thanks for all your work, Nigel > I've tagged this one as "stable" because it's > been a while since there were any bug reports, but if you spot any, > then let us know and we'll do another release. the sum function no longer seems to work - seems to always return 0. Given: <km>100</km> <km>200</km> evaluate("sum(//km)") should surely return 300. This was working in 3.0. |
From: Nigel S. <nig...@us...> - 2002-07-21 18:41:32
|
Release notes: http://sourceforge.net/project/shownotes.php?group_id=36731&release_id=10078 9 Project home page: http://sourceforge.net/projects/phpxpath At last it is here!! Loads of bug fixes, many thanks to all who submitted reports. I've tagged this one as "stable" because it's been a while since there were any bug reports, but if you spot any, then let us know and we'll do another release. The biggest difference besides minor bug fixes is an internal restructure of the XPath processing engine. This has made it go a little slower, which we can do something about in the future, but it means that the expression parsing matches the expression grammer more closely and allows us to more accurately implement the XPath spec :o) Nigel |
From: Roy <ro...@ea...> - 2002-07-18 15:33:12
|
How does "XML and PHP" compare to "Professional PHP4 XML"? Do they overlap much? I see they've both been published in the last couple of months. http://www.amazon.com/exec/obidos/ASIN/0735712271 http://www.amazon.com/exec/obidos/ASIN/1861007213 Roy At 02:43 AM 7/6/2002 -0700, you wrote: >Yes, this is very sweet. Congrats to everyone for making this >project so sweet. I am definitely going to cruise down to Borders >tomorrow and check it out... |
From: Nigel S. <nig...@us...> - 2002-07-14 01:20:09
|
> On first glance, xpath syntax is very simple, but there are a lot of > pits to fall into :-( Yeah I'm finding loads of them today. I thought XPath was really very very simple, but if you go past the simple queries, it seems to get a little wierd to get just right. Php.XPath currently doesn't cope with a lot of this very well so I'm having a good hack at the moment to bring it up to speed. To my horror I found that a query like this doesn't even work: //*[DDD] :o/ The good news is that it's all slotting together in a much cleaner way now, and the class should be much better because of it. The core XPath code is to a certain degree unchanged from the very original phpxml code that Php.XPath came from. That's all changing now... Nigel |
From: Peter R. <php...@pe...> - 2002-07-12 09:38:23
|
On Friday 12 Jul 2002 02:44, Nigel Swinson wrote: > > //employee[(@gender='m') and (last())] > > And > > //employee[(@gender='m') and (position() = last())] > > Are NOT the same. Because of the "and" operator. <snip snip snip> er, yes. Yes, I think you are right. On first glance, xpath syntax is very simple, but there are a lot of pits to fall into :-( |
From: Nigel S. <nig...@us...> - 2002-07-12 01:48:19
|
(Really old thread alert...) > This is not the same thing. This is the last employee in each parent node if > male (or in my example the last of each tango which is in Paris, i.e. all > tangos in Paris). What I want is the last instance of all male employees, > i.e. > > //employee[@gender='m'][last()] > > should find a1010 and gender = 'f' should find a1006. > > Incidentally, if I try > > //employee[(@gender='m') and (last())] > > I get a different answer to your example. What is this doing? 'Position() = > last()' and 'last()' should surely be identical. //employee[(@gender='m') and (last())] And //employee[(@gender='m') and (position() = last())] Are NOT the same. Because of the "and" operator. what happens is that last() returns a number. The "and" takes two operands that need to be bools, so it has to convert the number from last() into a bool. If you think about it, last() always returns a non zero number, which always converts to TRUE. So for example I got confused by a test that I had that was //*[1 and last()] and was surprised to see that this returned different results to //*[1 and (position() = last())]. //*[1 and last()] actually matched EVERY node in the document. This is because: http://www.w3.org/TR/xpath#section-Node-Set-Functions "The last function returns a number equal to the context size from the expression evaluation context.The last function returns a number equal to the context size from the expression evaluation context." So last returns a non zero number, because context size >= 1. When you convert a non zero number to a bool, you get TRUE. So basically I was doing: //*[1 and TRUE]. So now it's not really surprising that it returned all the nodes. On the other hand, //*[1 and (position() = last())] must now evaluate the "position() = last()" as a bool, which only returns TRUE for the last node in the context. And hence //*[1 and (position() = last())] is the same as //*[(position() = last())] is the same as //*[last()], but is not the same as //*[1 and last()]. Seems a bit bizzare....but means we have less bugs than we'd thought :o) Nigel |
From: Nigel S. <nig...@us...> - 2002-07-11 02:00:48
|
This was because the text nodes weren't in the nodeIndex[]. This has now been fixed. See CVS if you can't wait for the next release. :o) > No matter what your input xml looks like, it seems you cannot use '|' > operator with a combination of textParts and childNodes: > > Xpath->match( "/* | /text()" ) > > results in this message: > XPath error in -:-</b> Results from _InternalEvaluate() are corrupt. Do > you > need to call reindexNodeTree()? > > Given input: > <a>cdata<b>cdata</b></a> > > The following matches work fine: > Xpath->match( "/* | /a/*" ) > Xpath->match( "/text()" ) > Xpath->match( "/a/text()" ) > > The following fail: > Xpath->match( "/text() | /a/text()" ) > Xpath->match( "//text()" ) > > Are these bugs or is my xpath invalid? |
From: Nigel S. <nig...@us...> - 2002-07-11 02:00:44
|
This is now fixed in the version in CVS. :o) > This is not in accordance with the xpath spec which says: > http://www.w3.org/TR/1999/REC-xpath-19991116.html#location-paths > > child::* selects all element children of the context node > child::text() selects all text node children of the context node > child::node() selects all the children of the context node, whatever > their node type > > Given any input, such as: > <a>cdata<b>cdata</b></a> > > The following matches work fine: > Xpath->match( "/*" ) - works fine > Xpath->match( "/text()" ) - works fine > Xpath->match( "/node()" ) - returns only the element children node > set; same as /* > should return same as: Xpath->match( "/* | /text()" ), > which unfortunately also fails in phpXPath > > - Greg |
From: <elm...@t-...> - 2002-07-09 23:03:39
|
Yes, That is coming near to our needs. We can learn from it for the menu definitions. We started to develop an own format now. The working name is CoCoS for Cool Configuration Schema. It will contain different entry types for different tasks, bundeld in an outer XML structure to organize the file with some headlines. XBEL or the example of Nigel can by one of our entry types. Thank you for your useful ideas Elmar Dan Allen wrote: > XBEL!! > > That's what you are looking for. It is the internet standard for > storing hierarchial bookmarks, but which allows for metadata using > custom tags in a particular location, if you wanted to add images, > etc. Check out Galeon or Konqueror projects, as they both use this > format. Here is sample dump: > |
From: Dan A. <da...@mo...> - 2002-07-09 22:40:15
|
XBEL!! That's what you are looking for. It is the internet standard for storing hierarchial bookmarks, but which allows for metadata using custom tags in a particular location, if you wanted to add images, etc. Check out Galeon or Konqueror projects, as they both use this format. Here is sample dump: <xbel version="1.0"> <info> <metadata owner="http://galeon.sourceforge.net/"> <default_folder>yes</default_folder> </metadata> </info> <title>Bookmarks</title> <folder folded="no"> <title>Smart Bookmarks Toolbar</title> <info> <metadata owner="http://galeon.sourceforge.net/"> <create_toolbar>yes</create_toolbar> <toolbar_style>3</toolbar_style> </metadata> </info> <bookmark href="http://www.mysql.com/doc/manual.php?search_query=%25s"> <title>mysql</title> <info> <metadata owner="http://galeon.sourceforge.net/"> <pixmap>/home/dallen/config/images/mysql.png</pixmap> <time_visited>1014678818</time_visited> <time_modified>1014797076</time_modified> <time_added>996206648</time_added> <smarturl>http://www.mysql.com/doc/manual.php?search_query=%s</smarturl> </metadata> </info> </bookmark> </folder> </xbel> Dan -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Daniel Allen, <da...@mo...> http://www.mojavelinux.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - There is no such thing as a casual knowledge of xslt, either you know everything about it or you are sitting in the creek. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
From: <elm...@t-...> - 2002-07-09 12:16:18
|
>>Imagine you could configure all those >>different programms like sendmail, bind, >>apache, php etc. with the same tool, > > > isn't that what webmin does? > On my machine all those programms still have different formats. ;-) I will have a look what webmin is. Maybe it can give me some ideas. Thanks Elmar |
From: Peter R. <php...@pe...> - 2002-07-09 12:02:25
|
On Tuesday 09 Jul 2002 09:19, Elmar Hinz wrote: > > Imagine you could configure all those > different programms like sendmail, bind, > apache, php etc. with the same tool, isn't that what webmin does? istm (as a generalisation :-) that the more general a format is, the less useful it is going to be. |
From: <elm...@t-...> - 2002-07-09 08:15:09
|
> I would just make one up... > > <Menu name="MenuName"> > <Item name="LinkName" target="TargetName" protocol="http"/> > <Item name="LinkName" target="TargetName" protocol="http"/> ... Making one for a special task is more easy. My idea is to find a general format, wich matches the needs of any possible application. Because having a real general format would make it possible to configure all with a general frontend. Imagine you could configure all those different programms like sendmail, bind, apache, php etc. with the same tool, because they all use the same XML configuration format. Elmar |
From: Nigel S. <nig...@us...> - 2002-07-09 01:37:27
|
> This is not in accordance with the xpath spec which says: > http://www.w3.org/TR/1999/REC-xpath-19991116.html#location-paths > > child::* selects all element children of the context node > child::text() selects all text node children of the context node > child::node() selects all the children of the context node, whatever > their node type > > Given any input, such as: > <a>cdata<b>cdata</b></a> > > The following matches work fine: > Xpath->match( "/*" ) - works fine > Xpath->match( "/text()" ) - works fine > Xpath->match( "/node()" ) - returns only the element children node > set; same as /* > should return same as: Xpath->match( "/* | /text()" ), > which unfortunately also fails in phpXPath Agreed. Bug. Many thanks for spotting this. I've added a test to the test harness that demonstrates the bug, but it is as yet not fixed. :o) Nigel |
From: Nigel S. <nig...@us...> - 2002-07-09 01:37:23
|
> No matter what your input xml looks like, it seems you cannot use '|' > operator with a combination of textParts and childNodes: > > Xpath->match( "/* | /text()" ) Agree. Bug, many thanks :o). Have added a test to the test harness that shows the bug, as yet unfixed. Nigel |
From: Nigel S. <nig...@us...> - 2002-07-08 23:58:31
|
> For COOL we are still looking for a > standard xml configuration format, wich > knows nested structures like submenus. I > asked on mozilla..org, but they didn't > seem to know anything about such a > format like a dtd or schema. Do you have > some hints? I would just make one up... <Menu name="MenuName"> <Item name="LinkName" target="TargetName" protocol="http"/> <Item name="LinkName" target="TargetName" protocol="http"/> <Item name="LinkName" target="TargetName" protocol="http"/> <Item name="LinkName" target="TargetName" protocol="http"/> <Menu name="SubMenuName"> <!-- Sub menu --> <Item name="LinkName" target="TargetName" protocol="http"/> </Menu> </Menu> etc etc I've never authored a DTD or a schema... never really needed one. Nigel |
From: <elm...@t-...> - 2002-07-08 23:30:54
|
For COOL we are still looking for a standard xml configuration format, wich knows nested structures like submenus. I asked on mozilla..org, but they didn't seem to know anything about such a format like a dtd or schema. Do you have some hints? Elmar Nigel Swinson wrote: >>The MPL/GPL/LGPL triple seems a solution >> to me, to relicense existing versions >>from MPL to LGPL/GPL without breaking >>the rules of MPL. >> >>Does anybody of the developers has an >>argument why to publish future versions >>under MPL at all? But yes. It is >>certainly the widest range. > > > MPL is even less restrictive than LGPL from my reading... so the triple > seems to make the code even more accessible. I also feel less worried about > adding GPL/LGPL to the MPL license rather than converting the MPL to a > GPL/LGPL. > > >>I thank very much you for your decision. >>I think we can wait a fortnight to >>publish the next minor version of COOL. >>I try to run it with 3.2 then. > > > "Greg's bugs" might delay the next version... but the next version will have > the new license when ever we get round to it... > > :o) > > Nigel > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Oh, it's good to be a geek. > http://thinkgeek.com/sf > _______________________________________________ > Phpxpath-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpxpath-users |
From: Nigel S. <nig...@us...> - 2002-07-08 22:18:30
|
> The MPL/GPL/LGPL triple seems a solution > to me, to relicense existing versions > from MPL to LGPL/GPL without breaking > the rules of MPL. > > Does anybody of the developers has an > argument why to publish future versions > under MPL at all? But yes. It is > certainly the widest range. MPL is even less restrictive than LGPL from my reading... so the triple seems to make the code even more accessible. I also feel less worried about adding GPL/LGPL to the MPL license rather than converting the MPL to a GPL/LGPL. > I thank very much you for your decision. > I think we can wait a fortnight to > publish the next minor version of COOL. > I try to run it with 3.2 then. "Greg's bugs" might delay the next version... but the next version will have the new license when ever we get round to it... :o) Nigel |
From: <elm...@t-...> - 2002-07-06 22:51:43
|
Nigel Swinson wrote: > Ok a quick poll of the developers seemed to agree that we are all happy to > publish Php.XPath under a MPL/GPL/LGPL triple that will maximise the > usefulness of the class while maintaining it's open source nature. > > The license change will go along with the next minor release of Php.XPath, > version 3.2, that will be out as soon as the outstanding XPath bugs have > been fixed, hopefully within a fortnight, but both Sam and I are clogged at > work at the moment. The MPL/GPL/LGPL triple seems a solution to me, to relicense existing versions from MPL to LGPL/GPL without breaking the rules of MPL. Does anybody of the developers has an argument why to publish future versions under MPL at all? But yes. It is certainly the widest range. I thank very much you for your decision. I think we can wait a fortnight to publish the next minor version of COOL. I try to run it with 3.2 then. Regards Elmar |
From: Philipp L. <le...@hi...> - 2002-07-06 12:26:43
|
This is my third project* using that great XPath class. http://opentrivia.com You can go to a category and play a trivia quiz ("Play Standard Version" for the PHP+XPath one), and also submit your questions without registration or any other hassle. Also, the XML files are for download and can be used in your own projects. To view the questions & answers as plain webpage, XML SAX is used -- that was before I heard about the XPath class. I will work some more on the PHP port of the TriviaML interpreter (no support for images right now, and further testing to be done). Feedback welcome! Philipp * My two others are the QML port, and free forum at: http://questml.com/quests/ http://outer-court.com/tech/forum.htm |
From: Nigel S. <nig...@us...> - 2002-07-06 11:35:23
|
> Hello all, > I've just joined the list and am beginning to study phpxpath. Welcome! It's good to have you aboard! > I am wondering why phpxpath doesn't include processing-instructions in > the node structure. Purely because we never got round to it, and as none of our applications have needed them, implementing them hasn't been a priority. This isn't to say that we aren't keen that they be supported eventually! > In my application, I need to include pi's in the document processing. > The following description is in phpxpath class doc: > > * | The main structure of a node is: > * | $node = array( > * | 'name' => '', # The tag name. E.g. In <FOO > bar="aaa"/> it would be 'FOO' > * | 'attributes' => array(), # The attributes of the tag E.g. In > <FOO bar="aaa"/> it would be array('bar'=>'aaa') > * | 'textParts' => array(), # Array of text parts surrounding the > children E.g. <FOO>aa<A>bb<B/>cc</A>dd</FOO> -> > array('aa','bb','cc','dd') > * | 'childNodes' => array(), # Array of refences (pointers) to > child nodes. > * | > > The above structure seems fine if you only have textParts and childNodes > - you can always know the order in which they occurred in the original > document. > > But if your original xml contained pi's, then it appears that phpxpath > doesn't keep track of the ordering relative to textParts and childNodes. Agreed. Supporting PIs means this would have to change. > Is there a workaround for this? Currently PIs are treated as text, so they are stuck in and processed with the surrounding text. So you get text nodes with embedded PIs. Here's the SAX handler, note the text append into the parsedTextLocation which will end up as the text entry in the text array of the node. /** * Handles processing instruction (PI) * * A processing instruction has the following format: * <? target data ? > e.g. <? dtd version="1.0" ? > * * Currently I have no bether idea as to left it 'as is' and treat the PI data as normal * text (and adding the surrounding PI-tags <? ? >). */ function _handlePI($parser, $target, $data) { $data = $this->_translateAmpersand($data, $reverse=TRUE); $this->parsedTextLocation .= "<?{$target} {$data}?>"; return TRUE; } > Does anyone else see a need? Yes. Ultimately we should do this properly. :o) Nigel |
From: Dan A. <da...@mo...> - 2002-07-06 09:43:08
|
Yes, this is very sweet. Congrats to everyone for making this project so sweet. I am definitely going to cruise down to Borders tomorrow and check it out... Dan -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Daniel Allen, <da...@mo...> http://www.mojavelinux.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Real programmers don't change their wardrobe too often: there are no clothes stores that are open at two o'clock in the morning. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
From: Peter R. <php...@pe...> - 2002-07-05 14:17:57
|
On Friday 05 Jul 2002 12:36, Nigel Swinson wrote: > :o) Well spotted!!! It was only published a few months/weeks > : ago!! June 6 according to the blurb |
From: Nigel S. <nig...@us...> - 2002-07-05 11:40:33
|
:o) Well spotted!!! It was only published a few months/weeks ago!! Yeah I have a copy, so does Sam, we were consulted back at the start of the year. Yeah I would recommend it, I've been working through some of the chapters and there is a really good and useful spread of topics allowing you to learn and understand how many PHP/XML based technologies fit together to allow you to design websites built on XML. The chapters are fully of well commented and described examples that allow you to scan through and read the self documenting source, and then just read the paragraphs when you aren't clear about something. I learnt stuff from it, todo with WDDX, XML-RPC and SOAP, but the SAX/XPath/XSL/Db stuff was already familiar, so it may be beyond some of you already, but for those who are relatively new to either PHP or XML it really is a great reference/tutorial book :o) Add to that the finish and style are really nice so it's a pleasure to read. BTW, Vikram, I still have the intention of putting a review similar to this on the phpxpath homepage, as it is a book I would be happy to recommend to our users :o) :o) Nigel =========================== For the most recent version of Php.XPath, and an archive of this list visit: http://www.sourceforge.net/projects/phpxpath ----- Original Message ----- From: "Peter Robins" <php...@pe...> To: <php...@li...> Sent: Friday, July 05, 2002 10:36 AM Subject: Book: XML and PHP by Vikram Vaswani > From the table of contents, it looks like phpxpath gets a mention in a > new book published by New Riders, in chapter 8. See (gulp) > > http://www.newriders.com/books/product.asp?product_id={E72BF2BD-1CF1-4C8B-BB 43-4C098BF49F95}&selectDescTypeId={06B328CA-921B-4395-945D-3078CA6F292A}&st= {FDE07315-F3BC-4496-8D93-C8D3CB69B7B0} > > anyone read/recommend this book? > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Bringing you mounds of caffeinated joy. > http://thinkgeek.com/sf > _______________________________________________ > Phpxpath-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpxpath-users > |