The PrettyPrint documentation states: "Comments and processing instructions default to being compact, but you can make particular comments or PIs inline or block by passing appropriate callbacks to the constructor."
However, I can not find any examples on how to preserve whitespace around inline processing instructions.
Here is my code so far:
my $pp = XML::LibXML::PrettyPrint->new(
indent_string => " ",
element => {
inline => [qw/footnoteref span strong em b i a bold bdit ital monetary/],
compact => [qw/title subtitle productid expandlevel ClientID JobID JobName Client City State Zip PoprangeID ClassificationID BudgetMonth li dd dt th td rule/],
preserves_whitespace => [qw/banner pre script style/],
}
);
Sample Input:
<para id="para_11" justify="center" block_type="block">
<bold>"NEW PAGE" <?xpp co;Red;Yellow?>RED on YELLOW<?xpp coend?> Testing 'eop' after an image</bold>
</para>