Matt Sergeant wrote: >>I've been trying to find a way to choose a stylesheet based on some >>arbitrary structures within my source XML. > > What do the structures look like?
The XML source is RDF-XML. I've created a custom Provider to serialize the XML from an RDF database. What I need to match against is the rdf:type of the resource at the requested URI, which can be in one of numerous formats (attribute, element in many possible positions) so matching it is a complex process that I need Perl for.
I've also considered finding the rdf:type within the Provider as I'm accessing the RDF database, and caching it as $self->{rdf_type}, which I could then retrieve later in the DynamicProcessor (since it gets a reference to the $provider). This is probably the simpler way to go now that I think about it.
Perhaps simpler still is to implement the get_styles() method in your Provider subclass.
sub get_styles {
my $self = shift;
my ( $preferred_media_name, $preferred_style_name ) = @_;
my $default_styles = $self->SUPER::get_styles( $preferred_media_name, $preferred_style_name );
# $default_styles is now an array reference containing # the list of styles extracted from stylesheet PIs and # config directives which you can now alter before sending # to AxKit for final processing .... return $new_styles; }
But you're right, Jason, the fact that AddDynamicProcessor only appends to the list of styles regardless of where the directive appears (making it different from the way all the other directive work) indicates, to me at least, that someone cheated and took the "first thing that worked" approah the while implementing it. Someone have counter argument to that?
-kip
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
