On Thursday 14 March 2002 01:45, Gavin Carr wrote:
> Some of my users are using (an old?) Framemaker to produce xml
> documents, and I've noticed that the stylesheet links seem to be getting
> created using <?xml:stylesheet?> (with a colon) rather than the standard
> <?xml-stylesheet?> form. I can workaround it by associating the
> stylesheets in other ways, of course, but can AxKit be configured to
> recognise these at all?

As Matt said, you can hack it into AxKit. However I'd recommend against that 
approach as it is working around a rather bad bug. I guess we could provide 
an AxGetStyles directive that would allow one to implement his own getstyles 
but I'm not certain that's a good idea either. Note that when running under 
namespaces, colons in PI names are normally forbidden (though parsers tend to 
be lax about that unfortunately). Mapping to styles with other approaches is 
definitely preferable.

A better solution imho would be a simple SAX filter that would correct the 
data before it is made available to AxKit. The following (untested) filter 
would probably work:

package FixBadPIs;
use strict;
use base qw(XML::SAX::Base);

sub processing_instruction {
  my $self = shift;
  my $pi = shift;
  $pi->{Target} = 'xml-stylesheet' if $pi->{Target} eq 'xml:stylesheet'
  $self->SUPER::processing_instruction($pi);
}

1;

You could then set that filter up between any parser and XML::SAX::Writer, or 
with XML::SAX::Machines. Batching all files should be trivial.

> What's the status of the <?xml:stylesheet?> form - alternate/deprecated?
> IE, I notice, seems to accept it quite happily.

Well in that case IE is being rather braindead. It's a well-formedness error 
as per the namespace spec.

-- 
_______________________________________________________________________
Robin Berjon <[EMAIL PROTECTED]> -- CTO
k n o w s c a p e : // venture knowledge agency www.knowscape.com
-----------------------------------------------------------------------
"Science is like sex: sometimes something useful comes out, but that
is not the reason we are doing it." -- R. Feynman


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to