xsl-list
[Top] [All Lists]

Re: [xsl] Basics of XSLT

2009-03-10 06:15:26
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(_dot_)mukul(_at_)gmail(_dot_)com> wrote:
I'll try to answer this.

On Tue, Mar 10, 2009 at 2:30 PM, himanshu padmanabhi
<himanshu(_dot_)padmanabhi(_at_)gmail(_dot_)com> 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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





-- 
Regards,
Himanshu Padmanabhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>