getting xsl:include to work in XT 19991105
Hi, I'm getting a "MalformedURLException: no protocol" error message output to System.out whenever I use xsl:include. What's wrong with this scenario: My "main" xsl file includes another xsl file and tries to access a variable that is declared in the included file. The main xsl looks like this: <?xml version="1.0"?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="UTF-8"/> <xsl:include href="xt-test-include.xsl"/> <xsl:template match="/"> <xt-test-include-result> <xsl:value-of select="$xt-test-include-variable"/> </xt-test-include-result> </xsl:template> </xsl:transform> The included xsl file is named xt-test-include.xsl and lives in directory at c:\IBMVJava\ide\project_resources\Advice Utility\com\aexp\advice\formatting\production xsl. It looks like this: <?xml version="1.0"?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform/1.0"> <xsl:variable name="xt-test-include-variable" select="'Congratulations, you found me!'"/> </xsl:transform> Before I invoke the XSLProcessor, I instantiate an InputSource for the xsl and send it setSystemId("c:\IBMVJava\ide\project_resources\Advice Utility\com\aexp\advice\formatting\production xsl\"). When I run the processor, I get the following line of output on my console: java.net.MalformedURLException: no protocol: xt-test-include.xsl The comment for method InputSource.setSystemId(String) says the system identifier is optional if there is a character stream (which is the way I'm using it), but "it is still useful to provide one, since the application can use it to resolve relative URIs...". Obviously, my attempt to use href="filename" along with setSystemId(fileLocation) isn't what XT had in mind. Can someone let me know how I need to use setSystemId() and xsl:include? Thanks! . . . Phil Puccio XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format