in reply to Re: Conversion of Files Using XSLT
in thread Conversion of Files Using XSLT

Hi Corion,

I am doing that using xsltproc linux command as XML::XSLT is not supporting tag values match constraints.

Command: xsltproc test.xsl TEST_FILE.XML

Replies are listed 'Best First'.
Re^3: Conversion of Files Using XSLT
by Corion (Patriarch) on Dec 14, 2016 at 09:53 UTC

    Is xsltproc written in Perl?

    If not, you're highly unlikely to find support for xsltproc and XSLT on a forum that is geared towards learning Perl and its modules.

      /usr/bin/xsltproc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=7778a36932ecce71d670e5e3d540c46073b201c5, stripped

      This whole thread is seemingly entirely unrelated to Perl in any way.

      Can you help me to get this done in using perl module XML::XSLT ?

      I have compared and tested the xsl using XML::XSLT and various online tools. Both gave different output. For me Online tool gave me correct output. Hence I switched to xsltproc linux command over than XSLT CPAN module.

        Looking at the SYNOPSIS section of XML::XSLT, I see the following code:

        use XML::XSLT; my $xslt = XML::XSLT->new ($xsl, warnings => 1); $xslt->transform ($xmlfile); print $xslt->toString; $xslt->dispose();

        How does that code fail for you or where do you have problems adapting it to your use case?

        Looking at the SYNOPSIS section of XML::LibXSLT, I see the following code:

        use XML::LibXSLT; use XML::LibXML; my $xslt = XML::LibXSLT->new(); my $source = XML::LibXML->load_xml(location => 'foo.xml'); my $style_doc = XML::LibXML->load_xml(location=>'bar.xsl', no_cdata= +>1); my $stylesheet = $xslt->parse_stylesheet($style_doc); my $results = $stylesheet->transform($source); print $stylesheet->output_as_bytes($results);

        How does that code fail for you or where do you have problems adapting it to your use case?