Check out
http://search.cpan.org/~msergeant/AxKit-1.6.2/lib/Apache/AxKit/Language/XSP/
TaglibHelper.pm
And pay particular attention to the "as_xml" option. An example would be:
package My::Taglib;
use Apache::AxKit::Language::XSP::TaglibHelper;
@ISA = qw( Apache::AxKit::Language::XSP::TaglibHelper );
## Edit $NS to be the namespace URI you want
$NS = 'http://apache.org/xsp/testtaglib/v1';
## Edit @EXPORT_TAGLIB as needed
@EXPORT_TAGLIB = (
'func1($arg1):as_xml=1',
);
use strict;
sub func1 {
my ( $arg1 ) = @_ ;
...
return '<title>$arg1</title>';
}
-----Original Message-----
From: Lars Skj�rlund [mailto:[EMAIL PROTECTED]
Sent: Monday, January 31, 2005 4:37 AM
To: AxKit Users Mailing List <[email protected]
Subject: How to return XML code from taglib?
Hi list,
I'm trying to figure out how to return XML code from a taglib?
When I try to return, say, like the following:
return '<title>My doc</title>';
what is actualle returned is '<title>My doc</title>'.
I'm using TaglibHelper, and I'm perfectly aware that I can return, say, {
title => 'My doc' }. However, in the present situation, I'm fetching a large
pre-formatted Docbook document from a database, so it would be impractical
at best to convert it to an anonymous hash.
But I cannot figure out how to return the string literal - ie., with the XML
tags intact.
Regards,
Lars
Lars Skj�rlund, Network Consultant, Spinn International ApS Bukkeballevej
30, 2960 Rungsted Kyst, Denmark
Tel.: +45 70 25 88 10, Fax: +45 70 25 88 44
Mail: [EMAIL PROTECTED] Web: http://www.spinn.dk
--
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]