Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0" encoding="UTF-8"?>
<!--

DTD for the files used with the ScriptParser class and Script component.  
This is recognized with the public identifier:

	-//Apache Software Foundation//Tapestry Script Specification 4.0//EN

The canonical location for the DTD is:

	http://tapestry.apache.org/dtd/Script_4_0.dtd

The root element is always script.
	
This DTD is backwards compatible with the 1.2 DTD, with the following exceptions:
- Addition of <unique> element
- Addition of unique attribute to <let> element
- Addition of index attribute to <foreach> element
-->
<!-- =======================================================

Entity: full-content

Identifies the contents of most of the other elements.

-->
<!ENTITY % full-content "(#PCDATA | foreach | if | if-not | unique)*">
<!-- =======================================================

Element: body
Contained by: script

Allows a mix of text and control elements.  This text is added to
the large scripting block just inside the <body> tag.
-->
<!ELEMENT body %full-content;>
<!-- =======================================================

Element: foreach
Appears in: %full-content;

Iterates over a list of items; this is modeled after the
For component.  No iteration occurs if the value
from the expression is null.

Attributes:
  key: Defines the symbol into which each succesive value is stored.
  index: Defines the symbol into which the index of the value of the current iteration is stored.
  expression: The source of values, as an OGNL expression rooted in the symbols Map.
-->
<!ELEMENT foreach %full-content;>
<!ATTLIST foreach
  key CDATA #IMPLIED
  index CDATA #IMPLIED
  expression CDATA #REQUIRED
>

<!-- =======================================================
Element: include-script
Contained by: script

Inserts a reference to an external, static, JavaScript file.

Attributes:
  resource-path: The path to the script within the classpath.
-->
<!ELEMENT include-script EMPTY>
<!ATTLIST include-script
  resource-path CDATA #REQUIRED
>

<!-- =======================================================

Element: if
Appears in: %full-content;

Creates a conditional portion of the script; The body of the element 
is only included if the expression evaulates to true.

Attributes:
  expression: The trigger expression, as an OGNL expression rooted in 
    the symbols Map.

-->
<!ELEMENT if %full-content;>
<!ATTLIST if
  expression CDATA #REQUIRED
>
<!-- =======================================================

Element: if-not
Appears in: %full-content;

Creates a conditional portion of the script; The body of the element 
is only included if the property-path evaulates to false.

Attributes:
  expression: The trigger expression, as an OGNL expression rooted in 
    the symbols Map.

-->
<!ELEMENT if-not %full-content;>
<!ATTLIST if-not
  expression CDATA #REQUIRED
>
<!-- =======================================================
Element: initialization
Contained by: script

Text in this block is added to the event handler for the <body>
tag's onLoad event.
-->
<!ELEMENT initialization %full-content;>



<!-- =======================================================
Element: input-symbol
Contained by: script

Defines an input symbol used by the script.
Attributes:
  key: The name of the symbol.
  class:  If specified, the exected class or interface for the symbol.
  required: If yes, then the symbol must be non-null.
-->

<!ELEMENT input-symbol EMPTY>
<!ATTLIST input-symbol
  key CDATA #REQUIRED
  class CDATA #IMPLIED
  required (yes|no) "no"
>

<!-- =======================================================

Element: let
Contained by: script

Used to create a new symbol. The content of the tag
is used to create a string that is the name.  If the
unique flag is enabled, the name is ensured to be unique
(a suffix may be appended to ensure it is unique
among all names so generated).

Attributes:
  key: The name of the symbol to create.
  unique: If yes, the name is ensured to be unique.
  The default is no.

-->
<!ELEMENT let %full-content;>
<!ATTLIST let
  key CDATA #REQUIRED
  unique (yes|no) "no"
>
<!-- =======================================================

Element: script

Root element.

Allows zero or more let elements (to establish new symbols),
followed by a body and/or initialization element.

-->
<!ELEMENT script (include-script*, input-symbol*, 
	(let | set)*, body?, initialization?)>


<!-- =======================================================

Element: set
Contained by: script

Creates a new symbol as the result of evaluating an OGNL expression.

-->
<!ELEMENT set EMPTY>
<!ATTLIST set
  key CDATA #REQUIRED
  expression CDATA #REQUIRED
>

<!-- =======================================================

Element: unique
Appears in: %full-content;

Defines a block that only is rendered once per page.
This is appropriate to certain kinds of initialization code
that should not be duplicated, even if the script is
executed multiple times.

-->
<!ELEMENT unique %full-content;>
New to GrepCode? Check out our FAQ X