<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <code class="XSLTe"><var>xslt:</var>import</code> 要素型は、
別の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">スタイル・シート</anchor>を<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">輸入</anchor>するのに使います。
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.w3.org/TR/xslt#import" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI">http://www.w3.org/TR/xslt#import</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end><table><tbody><tr><td><code class="XSLTa"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">href</anchor></code></td><td><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">URI</anchor></td><td>(必須)</td><td>取込むスタイル・シート</td></tr></tbody></table></p><p>この要素は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">強制空要素</anchor>です。</p><p>また、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">最上位要素</anchor>としてのみ存在できます。
但し、他の種類の最上位要素よりも前にある必要があります。
また、 <code class="XSLTe"><var>xslt:</var>import</code>
要素同士の順序が優先順位に影響します。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> 輸入は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">取込み</anchor>と同じようなものですが、
輸入されたスタイル・シートの内容よりも輸入したスタイル・シートの内容の方が優先されます。</p><p>より詳しくは:</p><p><code class="XSLTe"><var>xslt:</var>import</code> 要素を含んでいる
<code class="XSLTe"><var>xslt:</var><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">stylesheet</anchor></code> 要素は、
<dfn><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">輸入木</anchor></dfn>を形成するものとして扱います。
輸入木においては、<code class="XSLTe"><var>xslt:</var>stylesheet</code>
要素はその子の <code class="XSLTe"><var>xslt:</var>import</code>
要素に対応する<dfn><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">輸入子</anchor></dfn>をそれぞれ持ちます。
<weak xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">(なお、 <code xmlns="http://www.w3.org/1999/xhtml" class="XSLTe"><var>xslt:</var><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">include</anchor></code>) 要素は輸入木を構築する前に解決しておきます。</weak></p><p>輸入木を後順 (post‐order; 親より子を先に辿る順序) 
で辿った時に、
先に辿ることになる <code class="XSLTe"><var>xslt:</var>stylesheet</code>
要素は後から辿ることになる
<code class="XSLTe"><var>xslt:</var>stylesheet</code> 要素よりも低い優先順位を持ちます。</p><p>例えば、<dl><dt>スタイル・シート A</dt><dd><code class="XSLT">&lt;stylesheet id=&quot;A&quot;&gt;&lt;import href=&quot;#B&quot;/&gt;&lt;import href=&quot;#C&quot;/&gt;&lt;/stylesheet&gt;</code></dd><dt>スタイル・シート B</dt><dd><code class="XSLT">&lt;stylesheet id=&quot;B&quot;&gt;&lt;import href=&quot;#D&quot;/&gt;&lt;/stylesheet&gt;</code></dd><dt>スタイル・シート C</dt><dd><code class="XSLT">&lt;stylesheet id=&quot;C&quot;&gt;&lt;import href=&quot;#E&quot;/&gt;&lt;/stylesheet&gt;</code></dd></dl></p><p>であるときには、<ul><li><code class="XSLT">&lt;stylesheet id=&quot;A&quot;&gt;</code><ul><li><code class="XSLT">&lt;stylesheet id=&quot;B&quot;&gt;</code><ul><li><code class="XSLT">&lt;stylesheet id=&quot;D&quot;&gt;</code></li></ul></li><li><code class="XSLT">&lt;stylesheet id=&quot;C&quot;&gt;</code><ul><li><code class="XSLT">&lt;stylesheet id=&quot;E&quot;&gt;</code></li></ul></li></ul></li></ul></p><p>という輸入木ができて、輸入優先順位は高い順に
A → C → E → B → D となります。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> 直接又は間接に、自身を輸入することは<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">誤り</anchor>です。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <code class="XSLTe"><var>xslt:</var><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">apply-imports</anchor></code>
要素を使うと、局所的に輸入の効果を与えることが出来て、
ここでの説明とは又違った結果になります。</p></body></html>