/www/tags/NOV_07_2009/htdocs/42docs/users-guide/mode-rule-import.html
HTML | 33 lines | 29 code | 4 blank | 0 comment | 0 complexity | f2de2fb8d4b1ad89f80c67d2c59fa2cd MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>The IMPORT Tag</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="jEdit 4.2 User's Guide"><link rel="up" href="writing-modes.html" title="Chapter 10. Mode Definition Syntax"><link rel="previous" href="mode-rule-seq-regexp.html" title="The SEQ_REGEXP Tag"><link rel="next" href="mode-rule-keywords.html" title="The KEYWORDS Tag"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The IMPORT Tag</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mode-rule-seq-regexp.html">Prev</a> </td><th width="60%" align="center">Chapter 10. Mode Definition Syntax</th><td width="20%" align="right"> <a accesskey="n" href="mode-rule-keywords.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="mode-rule-import"></a>The IMPORT Tag</h2></div></div><div></div></div><p>
- The <tt class="literal">IMPORT</tt> tag, which must be placed inside a <tt class="literal">RULES</tt> tag, loads all rules defined in a given ruleset into the current ruleset; in other words, it has the same effect as copying and pasting the imported ruleset.
- </p><p>
- The only required attribute <tt class="literal">DELEGATE</tt> must be set to the name of a ruleset. To import a ruleset defined
- in the current mode, just specify its name. To import a ruleset
- defined in another mode, specify a name of the form
- <tt class="literal"><i class="replaceable"><tt>mode</tt></i>::<i class="replaceable"><tt>ruleset</tt></i></tt>.
- Note that the first (unnamed) ruleset in a mode is called
- “<span class="quote">MAIN</span>”.
- </p><p>
- One quirk is that the definition of the imported ruleset is not copied to the location of the <tt class="literal">IMPORT</tt> tag, but rather to the end of the containing ruleset. This has implications with rule-ordering; see <a href="mode-tag-rules.html#rule-ordering" title="Rule Ordering Requirements">the section called “Rule Ordering Requirements”</a>.
- </p><p>
- Here is an example from the PHP mode, which extends the inline JavaScript highlighting to support embedded PHP:
- </p><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting">
- <RULES SET="JAVASCRIPT+PHP">
- <SPAN TYPE="MARKUP" DELEGATE="php::PHP">
- <BEGIN>&lt;?php</BEGIN>
- <END>?&gt;</END>
- </SPAN>
-
- <SPAN TYPE="MARKUP" DELEGATE="php::PHP">
- <BEGIN>&lt;?</BEGIN>
- <END>?&gt;</END>
- </SPAN>
-
- <SPAN TYPE="MARKUP" DELEGATE="php::PHP">
- <BEGIN>&lt;%=</BEGIN>
- <END>%&gt;</END>
- </SPAN>
- <IMPORT DELEGATE="javascript::MAIN"/>
- </RULES></pre></td></tr></table></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mode-rule-seq-regexp.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="writing-modes.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="mode-rule-keywords.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The SEQ_REGEXP Tag </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> The KEYWORDS Tag</td></tr></table></div></body></html>