[pmwiki-users] <div> markup suggestions...?
Patrick R. Michaud
pmichaud at pobox.com
Mon Feb 28 20:03:29 CST 2005
On Tue, Mar 01, 2005 at 02:02:27PM +1300, John Rankin wrote:
> On Tuesday, 1 March 2005 12:08 PM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> >Do you need to have the system read and parse the 'xyz dtd'
> >directly and figure things out (i.e., support arbitrary custom DTDs),
> >or is it sufficient to simply be aware of standard DTDs
> >that may have been pre-processed into a data structure or
> >set of patterns somewhere?
>
> We don't know the best answer yet, but here are some thoughts
> and questions:
>
> - could pmwiki include a 'validate' action that takes the
> output generated, validates it against the specified dtd and
> reports errors?
I dunno, I'll have to look into PHP's XML validation tools for this
one.
> - at a minimum, we need to specify a different markup output
> for each item of wiki markup, and catch any we have missed,
> eg because it's a local customisation
Well, one way of catching any that are missed might be to simply
report any markups that haven't been registered or blessed into the
DTD. For example, if we revised AltMarkup() to read:
AltMarkup('xyz', 'id1', 'output');
AltMarkup('xyz', 'id2');
the second form could indicate that 'id2' is known to be valid in
the 'xyz' DTD, but otherwise generates the same output as the default
(xhtml). Then it's a fairly easy matter to identify any markups in the
table that don't have corresponding 'xyz' DTD entries.
But, in thinking about it a bit further, we'd end up making quite a
few entries, and it probably doesn't make sense to need to register
every markup for every DTD -- we just need to know which ones generate
output that's incompatible. Oh well, it was a thought... :-)
It does seem as if the best solution is to come up with a way to
validate the output against a DTD and report the discrepancies, but
I'm not quite sure how to do that in PHP.
Pm
More information about the pmwiki-users
mailing list