Specifications
Server Behaviors 159
To extract parameter values from <% if (@@rs@@.EOF)
Response.Redirect("@@new__url@@"); %>,
write a regular expression that identifies any string
rs and new__url:
<searchPattern paramNames="rs,new__url">
/if d ((\w+)\.EOF\) Response\.Redirect\("([^\r\n]*)"\)/i
</searchPattern>
This process searches the user’s document, and if there is a match, extracts the parameter values.
The value for
rs is extracted using the first parenthetical subexpression (\w+). The value for
new__url is extracted using the second subexpression ([^\r\n]*).
Note: The character sequence "[^\r\n]*" matches any character that is not a linefeed, for both Macintosh and
Windows.
Notes about EDML structure
You should use a unique filename to identify your server behavior group. If an associated
participant file is used by only one group file, match the participant filename with the group
name. Using this convention, the server behavior group file
updateRecord.edml works with the
participant file
updateRecord_init.edml. When participant files might be shared between
server behavior groups, assign unique descriptive names.
Note: The EDML name space is shared, regardless of folder structure, so be careful to keep names unique when
you make them descriptive. Filenames should not exceed 31 characters (including the .edml extension), due to
Macintosh limitations.
The runtime code for your server behavior resides inside the EDML files. The EDML parser
should not confuse any of your runtime code with EDML markup, so CDATA must wrap around
your runtime code.
CDATA represents character data and is any text that is not EDML markup.
When you use the
CDATA tag, the EDML parser won’t try to interpret it as markup, but instead,
considers it as a block of plain text. CDATA marked blocks begin with <![CDATA[ and end with ]]>.
If you insert the text
Hello, World, it is simple to specify your EDML, as shown in the following
example:
<insertText>Hello, World</insertText>
However, if you insert content that has tags in it, such as <img src=’foo.gif’>, it can confuse the
EDML parser. In that case, embed it in the
CDATA construct, as shown in the following example:
<insertText><![CDATA[<img src=’foo.gif’>]]></insertText>
The ASP runtime code is wrapped within the CDATA tag set, as shown in the following example:
<![CDATA[
<% if (@@rs@@.EOF) Response.Redirect("@@new__url@@"); %>
]]
Because of the CDATA tag, the ASP tags <%= %>, along with the other content within the tag,
aren’t processed. Instead, the Extension Data Manager (EDM) receives the uninterpreted text, as
shown in the following example:
<% if (Recordset1.EOF) Response.Redirect("http://www.macromedia.com"); %>
In the following EDML definitions, the locations where CDATA is recommended are indicated in
the examples.