I want to know if libXSLT in
Perl -v This is perl, v5.8.8 built for darwin-thread-multi-2level Copyright 19 +87-2006, Larry Wall....
on following OSX's build
uname -a Darwin machine-maci 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18 +:40:58 PST 2015; root:xnu3248.30.4~1/RELEASE_X86_64 x86_64
not support the exsl extensions at all. Or is it something that I am missing in my OSX's Perl-5.8.8 build which is causing it not support it?
===UPDATE===
1) I have a transformation xsl file which is as follows
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Tr +ansform" xmlns:xalan="http://xml.apache.org/xslt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="ye +s" media-type="text/xml"/> <xsl:param name="isfile"/> <xsl:variable name="current-year"> <xsl:value-of select="date:year()"/> </xsl:variable> <xsl:template match="/"> <xsl:when test="$isfile = 'true'"> <exsl:document href = "outputfile1.xml" method="xml" versi +on="1.0" encoding="UTF-8" indent="yes"> Article:- <xsl:value-of select="/Article/Title"/> Authors:- <xsl:apply-templates select="/Article/Author +s/Author"/> </exsl:document> </xsl:if> </xsl:template> <xsl:template match="Author"> <exsl:document href = "outputfile2.xml" method="xml" version=" +1.0" encoding="UTF-8" indent="yes"> always Generate this output!! <xsl:value-of select="." /> </exsl:document> </xsl:template> </xsl:stylesheet>
2) I have an example file which needs to transformed and output needs to generated to output1.xml and output2.xml depending on condition in the xsl file
<?xml version="1.0"?> <?xml-stylesheet type="xsl" href="trans.xsl"?> <Article> <Title>My Article</Title> <Authors> <Author>Mr. Foo</Author> <Author>Mr. Bar</Author> </Authors> <Body>This is my article text.</Body> </Article>
3) Here is the perl script that I use for transformation
#!/usr/local/bin/perl -w use strict; use warnings; use File::Path; use File::Spec; use File::Basename; use XML::LibXSLT; use XML::LibXML; my $isfile; my ($xmlfile,$xsltfile,$samplefile) = qw/ Example.xml trans.xsl sample +.xml/; if(-f $samplefile) { $isfile = "true"; print "File is present\n"; } else { $isfile = "false"; print "File is absent\n"; } my %args = ( "isfile" => $isfile ); my $xslt = XML::LibXSLT->new; my $stylesheet = $xslt->parse_stylesheet_file($xsltfile); my $results = $stylesheet->transform_file($xmlfile,XML::LibXSLT::xpath_to_string(%{a +rgs})); 0;
When the script is ran, I get following error on OS X I get the following error.
xmlXPathCompOpEval: function year not found Unregistered function xmlXPathCompiledEval: evaluation failed runtime error: file trans.xsl line 24 element value-of XPath evaluation returned no result.
However, for the same use case when executed with Perl 5.8.8 on Win7 and Debian 8.3, I am getting no errors. This (usage of outdated Perl in production environment) is something that I can not control and I am still waiting for Perl 5.2x to arrive at my workplace.

In reply to exsl in libXSLT in Perl 5.8.8 on OSX by Recker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.