[Catalyst-commits] r8643 - in
trunk/Catalyst-View-XSLT/lib/Catalyst: Helper/View View
View/XSLT/XML
janus at dev.catalyst.perl.org
janus at dev.catalyst.perl.org
Mon Nov 24 07:46:45 GMT 2008
Author: janus
Date: 2008-11-24 07:46:45 +0000 (Mon, 24 Nov 2008)
New Revision: 8643
Modified:
trunk/Catalyst-View-XSLT/lib/Catalyst/Helper/View/XSLT.pm
trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT.pm
trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT/XML/LibXSLT.pm
Log:
clean up pod whitespacing and indentation
Modified: trunk/Catalyst-View-XSLT/lib/Catalyst/Helper/View/XSLT.pm
===================================================================
--- trunk/Catalyst-View-XSLT/lib/Catalyst/Helper/View/XSLT.pm 2008-11-24 00:52:17 UTC (rev 8642)
+++ trunk/Catalyst-View-XSLT/lib/Catalyst/Helper/View/XSLT.pm 2008-11-24 07:46:45 UTC (rev 8643)
@@ -56,23 +56,23 @@
# example configuration
-# __PACKAGE__->config(
-# # relative paths to the directories with templates
-# INCLUDE_PATH => [
-# MyApp->path_to( 'root', 'xslt' ),
-# MyApp->path_to( 'templates', 'xsl' ),
-# ],
-# TEMPLATE_EXTENSION => '.xsl', # default extension when getting template name from the current action
-# DUMP_CONFIG => 1, # use for Debug. Will dump the final (merged) configuration for XSLT view
-# LibXSLT => { # XML::LibXSLT specific parameters
-# register_function => [
-# {
-# uri => 'urn:catalyst',
-# name => 'Hello',
-# subref => sub { return $_[0] },
-# }
-# ],
-# },
+#__PACKAGE__->config(
+# # relative paths to the directories with templates
+# INCLUDE_PATH => [
+# MyApp->path_to( 'root', 'xslt' ),
+# MyApp->path_to( 'templates', 'xsl' ),
+# ],
+# TEMPLATE_EXTENSION => '.xsl', # default extension when getting template name from the current action
+# DUMP_CONFIG => 1, # use for Debug. Will dump the final (merged) configuration for XSLT view
+# LibXSLT => { # XML::LibXSLT specific parameters
+# register_function => [
+# {
+# uri => 'urn:catalyst',
+# name => 'Hello',
+# subref => sub { return $_[0] },
+# },
+# ],
+# },
#);
=head1 NAME
@@ -81,7 +81,7 @@
=head1 SYNOPSIS
- See L<[% app %]>
+L<[% app %]>
=head1 DESCRIPTION
Modified: trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT/XML/LibXSLT.pm
===================================================================
--- trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT/XML/LibXSLT.pm 2008-11-24 00:52:17 UTC (rev 8642)
+++ trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT/XML/LibXSLT.pm 2008-11-24 07:46:45 UTC (rev 8643)
@@ -132,4 +132,3 @@
=cut
1;
-__END__
Modified: trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT.pm
===================================================================
--- trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT.pm 2008-11-24 00:52:17 UTC (rev 8642)
+++ trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT.pm 2008-11-24 07:46:45 UTC (rev 8643)
@@ -26,35 +26,35 @@
use base 'Catalyst::View::XSLT';
__PACKAGE__->config(
- # paths to the directories with templates
- INCLUDE_PATH => [
- MyApp->path_to( 'root', 'xslt' ),
- MyApp->path_to( 'templates', 'xsl' ),
- ],
+ # paths to the directories with templates
+ INCLUDE_PATH => [
+ MyApp->path_to( 'root', 'xslt' ),
+ MyApp->path_to( 'templates', 'xsl' ),
+ ],
- # default template extension to use
- # when you don't provide template name
- TEMPLATE_EXTENSION => '.xsl',
+ # default template extension to use
+ # when you don't provide template name
+ TEMPLATE_EXTENSION => '.xsl',
- # use this for debug purposes
- # it will dump the the final (merged) config
- DUMP_CONFIG => 1,
+ # use this for debug purposes
+ # it will dump the the final (merged) config
+ DUMP_CONFIG => 1,
- # XML::LibXSLT specific configuration
- LibXSLT => {
- register_function => [
- {
- uri => 'urn:catalyst',
- name => 'add',
- subref => sub { return $_[0] + $_[1] },
- },
- {
- uri => 'urn:foo',
- name => 'Hello',
- subref => sub { return 'Hello, Catalyst\'s user.' },
- }
- ],
- },
+ # XML::LibXSLT specific configuration
+ LibXSLT => {
+ register_function => [
+ {
+ uri => 'urn:catalyst',
+ name => 'add',
+ subref => sub { return $_[0] + $_[1] },
+ },
+ {
+ uri => 'urn:foo',
+ name => 'Hello',
+ subref => sub { return 'Hello, Catalyst\'s user.' },
+ },
+ ],
+ },
);
# don't need nothing more
@@ -64,42 +64,42 @@
# In your controller(s) :
sub someAction : Local {
- # 'template' could be string or path to file
- # see 'xml' for more info about string version
+ # 'template' could be string or path to file
+ # see 'xml' for more info about string version
- # path to the template could be absolute
- $c->stash->{template} = $c->config->{home} . 'root/some.xsl';
+ # path to the template could be absolute
+ $c->stash->{template} = $c->config->{home} . 'root/some.xsl';
- # or relative
- $c->stash->{template} = 'some.xsl'; # this file will be searched in include paths
+ # or relative
+ $c->stash->{template} = 'some.xsl'; # this file will be searched in include paths
- # or if you didn't provide any template name
- # then the last chance is 'someAction.xsl' ($c->action . $config->{TEMPLATE_EXTENSION})
+ # or if you didn't provide any template name
+ # then the last chance is 'someAction.xsl' ($c->action . $config->{TEMPLATE_EXTENSION})
- # 'xml' could be string
- $c->stash->{xml} =<<XML;
+ # 'xml' could be string
+ $c->stash->{xml} =<<XML;
<root>
- <level1>data</level>
+ <level1>data</level>
</root>
XML
- # or a relative path which will se searched in include paths
- # $c->stash->{xml} = 'my.xml';
+ # or a relative path which will se searched in include paths
+ # $c->stash->{xml} = 'my.xml';
- # or an absolute path
- # $c->stash->{xml} = '/some/where/around.xml';
+ # or an absolute path
+ # $c->stash->{xml} = '/some/where/around.xml';
- # add more subrefs (these will predefine config ones if they overlap)
- $c->stash->{additional_register_function} = [
- {
- uri => 'urn:catalyst',
- name => 'doIt',
- subref => sub { return $obj->method(@_) },
- }
- ];
+ # add more subrefs (these will predefine config ones if they overlap)
+ $c->stash->{additional_register_function} = [
+ {
+ uri => 'urn:catalyst',
+ name => 'doIt',
+ subref => sub { return $obj->method(@_) },
+ }
+ ];
- # everything else in the stash will be used for parameters (<xsl:param name="param1" />)
- $c->stash->{param1} = 'Param1 value';'
- $c->stash->{param2} = 'Param2 value';
+ # everything else in the stash will be used for parameters (<xsl:param name="param1" />)
+ $c->stash->{param1} = 'Param1 value';'
+ $c->stash->{param2} = 'Param2 value';
}
# Meanwhile, maybe in an 'end' action
@@ -108,15 +108,15 @@
# to use your registered functions in some.xsl:
<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:catalyst="urn:catalyst"
- xmlns:foo="urn:foo"
- version="1.0">
- ...
- <xsl:value-of select="catalyst:add(4, 5)" />
- <xsl:value-of select="foo:Hello()" />
- <xsl:value-of select="catalyst:doIt($param1, 3)" />
- ...
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:catalyst="urn:catalyst"
+ xmlns:foo="urn:foo"
+ version="1.0">
+ ...
+ <xsl:value-of select="catalyst:add(4, 5)" />
+ <xsl:value-of select="foo:Hello()" />
+ <xsl:value-of select="catalyst:doIt($param1, 3)" />
+ ...
</xsl:stylesheet>
=head1 DESCRIPTION
More information about the Catalyst-commits
mailing list