KHAMPTON via RT wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=55092 >
>
> <snip/>
>
>> I'd really like if i could do something like this:
>>
>> my $generator = XML::Generator::PerlData->new(
>> Handler => $builder,
>> pi => {
>> xml => {version => '1.0', encoding => 'UTF-8'},
>> 'xml-stylesheet' => {type => 'text/xsl', href => 'my.xsl'}
>> }
>> );
>>
>> Which would then later generate the processing instructions
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <?xml-stylesheet type="text/xsl" href="my.xsl"?>
>>
>> It could also be some kind of general solution where some parts of the
>> perl data structure is mapped to processing instructions.
>>
> Strictly speaking, your example doesn't contain two PIs, it contains one
> XML declaration and one processing instruction. (two different entities
> with two separate SAX methods for parsing/generation). If
> Generator::PerlData isn't reliably generating an XML declaration then
> that's a bug that needs fixing wholly apart from this feature request.
>
Well - I could imagine times where you'd like to use
XML::Generator::PerlData to generate XML fragments to embed in larger
documents, which wouldn't be possible if it always emits an XML declaration.
Show quoted text> That said, yes, I'd be happy to add a processing_instructions option to
> the constructor that would behave as you expect for the 'stylesheet' PI.
Just a single stylesheet parameter could do the trick for me.
Show quoted text> Ticket accepted.
Great! Thanks!
Please let me know if you need anything from me.
Regards,
Michael.