Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server side includes with XSLT

 
Harish Maringanti
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:

I want to know if its possible to use server side includes (SSI) with xslt.

Usually in html the way we do it is by using the following syntax:
<!-- ssi code here -->

But the start & end tags are treated as comments in xslt. Is there a way out? I appreciate any response.

Thank you.
 
Dmitry Kirsanov
Author
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can generate comments using XSLT using the xsl:comment instruction. Or, if the SSI comments are in your XML source, you can match them using comment() and pass unchanged to the output, for example:

<xsl:template match="comment()">
<xsl:copy/>
</xsl:template>
 
Zhongwu Lin
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you specify href in <xsl:include href="" />?

let's say I have two xsl files

com/test/main.xsl
com/test/second.xsl

and we want to include second.xsl in main.xsl

In main.xsl I do:

<xsl:include href="second.xsl" />
or
<xsl:include href="com/test/second.xsl" />

IN neither way the transformer see it.
I am using java.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic