package Apache::AxKit::Pipeline::DoStyles;

use strict;
use vars qw/@ISA $VERSION/;
use Apache::AxKit::Provider::DOM;
use Apache::AxKit::Provider::Scalar;
use Apache::AxKit::Pipeline;
use AxKit;

@ISA = 'Apache::AxKit::Pipeline';

$VERSION = 1.0; # this fixes a CPAN.pm bug. Bah!

sub get_dom{
	my ($self, $r) = @_;
	my $dom = $self->upstream()->get_dom( $r );
	if($AxKit::Pipeline->pre_styles_pending()) {
		my $provider = Apache::AxKit::Provider::DOM->new( $r, $dom );
		$dom = $AxKit::Pipeline->create_pre_pipeline( $r, $provider )->get_dom( $r );	
	}
	return $dom;
}


sub get_strref{
	my ($self, $r ) = @_;
	my $str_ref = $self->upstream()->get_strref( $r );
	if($AxKit::Pipeline->pre_styles_pending()){
		my $provider = Apache::AxKit::Provider::Scalar->new( $r, ${$str_ref} );
		$str_ref =  $AxKit::Pipeline->create_pre_pipeline( $r, $provider )->get_strref( $r );
	}
	return $str_ref;
}
	
# How do we want to handle all sax queue?	
	
1;


