[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Basics of XSLT

Subject: Re: Basics of XSLT
From: himanshu padmanabhi <himanshu.padmanabhi@xxxxxxxxx>
Date: Tue, 10 Mar 2009 15:44:53 +0530
Re:  Basics of XSLT
Thank you.Can anyone explain XPath more?

I was advised to use "XML::LibXSLT::xpath_to_string" in the following code.

 my $parser = XML::LibXML->new();
 my $xslt = XML::LibXSLT->new();

 my $source = $parser->parse_file($xmlfile);
 my $style_doc = $parser->parse_file($xslfile);

 my $stylesheet = $xslt->parse_stylesheet($style_doc);

 my $results = $stylesheet->transform($source,
XML::LibXSLT::xpath_to_string(args => "$in{'args'}",value => "$value",
cnt => "1",);

 print $stylesheet->output_string($results);

On Tue, Mar 10, 2009 at 3:25 PM, Mukul Gandhi <gandhi.mukul@xxxxxxxxx> wrote:
> I'll try to answer this.
> On Tue, Mar 10, 2009 at 2:30 PM, himanshu padmanabhi
> <himanshu.padmanabhi@xxxxxxxxx> wrote:
>> 1.Why XSLT is actually used?and what it is exactly?
> XSLT is a language, which can transform an XML input (with XSLT 2.0,
> we can take a Text input as well) to various kinds of outputs (like
> XML, HTML and Text).
>> 2.I am using XPATH to pass arguments in my perl code.
>>     What is XPATH?and what is its significance?
> XPath is a language to address parts of the XML document. In XPath, we
> write expressions, which return a set of nodes (called sequences in
> XPath 2.0). Though XPath can be used standalone, but it is usually
> used in combination with a language like XSLT or XQuery. XSLT and
> XQuery *need* XPath.
>> 3. <xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> Why this is
>> required at start of every XSL file?
> An XSLT program file is an XML file. By using this namespace in a XSLT
> file, we can distinguish between XSLT language instructions and
> non-XSLT elements/attributes.
> --
> Regards,
> Mukul Gandhi

Himanshu Padmanabhi

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.