Re: [ANNOUNCE] XML::Filter::Glossary 0.1
by Bart Schuller other posts by this author
Sep 10 2002 4:14PM messages near this date
view in the new Beta List Site
Re: [ANNOUNCE] XML::Filter::Glossary 0.1
|
Re: [ANNOUNCE] XML::Filter::Glossary 0.1
On Tue, Sep 10, 2002 at 10:27:15AM -0500, Ken MacLeod wrote:
> $parser->parse_string("<?xml version = '1.0' ?><root xmlns:g="http://aaronland.net/gloss
ary"> This is <g:aaronland/></root>");
[...]
> In the start_element() of XML::Filter::Glossary, you can then do:
>
> if ($element->{NamespaceURI} == 'http://aaronland.net/glossary') {
> # merge content based on $element->{LocalName} as the key
> }
>
> Probably much simpler and far more foolproof.
Urgh.
I suppose it's *possible*, technically, to do it this way, but it feels
very wrong. You shouldn't make a tagname part of the content like that,
even though it's prefixed. Apart from the elegance issue you'll also
find that you can't use certain words, depending on the document
encoding, with no way out (can't use entities in element names!).
A document which contains <g:ça/> (if mail screws up: c-cedilla) can
never be serialized as US-ASCII.
And what if you later decide to write a DTD/Schema for your XML?
--
Bart.
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Ken MacLeod
Bart Schuller
Aaron Straup Cope
|