xsl-list
[Top] [All Lists]

Re: [xsl] XSLT for mergig XML fragments into the base XML

2011-09-05 03:29:20
Am 05.09.2011 um 04:17 schrieb Zeev Atlas:

<myxmlincludetype1 filename="SOMEFILE1"/>
<myxmlincludetype2 filename="SOMEFILE2" attributes.../>

Ze’ev,

As I had a similar thing on my table the last days the solution could be 
something like this (this works in XSLT 1.0, as I had to use Xalan):

<xsl:transform version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="myxmlincludetype1 | myxmlincludetype2">
  <!-- copy the original element -->
  <xsl:copy>
    <xsl:apply-templates select="@*" />
  </xsl:copy>
  <!-- process the content of the external document -->
  <xsl:apply-templates select="document(@filename)" />
</xsl:template>

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

</xsl:transform>

- Michael

--
_______________________________________________________________
Michael Müller-Hillebrand: Dokumentation Technology
Adobe Certified Expert, FrameMaker
Consulting and Training, FrameScript, XML/XSL, Unicode
Blog [de]: http://cap-studio.de/





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>