How can I read a file as a template instruction in an xsl?
Upon matching a template, I need to add the contents of
an entire file in the result tree.
Is that possible?
(sorry if I am a bit fuzzy).
Regards,
D
Manish Pandit - 01 Nov 2006 06:49 GMT
> (sorry if I am a bit fuzzy).
Yeah, it is kind of fuzzy. Are you trying to use XSLT and transform an
XML document with the XSL ? You can take a look at cocoon/xalan-j XSLT
processor for more info on how to do that.
-cheers,
Manish
Mike Schilling - 01 Nov 2006 07:09 GMT
> How can I read a file as a template instruction in an xsl?
>
[quoted text clipped - 4 lines]
>
> (sorry if I am a bit fuzzy).
1. Write a custom XPath function, or
2. Pass the contents of the file in as the value of an XSLT parameter.
Tor Iver Wilhelmsen - 01 Nov 2006 19:52 GMT
> Upon matching a template, I need to add the contents of
> an entire file in the result tree.
At the top:
<!DOCTYPE stylesheet (etc.) [
<!ENTITY includefile SYSTEM "thefile.xml">
]>
Then, in the template rule:
<xsl:template match="foo">
&includefile;
</xsl:template>
Dhurandhar - 02 Nov 2006 01:20 GMT
> > Upon matching a template, I need to add the contents of
> > an entire file in the result tree.
[quoted text clipped - 10 lines]
> &includefile;
> </xsl:template>
That worked, but partially (thanks).
I am finding that in the resulting document, some of the characters are
stripped off. Thus, if
thefile.xml contains something like ${a.b.c}/d/e, the resulting
document only has $/d/e.
Am I missing something?