phpxpath-users Mailing List for Php.XPath (Page 18)
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: <pe...@zu...> - 2001-10-08 17:41:24
|
Hi ! I've testet the XML parser first time today - and it works great. I've only one problem: XML-Example: <?xml version=3D"1.0" encoding=3D"ISO-8859-1" standalone=3D"yes"?>=20 <CONTENT> <DATE value=3D"1">2001-09-06 14:45:12</DATE> <CONTENTTYPE>plain/text - news</CONTENTTYPE> <NEW> <HEADLINE>Motorola bringt das Handy zum Aufziehen</HEADLINE> <NEWSBODY>06.09.01 - Zum Thema regenerative ....</NEWSBODY> </NEW> </CONTENT> With the function evaluate I can retrieve the Information in the the <NEW> = tag, with $CONTENT =3D $xml->evaluate("//NEW"); foreach ( $CONTENT as $NEW ) { $HEADLINE =3D $xml->get_content($NEW."/HEADLINE[1]"); $NEWSBODY =3D $xml->get_content($NEW."/NEWSBODY[1]"); echo $HEADLINE."<p>".$NEWSBODY."<hr size=3D"1" noshade>"; } But how can retrieve the information in the DATE and CONTENTTYPE -Tag ???? Thx for help ! Petra -- 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: <ga...@wh...> - 2001-10-08 17:39:48
|
Nigel, Many thanks for that, it works a treat. Also interesting that once I'd done that I got an error from phpXML that normalize-space() isn't supported by the parser yet! But no worries, I removed that and it worked fine. Thanks again - you're right the documentation isn't clear on this point but now I know it, I'll not have the problem again! Regards, Gareth > -----Original Message----- > From: Ni...@Sw... [mailto:Ni...@Sw...] > Sent: 09 July 2001 17:59 > To: us...@li... > Subject: [phpXML] Re: [phpXML] Problems using element[@attribute=''] > syntax ?? > > > Have you tried: > > $aArray = > $calendarXML->evalute("/calendar[1]/month[normalize-space(@number) > ='01']/day[normalize-space(@number)='02']","entry"); > // ...You should really check that $aArray has exactly 1 element, then.... > $newNode = $calendarXML->add_node($aArray[0],"entry"); > $calendarXML->add_content($newNode,"something"); > > Undoubtedly addnode will require an ABSOLUTE address of the node > to which you would like to add a node to. If you pass evalute > the string of the search that you think will produce you 1 node, > then evaluate will return you an array of absolute addresses. > You can then pick the first address and add a node there. > > get_content, set_content, get_attributes, set_attributes, > add_node, delete_node ALL require ABSOLUTE FULLY QUALIFIED > ADDRESSES. ie /a[1]/b[2]/c[3] > > If you want to use fancy XPath you have to use evalute() to > obtain the absolute address then pass that back into the other > "lower level" functions. > > There have been loads of postings along these lines so far, and a > lot of people on this list who still haven't quite got this point > yet (It took me a while too...). If you are ever having > difficulty, then call evalute() and print_r() the results. This > will tell you if you XPath is wrong. The documentation that > declares that functions like add_node or get_content take XPath > expressions is somewhat misleading in that you can't pass in any > old XPath expression. You must pass in a subset of XPath mainly > those XPath expressions that are fully qualified. > > :o) > > Nigel > > ----- Original Message ----- > From: <ga...@wh...> > To: <us...@li...> > Sent: Monday, July 09, 2001 5:45 PM > Subject: [phpXML] Problems using element[@attribute=''] syntax ?? > > > > Hi, > > > > I can't, for the life of me, get the following working: > > > > $newNode = > > > $calendarXML->add_node("/calendar[1]/month[normalize-space(@number > )='01']/da > > y[normalize-space(@number)='02']","entry"); > > $calendarXML->add_content($newNode,"something"); > > > > I've checked my syntax and it appears to be fine but no matter > what I do it > > won't add the node in. Does anybody have any ideas? I was > hoping to use this > > method to help me to handle a calendar system quicker. > > > > Regards, > > > > Gareth > > > > > > > > -- > > 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.../ -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <o.t...@ab...> - 2001-10-08 17:37:57
|
Thanks all folks, Oliver -----Original Message----- From: nig...@us... [mailto:nig...@us...] Sent: woensdag 26 september 2001 13:37 To: us...@li... Subject: [phpXML] Bug in setAttributes After using setAttributes ($xml->setAttributes("/users[1]/Nodename[1]",array("atr1","atr2"));) I get the following incorrect result: <Nodename 0="atr1" 1="atr2"/> Where do the 0 and 1 come from? The array that you use for setAttributes should be an associative array, so you are effectively doing: setAttributes ($xml->setAttributes("/users[1]/Nodename[1]",array(0 => "atr1", 1 => "atr2"));) Hence you end up with: <Nodename 0="atr1" 1="atr2"/> Try: setAttributes ($xml->setAttributes("/users[1]/Nodename[1]",array("atr1" => "value1", "atr2" => "value2"));) =========================== For the most recent version of phpxml, V1.N.X, and an archive of this list visit: http://www.sourceforge.net/projects/phpxmldb <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.../ |
From: <se...@ww...> - 2001-10-08 17:36:24
|
xml.php locationHello, You need to place it somewhere. And include it in every file this way: include("lib/xml.php"); // xmp.php placed in subfolder "lib" Serge. ----- Original Message -----=20 From: o.t...@ab...=20 To: us...@li...=20 Sent: Tuesday, September 18, 2001 4:38 PM Subject: [phpXML] xml.php location Hi,=20 Can anybody tell me how to use the xml.php file. Do I have to place it on= a certain location, or do I have to include that in every file? Thanks,=20 Oliver Talens=20 ****************************************************************=20 Abyss I.T. Solutions=20 Mathildastraat 36B=20 4901 HC Oosterhout=20 http://www.Abyss.nl=20 http://www.PanelPoint.nl=20 tel: +31 (0)162-439809=20 fax: +31 (0)162-439882=20 O.T...@Ab...=20 ****************************************************************=20 -- 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: <ti...@di...> - 2001-10-08 17:34:47
|
Hello everybody, I'm new to the list (and obviously wasn't smart enough to find an archive of this mailing list), so please don't be angry if this topic has been discussed already: When playing around with phpXML, I got a bunch of PHP warnings (PHP 4.0.2-dev standalone/CGI on Solaris, error_reporting(-1)) about "undefined index". I was able to fix them with a few lines - I will send the patch along with this mail. Maybe this can be integrated in the next phpXML release? Thanks, Tim -- ------------------------------------------------------- Tim Strehle DC4 Development Team Digital Collections Phone: +49 40 235 35 0 Hammerbrookstr. 93 Fax: +49 40 235 35 180 20097 Hamburg / Germany http://www.digicol.com ------------------------------------------------------- |
From: <o.t...@ab...> - 2001-10-08 17:33:06
|
How do I get attributes by the XPath function in phpxml? I want to do something like in this code: $results = $xml->evaluate("//users/user[@us_workspace=$workspace]/product[@us_prname=$p roduct]"); //Display user in list $attributes = array(); foreach ($results as $users) { //username $attributes = $xml->get_attributes("parent::".$users); Thanks, Oliver -----Original Message----- From: pe...@zu... [mailto:pe...@zu...] Sent: vrijdag 21 september 2001 8:56 To: us...@li... Subject: [phpXML] Re: [phpXML] how to get off the mailing list > I clicked on the link at the bottom but I can't read German. > How do you unsubscribe from this list?? First you have to login with eMail an passwort. Then you get on a page where you have to click on the button named "Abmelden". If you do'nt know your password, write your email-address on the first page in the section "Passwort vergessen". Then you get a mail. Petra -- 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: <fra...@vi...> - 2001-10-08 17:31:34
|
Hi all, for a diff file the change are pretty big (on a relatively small file) so making one is not really usefull, well I will surely not post it to the list it's still pretty big for those who don't need it, if you want one just email me. I'm not sure if I present myself, my name is Francis Fillion I'm redoing one off my site (http://www.windplanet.com), the design is maybe 2-3 years old so a complete rewrite is in they process, all the stuff should speak XML, XSLT and ... so this is why I use phpxml, well I just find it out a few days back, so I still investigate it. I live in Montreal, Quebec (Canada), so if you can read my crappy english it's good, my native language is french. Anyway I think that phpxml is a good stuff and I will look forward to look at it and improve it, if I can. I see that 1.N.3 (Nigel) is a kind of a fork? The last version work well , well just changed my include and everythings seen to work OK, I will investigate more on this surely this week-end. Thank for adding my patch, well if you don't have diff, you don't have patch, so I guess you copy paste it check-it, you should have Linux you will have diff and patch ;) For they untrim() stuff, well don't want that because you want the original spacing stuff that you're user have put in there document, if xml_parser_get_option can be fixed we could change the constructor to implement that (give 1 or 0 and the trim get in or out...). Thank you and cu Ni...@Sw... wrote: > > If anyone is interested, you'll find a release of phpxml at > http://sourceforge.net/projects/phpxmldb/ with most of the bugs and > enhancements that have been requested in the 125 messages that have been > posted here in the 3 weeks that this list has been alive. > > Release notes also avaliable containing a list of the changes since phpxml > 1.0. > > http://sourceforge.net/project/shownotes.php?group_id=31522&release_id=44340 > > Sorry folks, I still haven't got my hands of a copy of this DIFF program > that people keep talking about, otherwise I'd have include a DIFF too. Some > 25% of the file differs from the original now, so a DIFF would probably be > quite heavy going... > > I'd post this at the phpxml project at sourceforge, but I'm not a developer > there as yet. The phpxmldb work relies on phpxml so it's not a completely > stupid place to post it :o) As such ftp://129.215.200.115 will no longer be > serving phpxml version 1.N.X > > Some of you might be interested in the phpxmldb work, you might want to take > a look, but please don't innondate me with mails about it as it's only a wee > pre-alpha baby, however comments about the direction of the project would be > appreciated. :o) > > Best regards > > Nigel > > -- > 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: <wl...@bl...> - 2001-10-08 17:30:20
|
<blah1> Text<blah2>more</blah2>text. </blah> this is the patch i did. if ($highlight) $xml .= ">\n"; else $xml .= ">\n"; - if $highlight array is present then write ">\n"; - else write the regular way for output to xml. - did that for both the opening and closing tag in get_file() I always use <[!CDATA[ ]] Whenever I have invalid characters in the string that i'm going to output to an xml document. <blah1> Text<blah2>more</blah2>text. </blah> I haven't encountered why I would use this kind of xml structure. <blah1> <blah>Text</blah> <blah>more</blah> <blah>text</blah> </blah> this has always been fine for me.. -----Original Message----- From: Ni...@Sw... [mailto:Ni...@Sw...] Sent: Wednesday, July 04, 2001 8:56 AM To: us...@li... Subject: [phpXML] Re: [phpXML] miss-match > <blah1> > Text<blah2>more</blah2>text. > </blah> > > Just wondering if this is a correct xml data structure. I'm pretty sure it is a well-formed XML structure. I'll research sometime when I'm not at work, or I was hoping someone else would answer this for me. Go check out www.w3c.org. It won't take long to confirm either way. > Cause I haven't > seen somthing like this before. <p><B>Marked up</B> bits of <strong>text</strong> will have this pattern of elements and text <i>often</i></p>. > Or is this an output from phpXML? It couldn't possibly be the output from phpXML. As I have already argued, the phpXML class is unable to represent such a structure internally, so it can't output text of this form. > Can you > be a little bit more clear on this because i haven't encountered major > problems from phpXML except when I start using complex XPath. Many XML documents never use a mix of text and elements below a node, hence you never see this issue. > I can easily write an xmlfile and read from an xmlfile but haven't tested > the replace and delete node. I'm intrigued how you manage this. When I ask phpXML to get_file. It escapes all the <> with < > and I get: <blah1> Text<blah2>more</blah2>text. </blah> This is not a well-formed XML document as it is both missing a <?xml .... ?> bit (easily added) but it more annoyingly doesn't have a root node, as the root node has been escaped by < and > so the blah1 element is no longer an element but is now text. 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: <o.t...@ab...> - 2001-10-08 17:30:13
|
How do I save an altered XML document using PHPXML? Thanks, Oliver -----Original Message----- From: lu...@sa... [mailto:lu...@sa...] Sent: dinsdag 18 september 2001 10:44 To: us...@li... Subject: [phpXML] Re: xml.php location En r=E9ponse =E0 o.t...@ab...: > Hi, >=20 > Can anybody tell me how to use the xml.php file.=20 > Do I have to place it on a > certain location, or do I have to include that in every file? Hello, Copy the following in a file <?php echo phpinfo(); ?> Call the file lets say : phpinfo.php and call it from your browser. If you have an include directory it will be reported in the resuting page. Place your xml.php file in this include directory In each php that uses xml.php : include('xml.php'); 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 u= nsubscribe, please visit https://sslsites.de/mailinglisten/user/user@lists.= phpxml.org/ |
From: <o.t...@ab...> - 2001-10-08 17:30:07
|
I know that there is no way of sorting in XPath, but it would realy be handy to have something for it like in XSL. -----Original Message----- From: nig...@us... [mailto:nig...@us...] Sent: dinsdag 2 oktober 2001 2:34 To: us...@li... Subject: [phpXML] problem with whitespace The whitespace handling is somewhat "historical" due to the appaling way that we used to represent the internal text and element nodes. Now that we have the <a>1<b>2</b>3</a> bug fixed, we should really get round some time to reproducing the exact same xml document that we read in. That would be a good goal... 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: <o.t...@ab...> - 2001-10-08 17:28:34
|
Is there a way to search nodes by case-insensitive attributes? Thanks, Oliver -----Original Message----- From: nig...@us... [mailto:nig...@us...] Sent: dinsdag 2 oktober 2001 2:34 To: us...@li... Subject: [phpXML] problem with whitespace The whitespace handling is somewhat "historical" due to the appaling way that we used to represent the internal text and element nodes. Now that we have the <a>1<b>2</b>3</a> bug fixed, we should really get round some time to reproducing the exact same xml document that we read in. That would be a good goal... 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: <fra...@vi...> - 2001-10-08 17:27:02
|
Hi Michael, hi all, my name is Francis Fillion I'm working on a project right now that get a lot of xml, xslt (sablotron) and all this stuff involved. I'm really happy to have found your stuff, I didn't tested very hard for now, but I will. I just added a little function that help me use string xml document, my xml document are all string (I build them from database), so I have copy paste the patch right down, I mostly used your code to do it. Continue the good work, any new devel version will be welcome. --- xml.php Thu Mar 8 18:52:18 2001 +++ xml2.php Wed Jul 18 14:28:52 2001 @@ -246,6 +246,60 @@ $this->display_error("File %s could not be found or read.", $file); } } + + /** + * Reads a string and parses the XML data. + * + * This method reads the content of a XML string, tries to parse its + * content and upon success stores the information retrieved from + * the string into an array. + * + * @access public + * @author Francis Fillion <ffi...@in...> modified from Michael P. Mehl <mp...@ph...> + * @param string $content name of the string to be read and parsed. + * @see handle_start_element(), handle_end_element(), + * handle_character_data() + */ + function load_string ( $content ) + { + // Check whether content has been read. + if ( !empty($content) ) + { + // Create an XML parser. + $parser = xml_parser_create(); + + // Set the options for parsing the XML data. + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + + // Set the object for the parser. + xml_set_object($parser, &$this); + + // Set the element handlers for the parser. + xml_set_element_handler($parser, "handle_start_element", + "handle_end_element"); + xml_set_character_data_handler($parser, + "handle_character_data"); + + // Parse the XML file. + if ( !xml_parse($parser, $content, true) ) + { + // Display an error message. + $this->display_error("XML error in file %s, line %d: %s", + $content, xml_get_current_line_number($parser), + xml_error_string(xml_get_error_code($parser))); + } + + // Free the parser. + xml_parser_free($parser); + } + + else + { + // Display an error message. + $this->display_error("This xml document was empty", $content); + } + } /** * Generates a XML file with the content of the current document. @@ -3382,4 +3436,4 @@ } } -?> \ No newline at end of file +?> -- 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: <wl...@bl...> - 2001-10-08 17:23:57
|
<blah1> Text<blah2>more</blah2>text. </blah> Just wondering if this is a correct xml data structure. Cause I haven't seen somthing like this before. Or is this an output from phpXML? Can you be a little bit more clear on this because i haven't encountered major problems from phpXML except when I start using complex XPath. I can easily write an xmlfile and read from an xmlfile but haven't tested the replace and delete node. WiL -----Original Message----- From: Ni...@Sw... [mailto:Ni...@Sw...] Sent: Wednesday, July 04, 2001 5:20 AM To: us...@li... Subject: [phpXML] Re: [phpXML] miss-match > -When I call $xmlobj->get_file(); it will go through the $xmlobj->nodes > array and format the XML document. > -For every 'text' node it will scan for characters such as "<>&". > -If it encounters such characters it will add the <![CDATA[ tag before > and ]] tag after the 'text' node. > -Else just write out the 'text' node. > > > if (strspn($this->nodes[$root]["text"], "<>&") > 0) { > // Add the character data to the XML data with CDATA tags around it. > $xml .= $before." <![CDATA[\n"; > $xml .= $before." ".$this->nodes[$root]["text"]."\n"; > $xml .= $before." ]]>\n"; > } else { > // Add the character data to the XML data. > $xml .= $before." ".$this->nodes[$root]["text"]."\n"; > } I'm not sure that this actually solves the stated problem though as I think I am right in saying that this is a fix that goes into get_file(). Therefore if the datastructure can't describe "Before<tag>Middle</tag>End", then it's not going to be able to print it. This fix will cope with usage of the object that make calls to set_content("address","Some text <B>that</B> contains some markup."). But if the xml file that you read in already has "Some text <B>that</B> contains some markup." then the class is going to loose this structure in the parse. Basically phpxml's internal datastructure is lossy. You can't read to object and write back out to file and have two logically identical files. Ideally it ought to be. We need a more complete fix for this in the constructor or load_from_file function I think.... Nigel > How can I get around phpXML's tendency to place tags inside regular text > after the tag containing the text. > i.e., > <blah1> > Text<blah2>more</blah2>text. > </blah> > Comes out > > Text text.more -- 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: <lu...@sa...> - 2001-10-08 17:22:22
|
At 21:02 03/08/01 +0000, you wrote: > > 2) About my question regarding a standrd DTD for a normal Website > > I just would like to know is a basic set of DTD suitable for a > > normal website existe .... >Try HTML 4.01 or XHTML 1.0. They are the 'standard' dtd's of the web. > > > What I'm looking for is a set of dtd describing a text, a menu, a > > newsfeed and > > so on. >If you are looking for feeds for syndication, Try RSS or RDF. They are both >described in detail at w3.org and xml.com. > >Good luck. Well apparently my question was far from clear :-)) I know about syndication, I use it and I use sometimes ith RSS sometimes not (RSS is something that allows you to send title and some basic information about a newsfeed, but you can do far more with syndication, i use it to communicate also complete texts) For example, have a look at www.interpasnet.com (the content as no importance its bullshit, I use this server for testing purpose). If you click on : - WinCVS mode d'emploi or on - CacheCache : Internet & discretion What you'll see is a XML file, A single XML file. The display is one paragraph at a time and in the contextual menu (second bloc on the left) the links are extracted from the same XML file. If you want to place the whole file (or only one paragraph on your website, just ask me I'll send you a single line of code and by magic it will happen.. ok but this is not my question. My question is in this case : the XML file uses a DTD that I made for my needs. I'm not sure (that is a very elegant way to say "I' very sure of the opposite") that this DTD is not the best for that, not the most reusable, not the most complete etc... So question : is there a DTD for along text (VS a newsfeed) published on a website ? In the same sense I use a specific DTD to hold information on a set of file in order to generate a global summary So question : is there a standrad DTD for this In some case I use a XML file to hold menu items, thius allow to control the navigation from a single point. So question : is the a DTD for that. Say in another way, if you want to publish a book or a long and rather complex text, there is a DTD : docbook (and the simple version for "simple" needs), is there other DTD more specific that docbook ? If all that is described higher is doable using RDF or other existing standard, my question is modified in : does any body knows a url where all this is explain (a tutorial) ? outside the W3 server, I don't need specs but real life examples. 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: <lu...@sa...> - 2001-10-08 17:20:48
|
Liz, I just tried, this doesn't work for me. I get good results only if this array is empty... Luc At 06:24 24/07/01 +0000, you wrote: >Thankz Luc, > >I checked the lines that you pointed me to and I thought I'd let you know >what I discovered: > >When reading though the file I thought !!! "wait a sec! HTML4.0 doesn't >specify an entity encoding for the apostrophe." > >I did some research. And sure enough, it is not an HTML entity. The simple ' >character is good enough. Also, the " for " is not truly needed in >HTML. > >By the way, in my file the semi-colon was missing in the ' entity >conversion array. > >The browser still couldn't handle the ' with the ; inserted, so I >adjusted the xml.php file to the ISO Latin set since I am not sure if this >conversion will be needed in another script that I write. > >122 /** >123 * var $entities = array ( "&" => "&", "<" => "<", ">" => >">", >124 * "'" => "&apos", '"' => """ ); >125 */ >126 var $entities = array ( "&" => "&", "<" => "<", ">" => >">", >128 "'" => "'", '"' => """ ); > >Now the CDATA Sections seems to render fine in IE5+. :-) > >I wonder why the ISO Latin codes were not used in xmlphp. Especially since >ISO 8859/1 is the 8-bit single-byte coded graphic character set. > >Thankz again :-) > >Liz Bostetter > > >-----Original Message----- >From: lu...@sa... [mailto:lu...@sa...] >Sent: Tuesday, July 24, 2001 12:12 AM >To: us...@li... >Subject: [phpXML] Re: phpxml Version 1.N.4 > > >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: <spr...@ho...> - 2001-10-08 17:17:42
|
Speed isn't much of a concern for me here, but memory usage is. The XML is only being used for exporting, importing and copying/pasting objects around in the application server's management interface. Content, presentation and logic are all stored in a MySQL database. The XML can get large because serializing a folder object serializes that object and any objects it contains. Again, the XML is being used to move objects around and to export objects and object types for backup or for import into another Phratry application server. The project is at phratry.sourceforge.net. It should have an alpha release within a couple weeks. It is similar to Zope but, in my biased opinion, much easier to install, use and develop in. ----Original Message Follows---- From: ph...@pe... Reply-To: us...@li... To: us...@li... Subject: [phpXML] Re: [phpXML] Large amounts of data Date: 8 Jul 2001 12:12:47 -0000 On Friday 06 July 2001 17:30, you wrote: > I'm using phpXML to export/import object heirarchies in an application > server. I haven't run into the memory limit yet, but when the application > server starts getting some real use people may want to back up an entire > site. > > I'm thinking of creating an extension of phpXML that stores node content in > a temporary file instead of keeping it in memory. The method > set_external_content() will write to a file pointer and then set some node > attributes like ext_ctnt_position and ext_ctnt_length. The method > get_external_content() will use those attributes to seek to that position > in the file and grab the specified content. > > Any thoughts on this? Pitfalls? Interest? obvious disadvantage for one-off use is that it would be much slower. If this were reasonably static data, you could store the result in a permanent file as a sort of Xpath index, and then use that in your scripts - I quite like that idea, especially as other users could then use the index instead of rereading the file every time. xml files are no different from any other flatfile 'database': reading an entire large file to extract a small amount of data is not a very efficient thing to do. Without knowing your application, I would say as a rule of thumb, if xml files start getting large, either move to dbms with proper indexing or find some way to split into smaller files. -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com -- 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 17:14:34
|
RE: [phpXML] Bug in setAttributesAfter using setAttributes ($xml->setAttrib= utes("/users[1]/Nodename[1]",array("atr1","atr2"));) I get the following in= correct result: <Nodename 0=3D"atr1" 1=3D"atr2"/>=20 Where do the 0 and 1 come from?=20 The array that you use for setAttributes should be an associative array, so= you are effectively doing: setAttributes ($xml->setAttributes("/users[1]/Nodename[1]",array(0 =3D>= "atr1", 1 =3D> "atr2"));) Hence you end up with: <Nodename 0=3D"atr1" 1=3D"atr2"/> Try: setAttributes ($xml->setAttributes("/users[1]/Nodename[1]",array("atr1"= =3D> "value1", "atr2" =3D> "value2"));) =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: <ph...@pe...> - 2001-10-08 17:13:01
|
absolutely right, Nigel. The problem has nothing to do with CDATA - call it embedded structure, where the child(ren) is in the middle of the parent. Try the following: <text>There are 2 categories: <category>1</category> <category>2 which has <sub>a subcategory</sub> as well</category> which have to be taken into account.</text> etc etc. The parser adds an extra element to the array for each segment of a node, but phpxml's load_file ignores this and just adds the content to the node without any indication that there was a child in that position. Consequently, it loses information. (it also compounds the error by stripping the spaces around the tags, so "<text>The spacing is <e>very</e> important.</text>" comes out as "The spacingisimportant." :-) afaics, the only solution is to add an extra array to correspond to each segment, so my example above would be stored as text[0] e[0] text[1]. It gets pretty hairy though trying to put it back together again, as there is no limit to the number or levels of the array. I gave up trying to use php's parse_into_struct because my poor brain couldn't cope with navigating all the arrays! On Wednesday 04 July 2001 13:20, you wrote: > > I'm not sure that this actually solves the stated problem though as I think > I am right in saying that this is a fix that goes into get_file(). > Therefore if the datastructure can't describe "Before<tag>Middle</tag>End", > then it's not going to be able to print it. > > This fix will cope with usage of the object that make calls to > set_content("address","Some text <B>that</B> contains some markup."). But > if the xml file that you read in already has "Some text <B>that</B> > contains some markup." then the class is going to loose this structure in > the parse. > > Basically phpxml's internal datastructure is lossy. You can't read to > object and write back out to file and have two logically identical files. > Ideally it ought to be. > > We need a more complete fix for this in the constructor or load_from_file > function I think.... > > Nigel > > > How can I get around phpXML's tendency to place tags inside regular text > > after the tag containing the text. > > i.e., > > <blah1> > > Text<blah2>more</blah2>text. > > </blah> > > Comes out > > > > Text text.more > > -- > 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 17:11:26
|
Hi folks. As I hinted earlier, I am trying to set up an archive for = this list. I'm also trying to send it all the previous messages that = have been sent to this list. I am hoping that in doing this you won't = get sent duplicate messages but it might happen. So if you get any really strange messages in your inboxes, please could = you politely forward it on to me and I'll modify the process slightly to = try to avoid this. The archiver seems to want to hold messages for = moderation so it's possible that 8 of you have been sent a rather = confusing message recently while it waited for me to "moderate" your old = posting. Anyway bear with me, having and archive will be worth a little fuss. :o) Nigel |
From: <nig...@us...> - 2001-10-08 17:09:53
|
Haven't read you mail yet, but check out the link below, you'll find a very active phpxml community... Nigel =========================== For the most recent version of phpxml, V1.N.X, and an archive of this list visit: http://www.sourceforge.net/projects/phpxmldb ----- Original Message ----- From: <d_o...@we...> To: <us...@li...> Sent: Wednesday, September 05, 2001 4:13 PM Subject: [phpXML] Project PDJ > Hi everyone, > i sent this letter to mp...@ph... but all I got was an auto-reply. So pls > read my mail, and if anyone's interested, contact me. > Bye > David Oswald > > <--Letter--> > Hello, > my name is David Oswald, I'm a 16 years old student and come from Essen, > Germany. I've been working with PHP/MySQL for about one year. A few weeks > ago, I began to learn Java (which is great) and since then, I think about an > object-oriented framework for PHP. As you probably know, the support for > objects in PHP is more or less rudimentary: > No destructor, no framework with base classes etc.. > That's why I plan to make a Java-like framework for PHP. I know that there > are already a few libraries (e.g. PEAR), but I think that these are too > complex and a bit inconsistent. For example, lots of PEAR extensions do not > inherit the base class and moreover, there aren't any more specific classes > like Document, Client etc.. So I decided to program my own framework. > Moreover, I want to create a website for it and other tools & scripts > written in next generation languages like Java, .... Ah, and it should of > course be free, e.g. distributed under the GPL or MPL. > After a long search (I never imagined that there are so many companies with > the word "dawn" in their names ;-)), I chose the french expression "Point du > Jour" (dawn) as a title for that project. I want that project to be > something like a dawn for webmasters, internet programmers etc.. Now you > ask: Why did you send me this mail? What do you expect me to do? Well, you > offer the PHP-script "phpxml". I can't program a whole framework and I > think > that your script would be important for my project. So I want you to ask > whether you would contribute something to "Point du Jour" and integrate your > program or at least allow that someone else integrates your tool into the > framework. There's a lot of work and I already "only" wrote a base class > called "Object" with destructor emulation, an "Error"-class and a simple > Java-based HTML-Editor. But I want to make the project become bigger and so > it would be really great if you support me. If you are interested in helping > me with "Point du Jour" and therefore want to get more information, pls mail > back. Any kind of support, e.g. programming, translation, documentation,... > is welcome. > Thx in advance > Yours > David. > > David Oswald > Essen, Germany > d_o...@we... > > <--/Letter--> > > > -- > 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: <aj...@ho...> - 2001-10-08 17:08:19
|
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? Is there an archive of the mailing list? ========= AJ Morris Technical Manager, Application Development Homeboyz Interactive www.hbiconsulting.com www.homeboyz.com 414.672.3346 ========= -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <sh...@co...> - 2001-10-08 17:06:41
|
Hello.....please forgive my question if it is stupid, I am a newbie to XML. Can anyone assist. Feel free to email me directly at sh...@co... I am trying to parse the following XML file http://www.coolshopping.com/xml/derek.xml with the following script: <?php // Include the <phpXML/> class. include("xml.php"); // Create an XML object for the XML file. $xml = new XML("derek.xml"); // Check whether a search term was given. $Products = $xml->evaluate("//Product"); // Run through all members of the government. foreach ( $Products as $Product ) { // Retrieve information about the person. $Code = $xml->get_content($Product."/Code[1]"); $Description = $xml->get_content($Product."/Description[1]"); $Url = $xml->get_content($Product."/Url[1]"); $Caption = $xml->get_content($Product."/Caption[1]"); $Thumb = $xml->get_content($Product."/Thumb[1]"); $BasePrice = $xml->get_content($Product."/Pricing/BasePrice[1]"); // Display the information. echo "merchant name: to be obtained <br>\n"; echo "product sku: $Code <br>\n"; echo "product name: $Description <br>\n"; echo "product category : ?????<br>\n"; echo "product short desc: $Caption <br>\n"; echo "product price: $BasePrice <br>\n"; echo "product manuf: ???? <br>\n"; echo "product img url: $Thumb<br>\n"; echo "product click url: $Url <br><hr>\n"; } ?> I do not understand how to obtain the fields: BasePrice ProductRef Url You can see my results at http://www.coolshopping.com/xml/test.php3 Can you give me some instructions on how to obtain these sub-level fields? Thank you in advance!! Amy Strycula, Creative Director Coolshopping.com http://www.coolshopping.com http://www.coolshopping.tv (412) 366-7545 voice (412) 366-8528 fax -- 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 17:03:33
|
Hi, I can add nodes no problem, if I do the following for instance: $calendarXML->add_node("/calendar[1]/month[1]/day[2]","entry"); $calendarXML->add_content($newNode,"something"); That works fine. It's just using the @attribute='' XPath syntax doesn't seem to work. The reason I don't use the above is that I don't want my parsing to be dependant on the order of the months and days in the XML file. Regards, Gareth > -----Original Message----- > From: te...@ho... [mailto:te...@ho...] > Sent: 09 July 2001 17:49 > To: us...@li... > Subject: [phpXML] Re: [phpXML] Problems using element[@attribute=''] > syntax ?? > > > i was in such trouble too. i wonderfully read XML but adding nodes couse a > problem.. i tryed everything. > > may be somebody will write simply examples how to add/remove/modify nodes > and write it back to file > > > > ----- Original Message ----- > From: <ga...@wh...> > To: <us...@li...> > Sent: Monday, July 09, 2001 8:45 AM > Subject: [phpXML] Problems using element[@attribute=''] syntax ?? > > > > Hi, > > > > I can't, for the life of me, get the following working: > > > > $newNode = > > > $calendarXML->add_node("/calendar[1]/month[normalize-space(@number > )='01']/da > > y[normalize-space(@number)='02']","entry"); > > $calendarXML->add_content($newNode,"something"); > > > > I've checked my syntax and it appears to be fine but no matter what I do > it > > won't add the node in. Does anybody have any ideas? I was hoping to use > this > > method to help me to handle a calendar system quicker. > > > > Regards, > > > > Gareth > > > > > > > > -- > > 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.../ -- 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 17:01:58
|
Nigel, I'e just tested your supposition - voila ;-) Using for example: Expression: "/surname" Context: "/government[1]/person[3]" Provides a working answer. Though I was a bit surprised that, since there was only a single node for 'government', "context" still required the "/government[1]" syntax. Many thanks for the hint - I never would have guessed that the [1] was needed to define a singular node Tom At 03:58 PM 7/4/01 +0000, Ni...@Sw... wrote: >Try using a context of /government[1] > >The context (I think) has to be a COMPLETE address. Not just an XPath >address that evaluates to only one node. > >I haven't tested this, but I think this is right. > >Nigel > >----- Original Message ----- >From: <tom...@di...> >To: <us...@li...> >Sent: Wednesday, July 04, 2001 2:29 PM >Subject: [phpXML] Need example for 'context' > > > > Hello all, > > > > I need a very specific example for the use of 'context' in the original > > distro examples. > > > > What are inputs that show a highlighted result ? > > "XPath Expression:" > > "XPath Context:" > > > > E.g. what input for each field in the form testsuite.php (processing the > > 'government.xml' file) > > > > Whaterver combination I use (just one example) > > Example (my entries) > > XPath Expression: file://prename > > XPath Context: /government/person > > - I get no result highlighted > > > > Many thanks, > > Tom > > > > > > -- > > 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.../ -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |
From: <o.t...@ab...> - 2001-10-08 17:00:24
|
How to add a node to an XML file. add_node does not seem to work. Please advise. Thanks, Oliver Talens -----Original Message----- From: lu...@sa... [mailto:lu...@sa...] Sent: donderdag 20 september 2001 10:46 To: us...@li... Subject: [phpXML] Typo : Re: xml.php locat ion En r=E9ponse =E0 lu...@sa...: > $firstname =3D $xml->get_attributes($buddy ."/firstname[1]"); is obviously : $firstname =3D $xml->get_content($buddy ."/firstname[1]"); 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 u= nsubscribe, please visit https://sslsites.de/mailinglisten/user/user@lists.= phpxml.org/ |