Problems getting start_prefix_mapping to fire

Kjetil Kjernsmo <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
Hello again!

I need to remove some namespace prefix mappings from my result document. 
Now, the problem is that these prefixes occur in attribute values, this is 
actually RDFa. My source document looks like this:
http://svn.kjernsmo.net/RDF-RDFa-Template/trunk/t/data/dbpedia-mustang-
range.input.xhtml
and the result document looks like this:
http://svn.kjernsmo.net/RDF-RDFa-Template/trunk/t/data/dbpedia-mustang-
range.expected.xhtml

As you can see, it needs to retain e.g. the dbp:-prefix but drop the sub:-
prefix, both of which only occur in attribute values.

Thus, I should be in the situation described in
http://perl-xml.sourceforge.net/perl-sax/sax-2.1-
adv.html#startPrefixMapping

but I can't make this work. My code is here
http://svn.kjernsmo.net/RDF-RDFa-
Template/trunk/lib/RDF/RDFa/Template/SAXFilter.pm
and I have a 
sub start_prefix_mapping {
  my ($self, $mapping) = @_;
  warn Data::Dumper::Dumper($mapping);

but I never get warned at all, so it seems to me that the event never fires 
at all. What can I do to get it to fire?

Chris Prather told me that he had worked around this with XML::Toolkit, and 
it seemed to be something about it being called after xml_decl but before 
the root element. We tried various ways to work around this without Moose 
goodness (I'm likely to go that direction, but I was hoping to not go there 
right now), but I didn't find a way.

Here's the test I'm running right now:
http://svn.kjernsmo.net/RDF-RDFa-Template/trunk/t/external.t
The two TODO tests at the bottom should explain what I expect to see that 
I'm not seeing.

Cheers,

Kjetil
-- 
Kjetil Kjernsmo
[email protected]
http://www.kjetil.kjernsmo.net/
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.