XSLT implementation

It is possible to create an application that merges XML documents that conform to the XInclude standard using only an XSLT stylesheet (see Chapter 17). The following stylesheet would suffice, but only when complete documents are to be included, as it does not look for or even cope with a possible '#xpointer(…)' on the end of the URL:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- XINCLUDE Merger Application -->
<!-- Main file that includes <xi:include.../> elements
     is processed -->

<stylesheet version="1.0"
            xmlns="http://www.w3.org/1999/XSL/Transform"
            xmlns:xi="http://www.w3.org/2001/xinclude" >

  <output method="xml" encoding="ISO-8859-1" />

  <template match="xi:include">
    <comment>
      MERGED "<xsl:value-of select='@href'/>" START
    </comment>
    <copy-of select="document(@href)" />
    <comment>
      MERGED "<xsl:value-of select='@href'/>" END
    </comment>
  </template>

  <template match="node() | @*">
    <copy><apply-templates select="@* | node()" /></copy>
  </template>

</stylesheet>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.86.155