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...
b.. &apos has been removed
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.
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.
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.
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.
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.
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
|