XINCLUDE and XSLT
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Tue Oct 23, 2007 8:33 pm
XINCLUDE and XSLT
I'd like to include a text file in my XSLT output, the precise file to be specified by an XSLT parameter, but can't use document() to do this as the file isn't XML.
I've considered using XInclue but can't figure out how to do this. Using a constuct like this:
<xi:include parse="text">
<xsl:attribute name="href">
<xsl:value-of select="$includeme"/>
</xsl:attribute>
</xi:include>
if I enable XInclude processing then the wrong thing happens (I get the XSLT file included as text). If I disable it then I end up with xi:include in my xhtml output - what's the best way then of actually making the include happen? If I run an identity transform, I need to change the configuration to enable include procesing? Then switch it off again before running the first transform again?
thanks in advance
Jo
I've considered using XInclue but can't figure out how to do this. Using a constuct like this:
<xi:include parse="text">
<xsl:attribute name="href">
<xsl:value-of select="$includeme"/>
</xsl:attribute>
</xi:include>
if I enable XInclude processing then the wrong thing happens (I get the XSLT file included as text). If I disable it then I end up with xi:include in my xhtml output - what's the best way then of actually making the include happen? If I run an identity transform, I need to change the configuration to enable include procesing? Then switch it off again before running the first transform again?
thanks in advance
Jo
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
You should use the XSLT 2.0 function unparsed-text($uriOfNonXMLFile), for example:
Regards,
Sorin
You should use the XSLT 2.0 function unparsed-text($uriOfNonXMLFile), for example:
Code: Select all
<xsl:variable name="fileContent" select="unparsed-text($uriOfFile)"/>
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service