>> English << | По-русскиZVON > Tutorials > XInclude Tutorial
>> Example 6 << | Prev | Next | Contents

Element fallback can contain also include element


Description

Element fallback can contain anything, so also the include element.

Valid example

The file a.xml tries to include non-existent file. Thus the fallback elements tries to process its include child element. In this case the file alternative.xml is present and is processed.
File a.xml:
    <a> 
     <xi:include href="non-existent.xml"
      xmlns:xi="http://www.w3.org/2001/XInclude">
       <xi:fallback>
        <xi:include href="alternative.xml">
         <xi:fallback>There are no files today ... </xi:fallback>
        </xi:include>
       </xi:fallback>
     </xi:include>
    </a>
   

File alternative.xml:
				<c/>
			

File a.xml after processing:
    <a>
     <c/>
    </a>