Dear all,
I have a xml document as below which is broken at the moment becasue of global variable related problem. I am trying to allocate a global variable on the fly thorugh
java. Varibale called "prodid" takes "file_path" and "xml_dir" to call "index.xml"
doc from the specified values from java. The problem I might be facing is when I call document for indexdoc variable, ti looks for "index.doc" document in xsl document's parent directory. This tells me that at this point file_path and xml_dir are not allocated values.
I hope this makes sense, If not then please let me know so that we can resolve this. Basically I don't want to give absolute path to indexdoc variable. The path will be the same as concat($fle_path, $xml_dir).
Here is my XML:
+++++++++++++++++++
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
Document : File_Systems
Created on : 21 February 2002
Author : nilesh
Comment
purpose of transformation follows.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xalan="http://xml.apache.org/xalan"
exclude-result-prefixes="xalan"
>
<xsl
utput method="html" version="4.0" encoding="iso-8859-1" indent="yes" />
<xsl
aram name="file_path"/>
<xsl
aram name="xml_dir"/>
<xsl
aram name="xsl_dir"/>
<xsl
aram name="html_dir"/>
<xsl:variable name="indexdoc" select="document(concat(file_path, xml_dir, 'index.xml'))"/>
<xsl:variable name="prodid" select="$indexdoc/root/@productID"/>
<xsl:template match="root">
<html>
<head>
<link rel="stylesheet" type="text/css">
<xsl:attribute name="href">
<xsl:text>../css_data/</xsl:text>
<xsl:value-of select="$prodid " />
<xsl:text>.css</xsl:text>
</xsl:attribute>
</link>
.........................
</xsl:stylesheet>
Thanks in advance
Nilesh Patel