-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I thought from my tests that returning an XML-String like this works:
- -----------------------------8<-----------------------------
return <<EOT;
<list>
~ <item name="a" />
~ <item name="b" />
~ <item name="c" />
</list>
EOT
- -----------------------------8<-----------------------------
Tom
Tod Harter schrieb:
| Yeah, I have since tried that. I discovered that it works fine as long
| as you pass only one node in the list, which is probably the best
| practice anyway :). Thanks very much for the help!
|
| Robin Berjon wrote:
|
|> Tod Harter wrote:
|>
|>> This works fine for returning scalars, but if I return an
|>> XML::LibXML::NodeList object tragedy strikes!
|>>
|>> Specifically the callback code is thus:
|>>
|>> sub attributes : CallBack(attributes)
|>> {
|>>
|>> get_logger()->debug("ATTRIBUTES WAS CALLED");
|>> my $df = XML::LibXML::NodeList->new();
|>> for my $key (keys %{get_session_handler()->session()})
|>> {
|>> get_logger()->debug("key is $key");
|>> my $e = XML::LibXML::Element->new('key');
|>> $e->setAttribute('name',$key);
|>> $e->appendText(get_session_handler()->session()->{$key});
|>> $df->push($e);
|>> }
|>> use Data::Dumper;
|>> get_logger()->debug("NODE LIST IS : ".Dumper($df));
|>> return $df;
|>> }
|>
|>
|>
|> There used to be known issues with this, and I don't know if they were
|> fixed so your problem might require some backtracing and XS patching.
|>
|> However I do note that the elements you return belong to no document,
|> which shouldn't happen. Maybe if you passed your function a node from
|> the document it's processing and used that document to create the
|> elements it would work better?
|>
|
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCrZLAkVPeOFLgZFIRAmHBAJ9p/C/8bS5cyTB48k0R1MhTO0L5gQCeNoQm
s0QsCN8VP9I5YJynvu/F40s=
=U1Ps
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]