Margin Notes using CSS/Perl

Hi Everyone,

I'm trying to convert a job from IF/XX to CSS/Perl and I'm having a little difficulty with the margin notes. Currently, I store paragraph numbers using <px;;0><pa> and output using the OPEN xymacro.  When I try to write (what I think is) an equivalent statement in XyPerl, I get a bunch for question marks displayed.  Has anyone else had this problem or am I just doing something wrong?

CSS:
para[para-number]:before{
content:
-xpp-perl(prelead, '0', '0')
-xpp-perl(xymacro, fg)
-xpp-perl(xymacro, px, '', '0')
attr(para-number)
-xpp-perl(xymacro, pa);
}

XyPerl:
sub seclist {

$X -> open_db('first', 'main', 'stream');
$X -> open_db('first', 'main', 'block');
while ($X -> get_var('!opened')) {
$X -> open_db('first', 'main', 'line');
while ($X -> get_var('!opened')) {
if ($X -> get_var('!flag')) {
if ($X -> get_var('!bwidth') > $X -> get_var('!bdepth')) {
$X -> vm($X -> get_var('!bx'));
} else {
$X -> vm($X -> get_var('!by') + $X -> get_var('!yfinal'));
}
my $paraNum = $X->get_text(0, 'd');
$X -> set_text($paraNum);
$X -> qa();
}
$X -> open_db('next', 'main', 'line');
}
$X -> open_db('next', 'main', 'block');
}
}

Thanks,
Kris