-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hannes Magnusson wrote:
> We are ditching xslt in favor of the new PHP based rendering system
> (see the top news entry on php.net :)), called PhD, which uses 3% of
> the time the xslt rendering takes...

My apologies, that was me talking before I'd have read
Buildsystem-proposal.rtf. Now, after having read that, and from my
limited readings of the source code (docs, docs, where are my docs? :-),
here's what my (probably incorrect) thoughts are:

Using XML Reader seems to be quite efficient, but though flexible (since
we can use PHP to arbitrarily process the internals), it lacks the
expressive pattern matching XSLT has. There is currently no well-defined
way for a PhDFormat::format_* function to do another traversal of a
different segment of the tree. In fact, because of XML Reader's design,
which allows for its low memory usage, this is impossible without
actually parsing a DOM and running XPath on it (or pregenerating it, as
we do with indices, as I understand it). Currently, we deal with this
issue by requiring any data to be used later to be early in the XML
file, so that the PhDFormat class can stash it away in its $tmp member
variable.

This is, however, irrelevant for the issue of duplicated class names.
Inspecting the source:

<refentry xml:id="function.xmlreader-close"
xmlns="http://docbook.org/ns/docbook";>
 <refnamediv>
  <refname>XMLReader::close</refname>
  <refpurpose>Close the XMLReader input</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>bool</type><methodname>XMLReader::close</methodname>
   <void/>
  </methodsynopsis> [Snip]

Looking at <methodname>, it becomes clear that short of parsing the
string (relatively simple, but remember, this is XML) there is no way of
telling that XMLReader is the class name and close is the method name.
There are several ways to handle this:

1. Add the parsing code to PhD, so it can split up methodname into its
appropriate parts. :: serves as a sort of shorthand
2. Split up <methodname> into a <classname> and <methodname>. This
approach, not only embedding the information into the XML, also allows
us to swap out :: for a more appropriate -> if necessary (especially for
non-static functions)

However, determining when to omit classname and when to keep it would
have to be context dependant on the classname currently being used,
which would have to be stored in $tmp.

So, where am I totally off base?

- --
 Edward Z. Yang                        GnuPG: 0x869C48DA
 HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
 [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHKRwcqTO+fYacSNoRAv1MAJ40fxdvbb2Nu28wL9kuhI6PmMLodQCeNBwE
QMKrogP9hef6PqFXI8o5o74=
=koY0
-----END PGP SIGNATURE-----

Reply via email to