Xinclude

Having trouble installing Oxygen? Got a bug to report? Post it all here.
jabberwocky
Posts: 3
Joined: Fri Sep 01, 2006 8:18 pm

Xinclude

Post by jabberwocky »

I'm learning OxygenXML's 9.1 support for Xinclude. I have two files, with one pointing by means of Xinclude to the other - no Xpointer, just want the contents of the entire second file. Validation succeeds with no errors, so I assume that the Xinclude is correct.

Next--how can I view the resulting document, with the contents of the second file displayed in the first? Must I perform a transformation to see the results, or is there some other way?
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Xinclude

Post by george »

Hi,

In order to see the XInclude reference replaced with the actual XIncluded content it is necessary to perform some operation to obtain the XInclude expansion.
One way is to pass the document through an XSLT copy template like the samples below:

sample1

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

sample 2

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
Best Regards,
George
George Cristian Bina
Post Reply