Link to home
Start Free TrialLog in
Avatar of nzrubin
nzrubinFlag for New Zealand

asked on

xslt interacting with other languages

Hello experts!
just a little intro question!

our company is using online software. obviously i dont have an access to any program code.
all i can script how i want is a XSLT code for pdf invoices templates.

the question is can i use some how parts of another script language within xslt.
like PHP or SQL to connect to DB.

i was thinking if i can use some external data at XSLT script (like images) may be it is possible to use something else?

below is part of code where i use external gaphic



<fo:table-cell padding="0pt 0pt 0pt 15pt" border="0" number-rows-spanned="8" vertical-align="top">
<fo:block><!-- list LOGO--><!-- list LOGO--><!-- list LOGO--><!-- list LOGO-->
		<xsl:choose>
		<xsl:when test="@currency='GBP'">
		<fo:external-graphic content-width="136pt" src="url(http://www.mysite/images/logo.gif)"/>
											</xsl:when>
.
.
.
.
.
etc

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
forgot the example
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
	xmlns:msxsl="urn:schemas-microsoft-com:xslt"
	xmlns:myjs="urn:internal:my-javascript">
	<msxsl:script language="JavaScript" implements-prefix="myjs">
	<![CDATA[
		function GetCurrentDateTime()
		{
		var currentTime = new Date();
		var month = currentTime.getMonth() + 1;
		var day = currentTime.getDate();
		var year = currentTime.getFullYear();
		return(month + "/" + day + "/" + year);
		}
	]]>
	</msxsl:script>
 
<xsl:template match="/">
	<xsl:value-of select="myjs:GetCurrentDateTime()"/>
</xsl:template>
 
</xsl:stylesheet>

Open in new window