Changes

Jump to navigation Jump to search
1,839 bytes added ,  21:52, 16 December 2012
Create entire page
{{Reference
|name=xmlinclude
|attributes=
}}

== [[Help:Reference|Syntax]] ==
<table cellspacing="4" cellpadding="2" class="cmd">
<tr>
<td colspan="2" class="cmd">\xmlinclude<!--
--><span class="first">{...}</span><!--
--><span class="second">{...}</span><!--
--><span class="third">{...}</span><!--
--></td>
</tr>
<tr valign="top" class="first">
<td class="cmd">{...}</td>
<td>''xmldata'', usually {{code|main}}</td>
</tr>
<tr valign="top" class="second">
<td class="cmd">{...}</td>
<td>''pattern that matches tags that stand for 'include external file'. Default:'' {{code|include}}</td>
</tr>
<tr valign="top" class="third">
<td class="cmd">{...}</td>
<td>''names of attribute containing URL of file to include, separated by pipes. Default:'' {{code|href}}</td>
</tr>
</table>

== Description ==
{{cmd|xmlinclude|{main}{include}{filename{{!}}href{{!}}name}|}} merges XML trees in external files into the tree called {{code|main}}. External files are merged in at every {{code|include}} tag; which file to merge in is determined by looking at the {{code|filename}} attribute; if that is absent the {{code|href}} and {{code|name}} attributes are tried in order.

Further behaviour:
* If no attribute is specified, {{code|href}} is assumed.
* If the file is empty or not found, the inclusion tag is replaced with nothing.
* Inclusion is recursive: if the tree you merge in itself contains inclusion tags, they are acted on, too.

== Example ==

<xmlcode>
<example>
<chapter>text 1</chapter>
<chapter>text 2</chapter>
</example>
</xmlcode>

<texcode>
\xmlinclude...
</texcode>
-->

== See also ==
* {{src|lxml-ini.mkiv}}
* {{src|lxml-aux.lua}}

== Help from ConTeXt-Mailinglist/Forum ==
All issues with:
{{Forum|xmlinclude}}

[[Category:Command/XML|xmlinclude]]
!--
-->

Navigation menu