[phpXML] Undefined index errors.
Brought to you by:
bs_php,
nigelswinson
From: <nig...@us...> - 2001-10-09 13:11:42
|
---- Original Message -----=20 From: Geo...@sq...=20 To: us...@li...=20 Sent: Monday, July 16, 2001 5:47 PM Subject: [phpXML]=20 IS ENYBODY WORKING WITH <phpXML/>. UNDER Windows NT ???????????=20 I am writing a php4-script using XML-files under Windows NT without = using WEB-server.=20 I was very interested by <phpXML/>.,but I can't start it with = php.exe for Windows NT .=20 PHP-interpreter gives warnings: "Undefined index " in function = add_node ( $context, $name ).=20 You must have just joined the mailing list. Undefined index is usually = the first bug folks find with phpxml. Follow the link below and you = should get a version that doesn't suffer from undefined index errors. ----- Original Message -----=20 From: Nigel Swinson=20 To: us...@li...=20 Sent: Sunday, July 15, 2001 1:47 AM Subject: phpxml with all my bug fixes to date including = get_as_xml_file() function Hi folks. It's been three weeks since I started developing with phpxml = so I thought it was about time I released to you all the fixes and = changes I have made for you to use if you want or bin if you prefer. ftp://129.215.200.115/Pub/phpxml/xml.php a.. Undefined index errors: It includes all of the Marko Faldix = mf...@mr... undefined index errors, and all of the Tim Strehle = ti...@di... undefined index errors. Also some I found too which = could be duplicates just fixed in a different way...=20 b.. &apos has been removed=20 c.. get_file has been renamed to get_file_as_html as it is a somewhat = misleading name for the function anyway. get_file_as_html() is = implemented by get_file_internal() which is mostly a copy of get_file.=20 d.. get_file_as_xml This is a function that will return you a buffer = that can in it's entirity be dumped to an output file. it includes the = <?xml version... ?> line too. Very useful function. The support for = this was added to get_file_internal() so that it will quote < > and & = only if it is called from get_file_as_html.=20 e.. stripslashes I don't bother calling addslashes to all the data = that the class holds, as this just gets really inconvenient. xmlphp = should be able to read in from file and write out as xml without = altering the logical content of the data and addslashes() restricts = this. Addslashes is useful for data that you use in php or javascript = strings, but xml can handle ' " and \ so why escape them? Consequently = all addslahes and stripslashes calls have been removed.=20 f.. Output formating I've changed the rules for output formatting so = as to preserve "content" more effectively. Consequently if an element = has only content, it will be written as "<Tag>Text</Tag>" as opposed to = "<Tag>\n\tText\n<Tag>\n". This makes for a more compact output.=20 g.. Whitespace is preserved When space is read, it is added to the = content of the node. It is only when the end tag is read that = whitespace is potentially discarded. Even then whitespace is only = discarded if the entire text content of the node is whitespace. This = strips "meaningless" whitespace that facilitates formatting of the xml = file, while preserving whitespace in text.=20 h.. Boolean predicates didn't work The check_predicates function = didn't work with and and or because the return value of bool was being = interpreted as an integer and being considered to be an index instead of = a true or false. This has been fixed. If you look for "// ## N.S" then you'll be able to browse through the = changes that I have made. www.sourceforge.net looks like a really good site! I didn't realise = that it would do bug tracking, wishlists and user support too. Most of = the traffic of this list so far should be transferred to that system. = Please could you add me as a developer of the phpxml project? My = sourceforge username is "nigelswinson". I'll leave the file on the above ftp server until the bug fixes and = enhancements have been agreed/rejected and then possibly added to the = project at sourceforge.net. Thanks all. Nigel |