Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
How to get the HTML code for a given XML through XSLT
krish26
Hi All,
I want to get the HTML code for a given XML through XSLT, and I've tried this in PERL using XML::XSLT Perl Module. The problem i'm facing is the following code always printing the last value of the
node, can someone can help me on, where I went wrong? or is their any other proper way to write this perl code.
Here are the code files, and the Output
#!/iw-home/iw-perl/bin/iwperl
# import required modules
use XML::XSLT;
# define local variables
my $xslfile = "test.xsl";
my $xmlfile = "test.xml";
my $xslt = XML::XSLT->new ($xslfile);
#$xslt->transform($xmlfile);
$xslt->transform($xmlfile);
print $xslt->toString;
# free up some memory
$xslt->dispose();
==========================================================
Current Output is:
$URL_PREFIX/images/86by78/86x78_24.gif
Desc Test Page
$URL_PREFIX/images/86by78/86x78_24.gif
Desc Test Page
$URL_PREFIX/images/86by78/86x78_24.gif
Desc Test Page
Find more posts tagged with
Comments
vpatel
Preview your post -- its broken. Please fix that first.
Tircdatag05 (1).rptdesign
krish26
Hi all,
Can anyone help me regarding this please ?
vpatel
Your post isn't making much sense. Please provide details in terms which node (provide XPath) in the XML structure gets displayed only once. Also the XML / XSL you attached seems to be component's XML / XSL -- why are you trying to generate that with a perl module?
Nikunj
Are you trying to replicate tpl functionality with xslt?
If yes than why go through this hard way.
Try this below code in your tpl.
you can find more information on this in tag lib.
< iw_ostream file='o/p filepath' >
< iwov_xslt xsl_file='/templatedata/../abc.xsl' >
< iw_include_dcr / >
< /iwov_xslt >
< /iw_ostream >