include non-xml text
I have a series of files containing non-xml text. I wish to conditionally include them into an xml file based on the data.
eg.
<messageList>
<message fileid="4010"/>
<message fileid="3202"/>
</messageList>
and then inside the files referenced by the file id attribute are some random non-xml text.
what I have:
<xsl:template match="/messageList">
<conversation>
<xsl:for-each select = "message">
<msg>
<xsl:value-of select="document(fileid)"/>
</msg>
</xsl:for-each>
</conversation>
</xsl:template>
Is there some way to do this?
[717 byte] By [
jkmyoung] at [2007-11-19 2:00:39]

# 1 Re: include non-xml text
I have a series of files containing non-xml text. I wish to conditionally include them into an xml file based on the data.
I don't think this can be done using plain XSL, without any outside help.
In Cocoon (http://cocoon.apache.org) for example, you could do it by creating transformers that will, wrap the text in an xml node, on the fly.
khp at 2007-11-10 3:27:57 >

# 2 Re: include non-xml text
Someone has pointed me to XSLT 2.0's unparsed-text function.
As I'm currently using 1.1, converting might be a bit troublesome...
# 3 Re: include non-xml text
Someone has pointed me to XSLT 2.0's unparsed-text function.
As I'm currently using 1.1, converting might be a bit troublesome...
Yes XSL 2 is somewhat different from XSL 1, and processing engines for XSL 2 is not as widely avaliable either.
khp at 2007-11-10 3:29:57 >
