# File: laszlo.rnc
#
# lzx.rnc is in the RELAXNG Compact syntax:
# http://www.thaiopensource.com/relaxng/compact/syntax.html
#
# lzx.rng is a RELAXNG schema:
# http://www.oasis-open.org/committees/relax-ng/
#
# Note: This is the master schema. lzx.dtd, lzx.rng, lzx.xsd, and lzxdoc.rng
# are all generated from this file.
# * P_LZ_COPYRIGHT_BEGIN ******************************************************
# * Copyright 2001-2006 Laszlo Systems, Inc. All Rights Reserved. *
# * Use is subject to license terms. *
# * P_LZ_COPYRIGHT_END ********************************************************
default namespace = "http://www.laszlosystems.com/2003/05/lzx"
namespace rng = "http://relaxng.org/ns/structure/1.0"
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
namespace lza = "http://www.laszlosystems.com/annotations/1.0"
# Literals
booleanLiteral = xsd:boolean
colorLiteral = string
numberLiteral = xsd:double
sizeLiteral = xsd:double {minInclusive="0"}
inheritableBooleanLiteral = booleanLiteral | "inherit"
constraint = xsd:string {pattern="$(style|path|immediately|once|always)?\{.*\}"}
# Attribute value types
boolean = booleanLiteral | constraint
color = colorLiteral | constraint
script = string
expression = string
reference = string
number = numberLiteral | constraint
size = sizeLiteral | constraint
numberExpression = string
sizeExpression = string
css = string
opacity = xsd:double {minInclusive="0.0" maxInclusive="1.0"} | constraint
percentage = xsd:string {pattern="(\d+(.\d?)|.\d+)%"}
# Grammar
start = canvas | viewElement | library
canvas =
element canvas {
idAttribute? &
oninitAttribute?
& ## The width of the canvas.
[a:defaultValue="500"]
attribute width {sizeLiteral | percentage}?
& ## The height of the canvas.
[a:defaultValue="400"]
attribute height {sizeLiteral | percentage}?
& ## The background color of the canvas.
[a:defaultValue="white"] attribute bgcolor {colorLiteral}?
& ## The string that is used in the browser window.
[a:defaultValue="OpenLaszlo Application"] attribute title {string}?
& ## The default font for views in this application.
[a:defaultValue="lztahoe8"] attribute font {string}?
& ## The default size for views in this application.
[a:defaultValue="8"] attribute fontsize {size}?
& ## The default font style for views in this application. The empty string
## is interpreted as 'plain'.
[a:defaultValue=""] attribute fontstyle
{"bold" | "italic" | "bold italic" | "plain" | ""}?
& attribute layout {css}?
& ## If false, disables validation against the schema during compilation
[a:defaultValue="true"] attribute validate {booleanLiteral}?
& ## If true, requests for data and media are proxied through LPS server.
## if false, requests are made directly to target URLs.
## inherit, inherit from lzproxied query arg.
[a:defaultValue="inherit"] attribute proxied {inheritableBooleanLiteral}?
& ## If true, the application is compiled with debugging enabled.
## See the Debugging chapter of
## the Guide for more information about debugging.
[a:defaultValue="false"] attribute debug {booleanLiteral}?
& ## If present, specifies the maximum width in pixels of any output text field.
## Text which extends beyond this width will be clipped.
## If this attribute is omitted, it defaults to the canvas width.
attribute maxtextwidth {sizeLiteral}?
& ## If present, specifies the maximum height in pixels of any output text field.
## Text which extends beyond this height will be clipped.
## If this attribute is omitted, it defaults to the canvas height.
attribute maxtextheight {sizeLiteral}?
& ## If present, specifies the default timeout in milliseconds of data load requests
attribute dataloadtimeout {numberExpression}?
& ## If present, specifies the default timeout in milliseconds of media load requests
attribute medialoadtimeout {numberExpression}?
& ## A list of names for libraries that are included in the application.
[a:defaultValue=""] attribute libraries {string}?
& [a:defaultValue="true"] attribute embedfonts {booleanLiteral}?
& connection?
& splash?
& datapathChildren
& toplevelElements
& ## The lpsversion of this lzx application.
[a:defaultValue="1.1"] attribute version {string}?
& ## Specifies if this application is intended to be accessible
[a:defaultValue="false"] attribute accessible {booleanLiteral}?
}
library =
element library {
## This attribute is used internally by the compiler. It shouldn't
## be used in user programs.
[lza:visibility="private"]
attribute href {xsd:anyURI} |
([lza:visibility="private"] attribute includes {string}? &
[a:defaultValue="inherit"] attribute proxied {booleanLiteral | "inherit"}? &
(toplevelElements &
## If false, disables validation against the schema during compilation
[a:defaultValue="true"] attribute validate {booleanLiteral}?
& datapointer*))
}
toplevelElements = (
(viewElement | scriptElement | styleSheetElement | asset | font)*
& datasource*
& connectiondatasource*
& dataset*
& debugger?
& command*
& objectElements
& class*
& interface*
& trait*
& includeElement*
& importElement*
& library*
& layout*
& security*
& toplevelSwitch*
)
debugger =
[lza:since="1.1"]
element debug {
viewAttributes &
attribute showInternalProperties {boolean}?
}
includeElement =
element include {
## A reference to a target file whose content is included in the
## application that contains this include element.
attribute href {xsd:anyURI}
& ## If this attribute has the value @c{text}, the content of the
## target file is included as text. Otherwise, it is read as XML.
[a:defaultValue="xml"]
attribute type {"text" | "xml"}?
}
toplevelSwitch = element switch {
element when {
attribute runtime {xsd:string}? &
toplevelElements
}* &
element otherwise {
toplevelElements
}?
}
#
# Attributes
#
idAttribute =
## A unique identifier for this element. Can be used as a global
## variable name in JavaScript code.
[lza:modifiers="final"]
attribute id {xsd:ID}
srcAttribute =
## The path of a file that contains the source for this object.
[lza:modifiers="final"]
attribute src {xsd:anyURI}
nameAttribute =
## The name of a variable that will be set to this object when the
## application is started. If this element is directly within a @e{canvas}
## or @e{library} element, the global variable and the canvas
## property with this name will be set to this object. If this
## element is within another object, that object's property with
## this name will be set to this object.
[lza:modifiers="final"]
attribute name {token}
oninitAttribute =
## The oninit script is executed once, after the element's
## children, if any, have been initialized.
attribute oninit {script}
initstageAttribute =
## The execution of a @c{node}'s
fontstyle and fontsize too) these
## properties cascade down the view hierarchy until a new value is
## specified. When the font attributes are modified at runtime,
## using JavaScript, the font is changed for the view itself, not
## for any of its subviews.
attribute font {string}?,
## The style to use to render text fields that appear inside of
## this view. Once of "plain", "bold" , "italic" or "bolditalic".
attribute fontstyle {string}?,
## Pixel size to use to render text which appears inside this
## view. The default is 8.
attribute fontsize {size}?,
## A resource that is presented in the background of this view. The
## value can be either the name of a resource defined with the
## @e{resource} tag, a URL, or a pathname. If the value is a URL,
## the resource is requested when the view is displayed. If it's a
## pathname, the file named by the pathname is compiled into the
## application, and attached to this view.
attribute resource {string}?,
[lza:visibility="private"]
attribute source {expression}?,
## Clip the view's contents to its size.
[a:defaultValue="false"
lza:modifiers="final"]
attribute clip {boolean}?,
[a:defaultValue="left"
lza:modifiers="final"]
attribute align {"left" | "center" | "right" | constraint}?,
## Creates a constraint on the view's y position which is a function
## of its height and its parent's height. The default for this is
## "top".
[a:defaultValue="top"] attribute valign {"top" | "middle" | "bottom" | constraint}?,
## A CSS sequence of layout parameters in property: value form.
## These values are used to create a layout that is attached to this view.
## If there
## is a class property, it names the class of the layout; otherwise
## axis: x, class: constantlayout;
## axis: y; axis: x; spacing: 5.
attribute layout {css}?,
## The view system supports sub-pixel positioning to enable smooth
## animation. This may be turned off to make the view snap to a
## pixel boundary by setting pixellock to true.
[a:defaultValue="false"
lza:modifiers="final"]
attribute pixellock {booleanLiteral}?,
[a:defaultValue="0"] attribute rotation {numberExpression}?,
## Specifies whether to present the resource attached to this view.
[a:defaultValue="0"] attribute xoffset {numberExpression}?,
## Specifies a translation point for drawing of this view. If the xoffset
## is set, then rotation and x position will be calculated by first adding
## the xoffset.
[a:defaultValue="0"] attribute yoffset {numberExpression}?,
## If true, the resource attached to this view begins playing when
## the view is instantiated.
[a:defaultValue="true"]
attribute play {boolean}?,
#[a:defaultValue="true"]
attribute selectiontype
{"none" | "single" | "toggle" | "multi" | "range"}?,
## Setting stretches causes a view to change its
## coordinate space so that everything it contains (resources and
## other views) fit exactly into the view's width and/or height. The
## default for this property is "none". This is used to resize a
## view's contents by setting its width and/or height.
attribute stretches {"width" | "height" | "both"}?,
[a:defaultValue="true"] attribute visible {boolean}?,
attribute width {sizeExpression}?,
attribute height {sizeExpression}?,
[lza:visibility="private"]
attribute textwidth {sizeExpression}?,
[lza:visibility="private"]
attribute textheight {sizeExpression}?,
## The horizontal offset of this view's upper left corner from the
## upper left corner of its container.
[a:defaultValue="0"]
attribute x {numberExpression}?,
## The vertical offset of this view's upper left corner from the
## upper left corner of its container
[a:defaultValue="0"]
attribute y {numberExpression}?,
## Set accessibility name
attribute aaname {string}?,
## Activate/inactivate children for accessibility
attribute aaactive {boolean}?,
## Set accessibility description
attribute aadescription {string}?,
## Set accessibility tab order
attribute aatabindex {number}?,
## Set accessibility silencing/unsilencing
attribute aasilent {boolean}?,
## Show or hide the hand cursor for this view, if clickable
attribute showhandcursor {boolean}?,
## A list of CSS property names and values that configure the
## behavior of objects, such as data binding and view layouts, that
## operate on this view.
[lza:modifiers="final"]
attribute options {css}?,
eventAttributes
)
eventAttributes =
## The onclick script is executed when the pointing device button is
## clicked over an element.
attribute onclick {script}?,
## The ondblclick script is executed when the pointing device button
## is double clicked over an element.
attribute ondblclick {script}?,
## The onmousedown script is executed when the pointing device button is
## pressed over an element.
attribute onmousedown {script}?,
## The onmouseup script is executed when the pointing device button is
## released over an element.
attribute onmouseup {script}?,
## The onmouseover script is executed when the pointing device is
## moved onto an element.
attribute onmouseover {script}?,
## The onmouseout script is executed when the point device is moved
## so that is is no longer over an element.
attribute onmouseout {script}?,
## The onfocus script is executed when an element receives focus
## either by the pointing device or by tabbing navigation.
attribute onfocus {script}?,
## The onblur script is executed when an element loses focus either
## by the pointing device or by tabbing navigation.
attribute onblur {script}?,
## The onkeydown script is executed when this view has the focus and
## a key is pressed down. Multiple key down events are sent for a
## key that is held down. If you want the script executed only
## once, use onkeyup. This event is sent with the keycode for the key that is
## down.
attribute onkeydown {script}?,
## The onkeyup script is executed when this view has the focus and a
## key is released. This event is sent with the keycode for the key that
## went up.
attribute onkeyup {script}?,
attribute onselect {script}?,
## The ondata script is executed when the data selected by a view's datapath
## changes.
attribute ondata {script}?
#
# View Content
#
viewContent = viewAttributes & viewContentElements
viewContentElements = nodeElements
viewContentElements &=
includeElement*
& viewElement*
& element dataselectionmanager {
idAttribute? &
nameAttribute?
& attribute toggle {boolean}?
& oninitAttribute?
& objectElements
}?
& element selectionmanager {
idAttribute?
& nameAttribute?
& attribute toggle {boolean}?
& oninitAttribute?
& objectElements
}*
& layout*
viewContentElements &= command*
command =
element command {
idAttribute?,
nameAttribute?,
attribute onselect {script}?,
attribute active {boolean}?,
attribute key {expression}?,
oninitAttribute?,
objectElements
}
animator =
element animator {animatorContent}
animatorgroup =
element animatorgroup {
[a:defaultValue="sequential"]
attribute process {"sequential" | "simultaneous"}? &
animatorContent}
animatorContent =
objectAttributes &
objectElements &
## The name of the attribute whose value is animated. This
## attribute is required on an animator, unless the animator is
## inside an animatorgroup that specifies an attribute.
attribute attribute {token}? &
## Whether to start the animation instantly (the default),
## or wait for a script command.
[a:defaultValue="true"] attribute start {boolean}? &
## The start value for the animation. Defaults to the
## targeted attribute's current value.
attribute from {number}? &
## The final value for the targeted attribute.
attribute to {number}? &
## The duration of the animation, in milliseconds (1000 = 1 second).
attribute duration {xsd:float {minInclusive="0"} | constraint}? &
[a:since="1.1"
a:defaultValue="false"]
attribute indirect {boolean}? &
## Whether the to value is relative to the initial value of the
## attribute (@c{true}), or is absolute (@c{false}).
[a:defaultValue="false"] attribute relative {boolean}? &
[a:defaultValue="easeboth"]
attribute motion {"linear" | "easein" | "easeout" | "easeboth"}? &
## Executed when the animator starts. This code is executed
## multiple times if the animator repeats.
attribute onstart {script}? &
## Executed when the animator finishes.
attribute onstop {script}? &
## The number of times to repeat the animation. This should be a
## positive integer, or 'Infinity'. Changes to the repeat value
## take effect, after the animation is finished and then restarted.
[lza:since="1.1"]
attribute repeat {expression}? &
## The paused state of the animator. If true, the animator will stop. When
## changed to false, the animator will resume from its current location
[a:defaultValue="false"] attribute paused {boolean}? &
## the object for which an attribute will be animated (by default, this
## is the immediateParent)
attribute target {reference}?
#
# View elements
#
viewElement = (
element view {viewContent}
|
element drawview {viewContent}
|
element text {
viewContent
& textAttributes
& attribute embedfonts {boolean}?
& (attribute text {xsd:string}
| htmlText*)
}
|
element inputtext {
viewContent &
textAttributes &
attribute embedfonts {boolean}? &
attribute resizable {boolean}? &
## If true, the input text field acts like a password input
## field; any text typed in appears as "****" characters in the
## current font.
[a:defaultValue="false"]
attribute password {boolean}?
& (attribute text {xsd:string}
| text?)
}
)
textAttributes =
## If true, the lines of text are wrapped to fit within the text
## width. (The name @c{multiline} is a misnomer. Unwrapped text
## can be multiple lines if it contains a @c{} ## element, or a line break within a @c{
} element. ## ## This attribute defaults to true if width and height are ## explicitly specified. ## ## If you set multiline=true, you probably want to explicitly a ## width for the text also; if multiline=true and you do not specify ## a width, the system will pick an arbitrary width (100 pixels at ## the moment). ## ## When multiline=true, the text is automatially re-wrapped whenever ## the content is modified by calls tosetText , or whenever the ## width of the text view is modified. [a:defaultValue="false" lza:modifiers="final"] attribute multiline {boolean}? & ## If true, the width of the text field will be recomputed each time ## setText() is called, so that the text view is exactly as wide as ## the width of the widest line. [a:defaultValue="false"] attribute resize {booleanLiteral}? & ## If true, the text is selectable [a:defaultValue="false"] attribute selectable {booleanLiteral}? & [a:defaultValue="null"] attribute maxlength {numberExpression}? & attribute pattern {string}? & attribute label {string}? textContent = (attribute text {xsd:string} | text?) htmlContent = (attribute text {xsd:string} | htmlText?) htmlText = (text | element pre { htmlText } | element a { ## The link target. attribute href {xsd:anyURI} & ## The value of this attribute determines where the link target ## will be displayed. The interpretation is the same as in HTML, ## where the "current frame" is the frame containing the LZX ## application. The value must be a name beginning with an ## alphabetic character, or one of the following: ## ##
#FF0000.
# The CSS syntaxes red, #F00, and
# rgb(1.0, 0, 0) are not recognized.
& attribute color {colorLiteral}?
& htmlText}
|
element i {htmlText}
|
element p {htmlText}
|
element br {empty}
|
element u {htmlText})*
#
# Assets
#
asset =
element audio {srcAttribute & idAttribute? & nameAttribute}
asset |= resource
resource =
element resource {
nameAttribute &
(## If src is an identifier name, it must match the name of a resource
## that has been defined by the @e{resource} tag. If it is a URL, it
## refers to a resource that is requested when the application is run.
## Otherwise it should be a pathname, and must name a resource file
## that is compiled into the application.
srcAttribute
|
element frame {nameAttribute? & srcAttribute}*)
}
#
# Data
#
datasource = element datasource {
idAttribute?
& nameAttribute?
& attribute timeout {number}?
& [a:defaultValue="false"
lza:visibility="private"]
attribute secure {booleanLiteral}?
& [a:defaultValue="inherit"] attribute proxied {booleanLiteral | "inherit"}?
& ## A dataset element within a @e{datasource} element defines a set
## of data that is retrieved from that datasource. The name
## of the dataset can be used in the datapath attribute of
## a view.
[lza:name="datasource dataset"]
element dataset {datasetAttributes & datasetContent}*
& oninitAttribute?
& objectElements
}
connectiondatasource =
## A connection datasource to receive messages from the persistent connection.
element connectiondatasource {
idAttribute?
& nameAttribute?
& ## The onconnect script is executed when the application is connected.
attribute onconnect {script}?
& attribute oninit {script}?
& ## The ondata script is executed when the application receives a persistent
## connection message.
attribute ondata {script}?
& ## The onerror script is executed whenever there's a connection failure.
attribute onerror {script}?
& ## The ontimeout script is executed whenever a timeout is encountered with
## the persistent connection.
attribute ontimeout {script}?
& ## The ondisconnect script is executed whenever the application disconnects.
attribute ondisconnect {script}?
& ## The onuserdisconnect script is executed whenever a user disconnects. See
## the receiveuserdisconnect attribute.
attribute onuserdisconnect {script}?
& ## A dataset element within a @e{connectiondatasource} element names a
## unique dataset whose content is shared with other clients that define a
## dataset with the same name on the same server.
[lza:name="persistent connection dataset"]
element dataset {datasetAttributes}*
& method*
}
agent =
element agent {
attribute url {string}
}
connection =
element connection {
## The interval value in milliseconds that the server will send a message to
## the application to ensure the connection is kept alive by the client.
## The default value of a heartbeat is 5000 milliseconds.
attribute heartbeat {xsd:integer}?
& attribute timeout {number}?
& ## If true, creates a secure persistent connection through https. Otherwise
## the connection uses http.
attribute secure {booleanLiteral}?
& ## Connection port.
attribute secureport {xsd:integer}?
& ## Tells server to send an onuserdisconnect event every time a user
## disconnects. Default is false.
[a:defaultValue="false"]
attribute receiveuserdisconnect {booleanLiteral}?
& ## Connection group name.
attribute group {string}?
& ## Class name of server-side java authenticator
attribute authenticator {string}?
& ## Authenticator parameters.
attribute authparam {string}?
& ## The onconnect script is executed when the application is connected.
attribute onconnect {script}?
& ## The ondata script is executed when the application receives a persistent
## connection message.
attribute ondata {script}?
& ## The onerror script is executed whenever there's a connection failure.
attribute onerror {script}?
& ## The ontimeout script is executed whenever a timeout is encountered with
## the persistent connection.
attribute ontimeout {script}?
& ## The ondisconnect script is executed whenever the application disconnects.
attribute ondisconnect {script}?
& ## The onuserdisconnect script is executed whenever a user disconnects. See
## the receiveuserdisconnect attribute.
attribute onuserdisconnect {script}?
& agent*
& method*
}
dataset =
[lza:name="top-level dataset"]
element dataset {
datasetAttributes &
(datasetContent | anyXML)
}
datasetAttributes = objectAttributes
datasetContent =
## If true, enable a response to be encoded via the clients Accept-Encoding
## HTTP header. This allows the server to gzip the response.
[lza:since="1.1"
lza:defaultValue="false"]
attribute acceptencodings {boolean}? &
## msecs to time out for load requests
attribute timeout {number}? &
## If false, use flash native XML loader/parser
[a:defaultValue="inherit"] attribute proxied {booleanLiteral | "inherit"}? &
## If this is a URL, it defines a request for an XML datasource that
## is initiated when the dataset's content is requested.
## If this is a pathname, it specifies an XML file whose content
## is compiled into the application as the value of the dataset.
attribute src {xsd:anyURI | constraint}? &
## Request this dataset when the app starts.
[lza:since="1.1"
lza:defaultValue="false"]
attribute request {boolean}? &
## If true, the client should ensure that each request is made,
## rather than just making and reporting the last request.
[lza:since="1.1"
lza:defaultValue="false"]
attribute queuerequests {boolean}? &
## This string is appended to the request.
[lza:since="1.1"]
attribute querystring {xsd:string}? &
## If set to "http", then the dataset will interpret its src attribute as an
## url from which to load its content, rather than as a static xml file to
## inline.
attribute type {xsd:string}? &
[lza:visibility="private"]
attribute endpoint {xsd:string}? &
[lza:visibility="private"]
attribute namespace {xsd:string}? &
[lza:visibility="private"]
attribute method {xsd:string}?
& ## specifies whether or not the app-LPS connection is secure
[a:defaultValue="false"]
attribute secure {booleanLiteral}?
& ## Sets the port number to use to connect to the LPS for a secure
## connection.
[a:defaultValue="443"
lza:since="1.1"]
attribute secureport {xsd:integer {minInclusive="0"}}?
&
## If true, include response headers (This is specific to HTTP datasets).
[a:defaultValue="true"]
attribute getresponseheaders {boolean}?
&
## If true, trim whitespace around XML text content
[a:defaultValue="false"]
attribute trimwhitespace {boolean}?
&
## If true, namespace prefixes are preserved in XML tag and attribute names
## defaults to false in proxied apps, but SOLO apps currently only support
## a value of 'true' (namespace prefixes are always attached to
## element and attribute names)
[a:defaultValue="true"]
attribute nsprefix {boolean}?
&
## Enables caching of the data response on both the LPS server
## and the client. There are security issues with enabling this.
## You usually want the getresponseheaders attribute to be false when
## you set this to true.
[a:defaultValue="false"]
attribute cacheable {boolean}? &
## The ondata script is executed when data arrives
[lza:since="1.1"]
attribute ondata {script}? &
## The onerror script is executed when an error occurs
[lza:since="1.1"]
attribute onerror {script}? &
## The ontimeout script is executed when a request times out
[lza:since="1.1"]
attribute ontimeout {script}? &
## HTTP request method = post | get
attribute querytype {"get" | "post" | "GET" | "POST"}?
anyXML = mixed {
element * {
attribute * {string}* &
anyXML
}*
}
dataptrAttributes =
attribute ondata {script}? &
attribute onerror {script}? &
attribute ontimeout {script}? &
attribute rerunxpath {boolean}? &
attribute xpath {string}? &
## This controls the spacing between elements if lazy replication is
## true.
[a:defaultValue="0"]
attribute spacing {size}?
datapointer =
element datapointer {
objectAttributes &
dataptrAttributes &
attribute p {expression}? &
objectElements
}
datapath =
element datapath {
objectAttributes &
dataptrAttributes &
## If pooling is true, views that are data-bound to this datapath
## are recycled if the dataset changes. Otherwise, views are deleted
## when the data nodes they are bound to disappear, and created
## when new data nodes match the datapath.
[a:since="1.1"
a:defaultValue="false"]
attribute pooling {boolean}? &
attribute axis {"x" | "y" }? &
attribute sortpath {string}? &
attribute sortorder {string}? &
attribute replication {"normal" | "lazy" | "resize" }? &
[lza:visibility="private"]
attribute p {expression}? &
objectElements
}
datapathChildren =
datapath?
& datapointer*
#
# Fonts
#
deviceAttribute = attribute device {boolean}?
font =
element font {
nameAttribute &
deviceAttribute? &
((srcAttribute & styleAttribute? & faceElement*)
| faceElement+)?
}
faceElement =
## Defines a font face or style within the font family that the
## outer element defines.
element face {styleAttribute? & srcAttribute}
styleAttribute =
## Corresponds to the fontstyle attribute of a view.
attribute style {"bold" | "italic" | "bold italic" | "italic bold" | "plain" } # TBD: actually, a list of "bold" or "italic"
#
# Class system
#
objectElements = method*
& handler*
& event*
& attributeElement*
& state*
& node*
& animator*
& animatorgroup*
attributeElement =
element attribute {
## The name of the attribute.
[lza:modifiers="final"]
attribute name {token}
& ( ## The initial value of the attribute. The type of this value
## is specified by the value of the type attribute; if that
## attribute is not present, it's the type of this attribute
## in this element's tag. The attribute is given this value
## when the element is created.
attribute value {string} ?
& [lza:since="1.1"]
( ## When the initial value expression is to be
## evaluated. One of:
## attribute
## name=$when
## value{expression}. The
## default for
## when value is @c{always}, for
## example: <view
## title="$once{computeTitle()}" /> sets the
## title of the view to a computed value and
## <view title="${parent.subtitle}" \>
## will cause the title of the view to
## track @c{parent.subtitle}.
##
[a:defaultValue="immediately"]
attribute when { "immediately" | "once" | "always" }
)?
)?
& ## The type of the attribute. This determines how the value is
## parsed. Attributes of type string are automatically quoted
## if when="immediate", for any other value of when, a literal
## string would have to be quoted to be used as a value.
[a:defaultValue="expression"
lza:modifiers="final"]
attribute type {"boolean" | "color" | "expression" | "number" | "size" |
"string" | "text" | "html"}?
& ## True if this is a required attribute.
[a:defaultValue="false"]
attribute required {booleanLiteral}?
# Code that is executed when setAttribute is used to set the value
## of this attribute. This code is executed within a context in
## which the variable with this attribute's name is
## bound to the value passed to setAttribute.
[lza:since="1.1"]
attribute setter {script}?
}
class =
element class {
## The name of a new tag that this element defines.
[lza:modifiers="final"]
attribute name {token} &
## The name of the tag that this tag extends.
[a:defaultValue="view"
lza:modifiers="final"]
attribute extends {token}? &
## The comma-separated list of traits, applied in order
attribute traits {string}? &
## Any attribute can occur, depending on superclass.
## We need to handle this in a preprocessing step.
attribute * - (name|extends|traits) {string}*
& viewContentElements
}
interface =
element interface {
## The name of a new tag that this element defines.
[lza:modifiers="final"]
attribute name {token} &
## The name of the tag that this tag extends.
[a:defaultValue="view"
lza:modifiers="final"]
attribute extends {token}? &
## Any attribute can occur, depending on superclass.
## We need to handle this in a preprocessing step.
attribute * - (name|extends|traits) {string}*
& viewContentElements
}
trait =
element trait {
## The name of a new tag that this element defines.
[lza:modifiers="final"]
attribute name {token} &
## Any attribute can occur
## We need to handle this in a preprocessing step.
attribute * - (name) {string}*
& viewContentElements
}
handler =
element handler {
nameAttribute
& ## If this attribute is present, it is a JavaScript expression
## that evaluates to an object. The code in this method executes
## when this object sends the event named by the @a{event}
## attribute. This attribute may be present only if
## the @a{event} attribute is present too.
[a:defaultValue="this"]
attribute reference {reference}?
& ((
## The parameter names of this handler. The value of this attribute
## is a comma-separated list of JavaScript identifiers.
[a:defaultValue=""
lza:modifiers="final"]
attribute args {string}? &
text) |
( ## A method to call when this handler is invoked.
attribute method {string}))
}
event =
element event {
nameAttribute
}
method =
element method {
( nameAttribute |
( nameAttribute? &
## The name of the event that this method is invoked in response
## to.
attribute event {string} &
## If this attribute is present, it is a JavaScript expression
## that evaluates to an object. The code in this method executes
## when this object sends the event named by the @a{event}
## attribute. This attribute may be present only if
## the @a{event} attribute is present too.
[a:defaultValue="this"]
attribute reference {reference}?)) &
## The parameter names of this method. The value of this attribute
## is a comma-separated list of JavaScript identifiers.
[a:defaultValue=""
lza:modifiers="final"]
attribute args {string}? &
text
}
importElement =
element import {
viewContent &
## A reference to a target file whose content is treated as a loadable module
attribute href {xsd:anyURI}
& attribute stage {"late" | "defer" }
& attribute onload {script}?
& [a:defaultValue="inherit"] attribute proxied {booleanLiteral | "inherit"}?
& attribute onerror {script}?
& attribute ontimeout {script}?
}
state =
element state {
viewContent
& attribute apply {boolean}?
& ## If pooling is true, views that are created by the state are not
## destroyed when the state is removed -- instead they just act
## as if they were by sending the onremovesubview event and setting
## their visibility to false.
[a:since="1.1"
a:defaultValue="false"]
attribute pooling {boolean}?
& ## Script that is executed when the state is applied to its parent.
attribute onapply {script}?
& ## Script that is executed when the state is removed from its parent.
attribute onremove {script}?
}
nodeAttributes = (
objectAttributes,
## The view in which a child is placed by default
attribute defaultplacement {string}?
)
nodeElements =
objectElements
& datapathChildren
& element dataset {
datasetAttributes &
(datasetContent | anyXML)
}*
nodeContent =
nodeAttributes &
nodeElements
node =
element node {nodeContent}
layout =
element layout {
nodeContent &
attribute locked {booleanLiteral}?
}
#
# Application Configuration
#
splash =
element splash {
[lza:visibility="private"]
attribute hideafterinit {booleanLiteral}? &
## If true, the splash views remain on the canvas after the
## preload is complete.
[a:defaultValue="false"]
attribute persistent {booleanLiteral}? &
[lza:name="splash view"]
element view {
## This defines both a resource with this name, and a view.
attribute name {token}? &
## This must be a pathname. If the target contains text, the
## text should be converted to outlines.
attribute resource {xsd:anyURI} &
## If this attribute is present, the resource is synchronized
## to loading progress. Its value should be either a number
## between 0.0 and 1.0, or a percentage between 0% and 100%
## (inclusive). If the resource is a multiframe resource, the
## value is the proportion of the frames to play during the
## preload phase of application load; the remainder is played
## during the initialization phase.
attribute ratio {xsd:string}? &
## x position of this view relative to the canvas
[a:defaultValue="0"]
attribute x {numberLiteral}? &
## y position of this view relative to the canvas
[a:defaultValue="0"]
attribute y {numberLiteral}? &
## If true, this view is centered within the canvas. This
## overrides the @a{x} and @a{y} attributes.
[a:defaultValue="false"]
attribute center {booleanLiteral}?
}*
}
scriptElement =
element script {
## The pathname of a JavaScript file. This pathname is resolved
## relative to the file that contains the