tag handlers as XML

Neven Has haski at sezampro.yu
Fri Feb 16 08:08:10 PST 2001


I manage to solve that paramN ordering problem. CDATA _did_ help. It's:

        foreach (map { $_->[0] } sort { $a->[1] <![CDATA[<=>]]> $b->[1] }
                 map { [$_, /param(\d+)/] } keys %{$elt->atts()}) {

                $params .= ${$elt->atts()}{$_} . " " if (/param/);
        }

But this is ugly. A lot. 

Because our handlers have to go through Twig parser, some things can't be used.
For example, I can't write a simple comparison:

	print "No way?\n" if (1 < 2);

gives infamous "not well-formed (invalid token)" error because of "<" sign.

I'm not saying that we have to dump <register_tag>. 
No, I like it, and it could be used in XML profile where kludges like 
the above CDATA are (kind of) Oll Korrect. ;)

There's probably some Twig option or something that could be used to solve
this, and tell the parser that some part of text is not XML. 
But that would also be a dirty kludge.

The point is -- we can't treat tag handlers as XML. They are not XML, and 
the only XML part of them is <register_tag>. That's only one (two) line(s) 
and could easily be replaced with the right function that does the same thing.

I think that's pretty necessary?

Neven

PS: I didn't commit the above code. We have to agree on this first.







More information about the alfs-discuss mailing list