[TOC] [Prev] [Next] [Bottom]



Format of Meta Tags

Syntax

The basic syntax for Tango meta tags is:

<@TAG ATTRIBUTENAME="ATTRIBUTEVALUE">

  • The opening "<" is a characteristic of tag languages, including HTML. The "@" symbol distinguishes Tango meta tags.

At least one space must occur between the tag name and the first attribute name, and between all attribute values and subsequent attribute names. For example,

<@POSTARG NAME="Bruce" ENCODING="NONE">

and

<@POSTARG NAME="Bruce"
ENCODING="NONE">

are both valid meta tag syntax.

  • Line breaks are allowed in tags anywhere a space occurs. For example,

<@ASSIGN
NAME="varname"
SCOPE="local"
VALUE="somevalue"
>

is valid Tango meta tag syntax.

  • There is no space allowed before or after the equals (=) sign. As well, if you quote the value of an attribute, no space is allowed between the equals (=) sign and the opening quote. For example, <@POSTARG NAME="Bruce"> is correct syntax.
  • This documentation shows meta tags in uppercase, but meta tags are case insensitive. That is, all of the following are valid Tango meta tag syntax:

<@CALC EXPR="3+7">
<@Calc expr="3+7">
<@calc Expr="3+7">

Naming Attributes

The current version of Tango uses attribute names in meta tags. This is a departure from previous versions of Tango that recognized attributes by their position in the meta tag and did not use attribute names. For example, when using the <@POSTARG> tag, previous versions of Tango evaluated the first attribute as the name of the post argument to get, and the second as the type of encoding to perform on the value returned. The tag looked like this, <@POSTARG foo METAHTML>.

In Tango 3.0, all attributes have names. <@POSTARG> is now written as, <@POSTARG NAME="foo" ENCODING="METAHTML">, or <@POSTARG ENCODING="METAHTML" NAME="foo">. The order of the attributes does not matter if the attributes are named.

The name for every attribute you specify must be provided, with one exception: any attribute that is required--that is, any attribute whose absence makes a meta tag invalid--can be specified without a name, as long as it occurs in its predefined position (usually immediately following the name of the meta tag).


!Note: The documentation in this chapter shows meta tag syntax with the required order for positional (required) attributes.


Using the <@POSTARG> example, <@POSTARG homer> is still valid in Tango 3.0, because the NAME attribute is required, and its designated position is first. But, if you want to specify the encoding, you must use <@POSTARG homer ENCODING="NONE">, because ENCODING is not a required attribute. For new users of Tango, the best method to adopt is to enter all attribute names, for example, <@POSTARG NAME="homer" ENCODING="NONE">.

Attribute Value Length

The length of each meta tag attribute value is limited only by available memory. Previous versions of Tango had an attribute value limit of 255 characters.

Quoting Attributes

Attribute values must sometimes be quoted to avoid ambiguity. For example, whenever you need to specify an attribute value that includes a space, you must put quotes around it. To refer to a database column called "Zip Code", for example, use <@COLUMN NAME="Zip Code">. Without the quotes, Tango would incorrectly interpret Zip as the attribute name and Code as the start of another attribute. Tango recognizes both the double (") and single (') quote character pairs as attribute delimiters.

Another case where quotes are necessary is when specifying an empty value for the attribute ("" tells Tango that there is no value).


!Note: Quotes are not necessary when you are using only meta tags as the attribute value. Tango knows that meta tags begin with <@ and end with >, so no quotes are necessary to delimit.


In general, quoting attribute values is recommended. It is never incorrect to quote an attribute value.

Some additional rules to follow when quoting meta tag attributes are as follows:

  • If you have a nested tag in an attribute, use the "other" quote character around its value. This alternating can go on indefinitely for deeply nested tags. This allows you to distinguish between quotes you want to specify as part of the attribute value itself, instead of as an attribute delimiter. For example:

    <@ARG NAME="<@VAR NAME='<@VAR NAME="myArgNameVar">'>">

    For more information, see "<@DQ>, <@SQ>".

  • If you have a literal double or single quote in a meta tag attribute value, you must replace it with the <@SQ> or <@DQ> meta tag, regardless of which quote character is delimiting the attribute value.

    For more information, see "<@CALC>" and "<@IF>, <@ELSEIF>, <@ELSEIFEMPTY>, <@ELSEIFEQUAL>, </@IF>".

  • The exceptions to the last rule are the expressions specified for <@CALC> and <@IF> meta tags, and the Advanced mode for If, Else If, and While Loop actions. The EXPR attribute can use quotes as part of an expression, as long as they are not the same quotes as surround EXPR. These quotes are taken as delimiters for individual values within the expression. The expression attribute also supports backslash-escaping of quotes: \" and \' for literal quotes (and require the use of \\ for \ as a result).


[TOC] [Prev] [Next] [Bottom]



docs@pervasive.com

Copyright © 1998, Pervasive Software Inc. All rights reserved.