cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] XSPSyntax Thu May 29 23:00:18 2003
Date Thu, 29 May 2003 21:00:19 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=XSPSyntax , version: 8 on Thu May 29 20:41:44
2003 by 198.214.51.1

- Describes XML syntax for [XSP]
+ Describes XML syntax for [<B style="color:black;background-color:#A0FFFF">XSP</B>]
- To use XSP tags you must include the XSP namespace. Example:
+ To use <B style="color:black;background-color:#A0FFFF">XSP</B> tags you must
include the <B style="color:black;background-color:#A0FFFF">XSP</B> namespace.
Example:
- <xsp:page xmlns:xsp="http://apache.org/xsp">
- </xsp:page>
+ <<B style="color:black;background-color:#A0FFFF">xsp</B>:page xmlns:<B
style="color:black;background-color:#A0FFFF">xsp</B>="http://apache.org/<B style="color:black;background-color:#A0FFFF">xsp</B>">
+ </<B style="color:black;background-color:#A0FFFF">xsp</B>:page>
- !xsp:page
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:page
- Is the root element of every XSP document. Inside this tag you put all the others tags you
will need. The use of this tag is mandatory.
+ Is the root element of every <B style="color:black;background-color:#A0FFFF">XSP</B>
document. Inside this tag you put all the others tags you will need. The use of this tag is
mandatory.
?                              ++++++++++++++++++++++++++++++++++++++++++++++++   ++++

- Note that, this is ''not'' the root element of the generated document. During the translation
process -- in which the XSP page is turned in source code for a particular language -- all
elements in the XSP namespace are replaced with programming language structures, i.e. imports,
code blocks, statements, expressions, etc.
+ Note that, this is ''not'' the root element of the generated document. During the translation
process -- in which the <B style="color:black;background-color:#A0FFFF">XSP</B>
page is turned in source code for a particular language -- all elements in the <B style="color:black;background-color:#A0FFFF">XSP</B>
namespace are replaced with programming language structures, i.e. imports, code blocks, statements,
expressions, etc.
?                                                                                        
                              ++++++++++++++++++++++++++++++++++++++++++++++++   ++++    
                                                                           ++++++++++++++++++++++++++++++++++++++++++++++++
  ++++

- All XSP pages will end up generating a subclass of {{XSPGenerator}}. See the [XSP Environment]
for more details.
+ All <B style="color:black;background-color:#A0FFFF">XSP</B> pages will end up
generating a subclass of {{XSPGenerator}}. See the [<B style="color:black;background-color:#A0FFFF">XSP</B>
Environment] for more details.
- The XML Namespaces for all [Logicsheet]s referenced by this XSP page should be declared
here, along with the XSP namespace itself. You should avoid using the default namespace on
XSP elements as you'll have to redeclare it on all of your own elements should they not be
in a namespace of their own.
+ The XML Namespaces for all [Logicsheet]s referenced by this <B style="color:black;background-color:#A0FFFF">XSP</B>
page should be declared here, along with the <B style="color:black;background-color:#A0FFFF">XSP</B>
namespace itself. You should avoid using the default namespace on <B style="color:black;background-color:#A0FFFF">XSP</B>
elements as you'll have to redeclare it on all of your own elements should they not be in
a namespace of their own.
?                                                             ++++++++++++++++++++++++++++++++++++++++++++++++
  ++++                                              ++++++++++++++++++++++++++++++++++++++++++++++++
  ++++                                                                   ++++++++++++++++++++++++++++++++++++++++++++++++
  ++++

- The page element should have a {{language}} attribute, indicating the programming language
used within that page. Therefore, while XSP may be language neutral, each page is tied to
a ''specific'' language.
+ The page element should have a {{language}} attribute, indicating the programming language
used within that page. Therefore, while <B style="color:black;background-color:#A0FFFF">XSP</B>
may be language neutral, each page is tied to a ''specific'' language.
?                                                                                        
                                           ++++++++++++++++++++++++++++++++++++++++++++++++
  ++++

- The page element may contain several children, but can only have a ''single'' child which
is not in the XSP namespace. This ''user'' element will become the root of the generated document.
+ The page element may contain several children, but can only have a ''single'' child which
is not in the <B style="color:black;background-color:#A0FFFF">XSP</B> namespace.
This ''user'' element will become the root of the generated document.
?                                                                                        
                ++++++++++++++++++++++++++++++++++++++++++++++++   ++++

- Children: single user element, {{xsp:structure}}, {{xsp:logic}}, {{xsp:init-page}}
+ Children: single user element, {{<B style="color:black;background-color:#A0FFFF">xsp</B>:structure}},
{{<B style="color:black;background-color:#A0FFFF">xsp</B>:logic}}, {{<B style="color:black;background-color:#A0FFFF">xsp</B>:init-page}}
- !xsp:structure && xsp:include
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:structure &&
<B style="color:black;background-color:#A0FFFF">xsp</B>:include
- In Java these elements are used to signify import statements for the generated class. You
should include imports for any classes in the Java API, or those from your own class libraries
that are required by code in the XSP.
+ In Java these elements are used to signify import statements for the generated class. You
should include imports for any classes in the Java API, or those from your own class libraries
that are required by code in the <B style="color:black;background-color:#A0FFFF">XSP</B>.
?                                                                                        
                                                                                         
                                        ++++++++++++++++++++++++++++++++++++++++++++++++ 
 ++++

- Children: (xsp:structure) {{xsp:include}}; (xsp:include) none
+ Children: (<B style="color:black;background-color:#A0FFFF">xsp</B>:structure)
{{<B style="color:black;background-color:#A0FFFF">xsp</B>:include}}; (<B style="color:black;background-color:#A0FFFF">xsp</B>:include)
none
- !xsp:init-page
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:init-page
- !xsp:exit-page
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:exit-page
- !xsp:logic
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:logic
- xsp:logic elements that appear outside of the ''user'' element are deemed to be class level
methods and declarations -- i.e. static methods, member variables, etc.
+ <B style="color:black;background-color:#A0FFFF">xsp</B>:logic elements that
appear outside of the ''user'' element are deemed to be class level methods and declarations
-- i.e. static methods, member variables, etc.
? ++++++++++++++++++++++++++++++++++++++++++++++++   ++++

- xsp:logic elements used elsewhere result in the addition of these code blocks to the {{generate()}}
method.
+ <B style="color:black;background-color:#A0FFFF">xsp</B>:logic elements used
elsewhere result in the addition of these code blocks to the {{generate()}} method.
? ++++++++++++++++++++++++++++++++++++++++++++++++   ++++

- The xsp:logic element is much friendlier than the equivalent <% %> JSP syntax. For
example in JSP it's common to see blocks of the form:
+ The <B style="color:black;background-color:#A0FFFF">xsp</B>:logic element is
much friendlier than the equivalent <% %> JSP syntax. For example in JSP it's common
to see blocks of the form:
?     ++++++++++++++++++++++++++++++++++++++++++++++++   ++++

- In an xsp:logic element this would look like:
+ In an <B style="color:black;background-color:#A0FFFF">xsp</B>:logic element
this would look like:
- <xsp:logic>
+ <<B style="color:black;background-color:#A0FFFF">xsp</B>:logic>
- </xsp:logic>
+ </<B style="color:black;background-color:#A0FFFF">xsp</B>:logic>
- The XSLT transform used to create the code can then handle these differently: text contained
within an xsp:logic element is treated as Java code, whereas elements not in the XSP namespace
are substituted by program code that will fire the required SAX events.
+ The XSLT transform used to <B style="color:black;background-color:#ffff66">create</B>
the code can then handle these differently: text contained within an <B style="color:black;background-color:#A0FFFF">xsp</B>:logic
element is treated as Java code, whereas elements not in the <B style="color:black;background-color:#A0FFFF">XSP</B>
namespace are substituted by program code that will fire the required SAX events.
?                            ++++++++++++++++++++++++++++++++++++++++++++++++      ++++  
                                                                   ++++++++++++++++++++++++++++++++++++++++++++++++
  ++++                                                                    ++++++++++++++++++++++++++++++++++++++++++++++++
  ++++

- An xsp:logic element can contain xsp:expr elements, xsp:content elements, or elements that
will be passed directly to the generated document. Ensure however that the content remains
well-formed.
+ An <B style="color:black;background-color:#A0FFFF">xsp</B>:logic element can
contain <B style="color:black;background-color:#A0FFFF">xsp</B>:expr elements,
<B style="color:black;background-color:#A0FFFF">xsp</B>:content elements, or elements
that will be passed directly to the generated document. Ensure however that the content remains
well-formed.
-   <xsp:logic>
+   <<B style="color:black;background-color:#A0FFFF">xsp</B>:logic>
-   </xsp:logic>
+   </<B style="color:black;background-color:#A0FFFF">xsp</B>:logic>
- However if you attempt to load this XSP page you'll get a 404 Not Found error. Digging into
the {{cocoon.log}} will show that an exception has been thrown whilst parsing the XSP page:
+ However if you attempt to load this <B style="color:black;background-color:#A0FFFF">XSP</B>
page you'll get a 404 Not Found error. Digging into the {{cocoon.log}} will show that an exception
has been thrown whilst parsing the <B style="color:black;background-color:#A0FFFF">XSP</B>
page:
?                                     ++++++++++++++++++++++++++++++++++++++++++++++++   ++++
                                                                                         
                                            ++++++++++++++++++++++++++++++++++++++++++++++++
  ++++

-   <xsp:logic>
+   <<B style="color:black;background-color:#A0FFFF">xsp</B>:logic>
-   </xsp:logic>
+   </<B style="color:black;background-color:#A0FFFF">xsp</B>:logic>
- !xsp:expr
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:expr
- An xsp:expr element is used to signify Java expressions, and is equivalent to the <%=
%> syntax in JSP. 
+ An <B style="color:black;background-color:#A0FFFF">xsp</B>:expr element is used
to signify Java expressions, and is equivalent to the <%= %> syntax in JSP. 
?    ++++++++++++++++++++++++++++++++++++++++++++++++   ++++

- The contents of an xsp:expr element is passed directly to the XSPObjectHelper.xspExpr(contentHandler,
...) method. Therefore it's an ''expression'' and not a ''statement''. As it is not a statement
there is no need to terminate the text content with a semi-colon. 
+ The contents of an <B style="color:black;background-color:#A0FFFF">xsp</B>:expr
element is passed directly to the XSPObjectHelper.xspExpr(contentHandler, ...) method. Therefore
it's an ''expression'' and not a ''statement''. As it is not a statement there is no need
to terminate the text content with a semi-colon. 
?                    ++++++++++++++++++++++++++++++++++++++++++++++++   ++++

- Can be used within both user elements and other XSP elements.
+ Can be used within both user elements and other <B style="color:black;background-color:#A0FFFF">XSP</B>
elements.
- !xsp:element
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:element
- XSLT provides two mechanisms to create elements for output from a transformation. The elements
can either be present directly in the stylesheet (literal result elements) or generated dynamically
using xsl:element. This 
+ XSLT provides two mechanisms to <B style="color:black;background-color:#ffff66">create</B>
elements for output from a transformation. The elements can either be present directly in
the stylesheet (literal result elements) or generated <B style="color:black;background-color:#99ff99">dynamically</B>
using xsl:element. This 
?                                 ++++++++++++++++++++++++++++++++++++++++++++++++      ++++
                                                                                         
                                                      ++++++++++++++++++++++++++++++++++++++++++++++++
          ++++

- XSP provides a directly equivalent mechanism. We've already seen that user elements can
be added to the XSP page and these are sent directly to the output. These are the equivalent
to XSL literal result elements. Dynamically created elements can be produced using the xsp:element.
+ <B style="color:black;background-color:#A0FFFF">XSP</B> provides a directly
equivalent mechanism. We've already seen that user elements can be added to the <B style="color:black;background-color:#A0FFFF">XSP</B>
page and these are sent directly to the output. These are the equivalent to XSL literal result
elements. <B style="color:black;background-color:#99ff99">Dynamically</B> created
elements can be produced using the <B style="color:black;background-color:#A0FFFF">xsp</B>:element.
- The name of the dynamically created element should be defined by including an 
+ The name of the <B style="color:black;background-color:#99ff99">dynamically</B>
created element should be defined by including an 
?                 ++++++++++++++++++++++++++++++++++++++++++++++++           ++++

- xsp:param child of this element. This xsp:param element must have the value of it's name
attribute be "name". The contents of this element must be an xsp:expr element which contains
the code that will generate the element name, or "someString" (including quotes).
+ <B style="color:black;background-color:#A0FFFF">xsp</B>:param child of this
element. This <B style="color:black;background-color:#A0FFFF">xsp</B>:param element
must have the value of it's name attribute be "name". The contents of this element must be
an <B style="color:black;background-color:#A0FFFF">xsp</B>:expr element which
contains the code that will generate the element name, or "someString" (including quotes).
? ++++++++++++++++++++++++++++++++++++++++++++++++   ++++                                
  ++++++++++++++++++++++++++++++++++++++++++++++++   ++++                                
                                                                            ++++++++++++++++++++++++++++++++++++++++++++++++
  ++++

- Children: {{xsp:param}}, {{xsp:attribute}}.
+ Children: {{<B style="color:black;background-color:#A0FFFF">xsp</B>:param}},
{{<B style="color:black;background-color:#A0FFFF">xsp</B>:attribute}}.
- !xsp:attribute
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:attribute
- Used to create an attribute. Similar to xsl:attribute.
+ Used to <B style="color:black;background-color:#ffff66">create</B> an attribute.
Similar to xsl:attribute.
- Should contain an xsp:param element whose name is "name". This indicates the name of the
element. A namespace can be assigned by including two additional parameters with the name
"uri" and "prefix". It is an error to only provide one of these.
+ Should contain an <B style="color:black;background-color:#A0FFFF">xsp</B>:param
element whose name is "name". This indicates the name of the element. A namespace can be assigned
by including two additional parameters with the name "uri" and "prefix". It is an error to
only provide one of these.
?                   ++++++++++++++++++++++++++++++++++++++++++++++++   ++++

- Children: {{xsp:param}}, {{xsp:expr}}
+ Children: {{<B style="color:black;background-color:#A0FFFF">xsp</B>:param}},
{{<B style="color:black;background-color:#A0FFFF">xsp</B>:expr}}
- !xsp:content
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:content
- !xsp:pi
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:pi
- Used to create a processing instruction. 
+ Used to <B style="color:black;background-color:#ffff66">create</B> a processing
instruction. 
- Should contain an xsp:param element whose name is "target". This indicates the target of
the processing instruction. The content can described using the content of the xsp:pi element,
or nested xsp:expr elements. 
+ Should contain an <B style="color:black;background-color:#A0FFFF">xsp</B>:param
element whose name is "target". This indicates the target of the processing instruction. The
content can described using the content of the <B style="color:black;background-color:#A0FFFF">xsp</B>:pi
element, or nested <B style="color:black;background-color:#A0FFFF">xsp</B>:expr
elements. 
- !xsp:comment
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:comment
- Used to create a comment inside the generated source code.
+ Used to <B style="color:black;background-color:#ffff66">create</B> a comment
inside the generated source code.
- !xsp:param
+ !<B style="color:black;background-color:#A0FFFF">xsp</B>:param



Mime
View raw message