| <HTML><HEAD><SCRIPT language="JavaScript" src="resources/script.js" type="text/javascript"></SCRIPT><TITLE>Frequently asked questions</TITLE></HEAD><BODY alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" height="60" rowspan="3" valign="top" width="135"><IMG alt="logo" border="0" height="60" hspace="0" src="resources/logo.gif" vspace="0" width="135"></TD><TD align="left" colspan="4" height="5" valign="top" width="456"><IMG alt="line" border="0" height="5" hspace="0" src="resources/line.gif" vspace="0" width="456"></TD><TD align="left" height="60" rowspan="3" valign="top" width="29"><IMG alt="right" border="0" height="60" hspace="0" src="resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top" width="456"><IMG alt="" border="0" height="35" hspace="0" src="graphics/faq-header.jpg" vspace="0" width="456"></TD></TR><TR><TD align="left" height="20" valign="top" width="168"><IMG alt="bottom" border="0" height="20" hspace="0" src="resources/bottom.gif" vspace="0" width="168"></TD><TD align="left" height="20" valign="top" width="96"><A href="http://xalan.apache.org/" onMouseOut="rolloverOff('xml');" onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xalan.apache.org/" border="0" height="20" hspace="0" name="xml" onLoad="rolloverLoad('xml','resources/button-xml-hi.gif','resources/button-xml-lo.gif');" src="resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.apache.org/" onMouseOut="rolloverOff('asf');" onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/" border="0" height="20" hspace="0" name="asf" onLoad="rolloverLoad('asf','resources/button-asf-hi.gif','resources/button-asf-lo.gif');" src="resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/" onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');" target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0" name="w3c" onLoad="rolloverLoad('w3c','resources/button-w3c-hi.gif','resources/button-w3c-lo.gif');" src="resources/button-w3c-lo.gif" vspace="0" width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG alt="join" border="0" height="14" hspace="0" src="resources/join.gif" vspace="0" width="120"><BR> |
| |
| <A href="http://xalan.apache.org/index.html" onMouseOut="rolloverOff('side-ext-4');" onMouseOver="rolloverOn('side-ext-4');"><IMG alt="Home" border="0" height="12" hspace="0" name="side-ext-4" onLoad="rolloverLoad('side-ext-4','graphics/ext-4-label-2.jpg','graphics/ext-4-label-3.jpg');" src="graphics/ext-4-label-3.jpg" vspace="0" width="120"></A><BR> |
| <IMG alt="separator" border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR> |
| <A href="index.html" onMouseOut="rolloverOff('side-index');" onMouseOver="rolloverOn('side-index');"><IMG alt="Xalan-J 2.7.1" border="0" height="12" hspace="0" name="side-index" onLoad="rolloverLoad('side-index','graphics/index-label-2.jpg','graphics/index-label-3.jpg');" src="graphics/index-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="charter.html" onMouseOut="rolloverOff('side-charter');" onMouseOver="rolloverOn('side-charter');"><IMG alt="Charter" border="0" height="12" hspace="0" name="side-charter" onLoad="rolloverLoad('side-charter','graphics/charter-label-2.jpg','graphics/charter-label-3.jpg');" src="graphics/charter-label-3.jpg" vspace="0" width="120"></A><BR> |
| <IMG alt="separator" border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR> |
| <A href="whatsnew.html" onMouseOut="rolloverOff('side-whatsnew');" onMouseOver="rolloverOn('side-whatsnew');"><IMG alt="What's New" border="0" height="12" hspace="0" name="side-whatsnew" onLoad="rolloverLoad('side-whatsnew','graphics/whatsnew-label-2.jpg','graphics/whatsnew-label-3.jpg');" src="graphics/whatsnew-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="readme.html" onMouseOut="rolloverOff('side-readme');" onMouseOver="rolloverOn('side-readme');"><IMG alt="Release Notes" border="0" height="12" hspace="0" name="side-readme" onLoad="rolloverLoad('side-readme','graphics/readme-label-2.jpg','graphics/readme-label-3.jpg');" src="graphics/readme-label-3.jpg" vspace="0" width="120"></A><BR> |
| <IMG alt="separator" border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR> |
| <A href="overview.html" onMouseOut="rolloverOff('side-overview');" onMouseOver="rolloverOn('side-overview');"><IMG alt="Overview" border="0" height="12" hspace="0" name="side-overview" onLoad="rolloverLoad('side-overview','graphics/overview-label-2.jpg','graphics/overview-label-3.jpg');" src="graphics/overview-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="downloads.html" onMouseOut="rolloverOff('side-downloads');" onMouseOver="rolloverOn('side-downloads');"><IMG alt="Download/Build" border="0" height="12" hspace="0" name="side-downloads" onLoad="rolloverLoad('side-downloads','graphics/downloads-label-2.jpg','graphics/downloads-label-3.jpg');" src="graphics/downloads-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="getstarted.html" onMouseOut="rolloverOff('side-getstarted');" onMouseOver="rolloverOn('side-getstarted');"><IMG alt="Getting Started" border="0" height="12" hspace="0" name="side-getstarted" onLoad="rolloverLoad('side-getstarted','graphics/getstarted-label-2.jpg','graphics/getstarted-label-3.jpg');" src="graphics/getstarted-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="xsltc_usage.html" onMouseOut="rolloverOff('side-xsltc_usage');" onMouseOver="rolloverOn('side-xsltc_usage');"><IMG alt="Using XSLTC" border="0" height="12" hspace="0" name="side-xsltc_usage" onLoad="rolloverLoad('side-xsltc_usage','graphics/xsltc_usage-label-2.jpg','graphics/xsltc_usage-label-3.jpg');" src="graphics/xsltc_usage-label-3.jpg" vspace="0" width="120"></A><BR> |
| <IMG alt="separator" border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR> |
| <IMG alt="FAQs" border="0" height="12" hspace="0" src="graphics/faq-label-1.jpg" vspace="0" width="120"><BR> |
| <IMG alt="separator" border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR> |
| <A href="samples.html" onMouseOut="rolloverOff('side-samples');" onMouseOver="rolloverOn('side-samples');"><IMG alt="Sample Apps" border="0" height="12" hspace="0" name="side-samples" onLoad="rolloverLoad('side-samples','graphics/samples-label-2.jpg','graphics/samples-label-3.jpg');" src="graphics/samples-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="commandline.html" onMouseOut="rolloverOff('side-commandline');" onMouseOver="rolloverOn('side-commandline');"><IMG alt="Command Line" border="0" height="12" hspace="0" name="side-commandline" onLoad="rolloverLoad('side-commandline','graphics/commandline-label-2.jpg','graphics/commandline-label-3.jpg');" src="graphics/commandline-label-3.jpg" vspace="0" width="120"></A><BR> |
| |
| <IMG alt="separator" border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR> |
| <A href="features.html" onMouseOut="rolloverOff('side-features');" onMouseOver="rolloverOn('side-features');"><IMG alt="Features" border="0" height="12" hspace="0" name="side-features" onLoad="rolloverLoad('side-features','graphics/features-label-2.jpg','graphics/features-label-3.jpg');" src="graphics/features-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="trax.html" onMouseOut="rolloverOff('side-trax');" onMouseOver="rolloverOn('side-trax');"><IMG alt="Transform API" border="0" height="12" hspace="0" name="side-trax" onLoad="rolloverLoad('side-trax','graphics/trax-label-2.jpg','graphics/trax-label-3.jpg');" src="graphics/trax-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="xpath_apis.html" onMouseOut="rolloverOff('side-xpath_apis');" onMouseOver="rolloverOn('side-xpath_apis');"><IMG alt="XPath API" border="0" height="12" hspace="0" name="side-xpath_apis" onLoad="rolloverLoad('side-xpath_apis','graphics/xpath_apis-label-2.jpg','graphics/xpath_apis-label-3.jpg');" src="graphics/xpath_apis-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="usagepatterns.html" onMouseOut="rolloverOff('side-usagepatterns');" onMouseOver="rolloverOn('side-usagepatterns');"><IMG alt="Usage Patterns" border="0" height="12" hspace="0" name="side-usagepatterns" onLoad="rolloverLoad('side-usagepatterns','graphics/usagepatterns-label-2.jpg','graphics/usagepatterns-label-3.jpg');" src="graphics/usagepatterns-label-3.jpg" vspace="0" width="120"></A><BR> |
| <IMG alt="separator" border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR> |
| <A href="apidocs/index.html" onMouseOut="rolloverOff('side-ext-52');" onMouseOver="rolloverOn('side-ext-52');"><IMG alt="Xalan-J API" border="0" height="12" hspace="0" name="side-ext-52" onLoad="rolloverLoad('side-ext-52','graphics/ext-52-label-2.jpg','graphics/ext-52-label-3.jpg');" src="graphics/ext-52-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="public_apis.html" onMouseOut="rolloverOff('side-public_apis');" onMouseOver="rolloverOn('side-public_apis');"><IMG alt="Public APIs" border="0" height="12" hspace="0" name="side-public_apis" onLoad="rolloverLoad('side-public_apis','graphics/public_apis-label-2.jpg','graphics/public_apis-label-3.jpg');" src="graphics/public_apis-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="dtm.html" onMouseOut="rolloverOff('side-dtm');" onMouseOver="rolloverOn('side-dtm');"><IMG alt="DTM" border="0" height="12" hspace="0" name="side-dtm" onLoad="rolloverLoad('side-dtm','graphics/dtm-label-2.jpg','graphics/dtm-label-3.jpg');" src="graphics/dtm-label-3.jpg" vspace="0" width="120"></A><BR> |
| <IMG alt="separator" border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR> |
| <A href="extensions.html" onMouseOut="rolloverOff('side-extensions');" onMouseOver="rolloverOn('side-extensions');"><IMG alt="Extensions" border="0" height="12" hspace="0" name="side-extensions" onLoad="rolloverLoad('side-extensions','graphics/extensions-label-2.jpg','graphics/extensions-label-3.jpg');" src="graphics/extensions-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="extensionslib.html" onMouseOut="rolloverOff('side-extensionslib');" onMouseOver="rolloverOn('side-extensionslib');"><IMG alt="Extensions Library" border="0" height="12" hspace="0" name="side-extensionslib" onLoad="rolloverLoad('side-extensionslib','graphics/extensionslib-label-2.jpg','graphics/extensionslib-label-3.jpg');" src="graphics/extensionslib-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="extensions_xsltc.html" onMouseOut="rolloverOff('side-extensions_xsltc');" onMouseOver="rolloverOn('side-extensions_xsltc');"><IMG alt="XSLTC Exts" border="0" height="12" hspace="0" name="side-extensions_xsltc" onLoad="rolloverLoad('side-extensions_xsltc','graphics/extensions_xsltc-label-2.jpg','graphics/extensions_xsltc-label-3.jpg');" src="graphics/extensions_xsltc-label-3.jpg" vspace="0" width="120"></A><BR> |
| <IMG alt="separator" border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR> |
| <A href="design/design2_0_0.html" onMouseOut="rolloverOff('side-ext-68');" onMouseOver="rolloverOn('side-ext-68');"><IMG alt="Xalan 2 Design" border="0" height="12" hspace="0" name="side-ext-68" onLoad="rolloverLoad('side-ext-68','graphics/ext-68-label-2.jpg','graphics/ext-68-label-3.jpg');" src="graphics/ext-68-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="xsltc/index.html" onMouseOut="rolloverOff('side-ext-70');" onMouseOver="rolloverOn('side-ext-70');"><IMG alt="XSLTC Design" border="0" height="12" hspace="0" name="side-ext-70" onLoad="rolloverLoad('side-ext-70','graphics/ext-70-label-2.jpg','graphics/ext-70-label-3.jpg');" src="graphics/ext-70-label-3.jpg" vspace="0" width="120"></A><BR> |
| <IMG alt="separator" border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR> |
| <A href="builds.html" onMouseOut="rolloverOff('side-builds');" onMouseOver="rolloverOn('side-builds');"><IMG alt="Building a release" border="0" height="12" hspace="0" name="side-builds" onLoad="rolloverLoad('side-builds','graphics/builds-label-2.jpg','graphics/builds-label-3.jpg');" src="graphics/builds-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="./test/overview.html" onMouseOut="rolloverOff('side-ext-76');" onMouseOver="rolloverOn('side-ext-76');"><IMG alt="Testing" border="0" height="12" hspace="0" name="side-ext-76" onLoad="rolloverLoad('side-ext-76','graphics/ext-76-label-2.jpg','graphics/ext-76-label-3.jpg');" src="graphics/ext-76-label-3.jpg" vspace="0" width="120"></A><BR> |
| <A href="bugreporting.html" onMouseOut="rolloverOff('side-bugreporting');" onMouseOver="rolloverOn('side-bugreporting');"><IMG alt="Bug Reporting" border="0" height="12" hspace="0" name="side-bugreporting" onLoad="rolloverLoad('side-bugreporting','graphics/bugreporting-label-2.jpg','graphics/bugreporting-label-3.jpg');" src="graphics/bugreporting-label-3.jpg" vspace="0" width="120"></A><BR> |
| <IMG alt="separator" border="0" height="6" hspace="0" src="resources/separator.gif" vspace="0" width="120"><BR> |
| <A href="contact_us.html" onMouseOut="rolloverOff('side-contact_us');" onMouseOver="rolloverOn('side-contact_us');"><IMG alt="Contact us" border="0" height="12" hspace="0" name="side-contact_us" onLoad="rolloverLoad('side-contact_us','graphics/contact_us-label-2.jpg','graphics/contact_us-label-3.jpg');" src="graphics/contact_us-label-3.jpg" vspace="0" width="120"></A><BR> |
| |
| |
| <IMG alt="close" border="0" height="14" hspace="0" src="resources/close.gif" vspace="0" width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE border="0" cellpadding="3" cellspacing="0"><TR><TD><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Questions</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif"><BR>General XSLT<UL><LI><A href="#faq-N1000A">Where do I go to learn about XSLT</A></LI><LI><A href="#faq-N10025">Where can I ask questions about XSLT</A></LI><LI><A href="#faq-N1003F">TrAX and JAXP</A></LI></UL>Versions<UL><LI><A href="#faq-N10064">Determining Xalan-Java Version</A></LI><LI><A href="#faq-N10095">Determining the Serializer Version</A></LI><LI><A href="#faq-N100AE">Which version of Xerces should I be using?</A></LI><LI><A href="#faq-N100C5">Compatibility with Xalan-Java version 1</A></LI><LI><A href="#faq-N100D8">Issues running Xalan-Java on JDK 1.3</A></LI><LI><A href="#faq-N100EF">Issues running Xalan-Java on JDK/JRE 1.4 or higher</A></LI><LI><A href="#faq-N10122">Issues running Xalan-Java on Tomcat with JDK 1.4</A></LI><LI><A href="#faq-N1013D">Issues running Applets with XSLTC in Web Browsers with JAVA Plug-in (JRE 1.4)</A></LI><LI><A href="#faq-N10158">Using the 'signature' file to verify a download</A></LI></UL>Performance Issues<UL><LI><A href="#faq-N10175">Speeding up transformations</A></LI><LI><A href="#faq-N101F0">JAXP factory lookup procedure</A></LI></UL>Namespace Related<UL><LI><A href="#faq-N10207">Retrieving nodes in the default namespace</A></LI><LI><A href="#faq-N1022E">Setting the parser to be namespace aware</A></LI></UL>Common Errors<UL><LI><A href="#faq-N1024D">NoClassDefFound errors</A></LI><LI><A href="#faq-N1027F">a "DOM006 Hierarchy request error"</A></LI><LI><A href="#faq-N1028F">Namespace not supported by SAXParser</A></LI><LI><A href="#faq-N102C8">Missing xsl:version attribute error</A></LI><LI><A href="#faq-N102E6">StackOverflowError with recursive stylesheet</A></LI><LI><A href="#faq-N102F9">OutOfMemoryError processing multiple documents</A></LI><LI><A href="#faq-N1032D">File Not Found error</A></LI><LI><A href="#faq-N10340">No more DTM IDs are available</A></LI><LI><A href="#faq-N10358">IllegalAccessError or could not load output_xml.properties on JDK 1.4</A></LI></UL>Miscellaneous<UL><LI><A href="#faq-N10382">Chaining transformations</A></LI><LI><A href="#faq-N103A4">Stylesheet validation</A></LI><LI><A href="#faq-N103BB">Setting output encoding</A></LI><LI><A href="#faq-N103D5">Getting line and column numbers for errors in XML input documents and XSL stylesheets</A></LI><LI><A href="#faq-N10411">Servlet unable to find classes for extension functions/elements</A></LI><LI><A href="#faq-N10424">Translet name doesn't match stylesheet name</A></LI></UL><UL></UL></FONT></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="666699" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Answers</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif"><BR><A name="faq-N1000A"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Where do I go to learn about XSLT?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>The definitive sources are the W3C XSLT and XPath recommendations: |
| <A href="http://www.w3.org/TR/xslt" target="_top">XSL Transformations (XSLT) Version 1.0</A> and |
| <A href="http://www.w3.org/TR/xpath" target="_top">XML Path Language (XPath) Version 1.0</A>. |
| </P> |
| <P>For a brief listing of tutorials, discussion forums, and other materials, see |
| <A href="overview.html#uptospeed">Getting up to speed with XSLT</A>. |
| </P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10025"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Where can I ask questions about XSLT?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P><A href="http://marc.theaimsgroup.com/?l=xalan-dev&r=1&w=2">xalan-dev</A> and |
| <A href="http://marc.theaimsgroup.com/?l=xalan-j-users&r=1&w=2">xalan-j-users</A> |
| are for Xalan-Java questions only. This is not the best |
| forum to ask general XSLT questions. The <A href="http://mulberrytech.com/xsl/xsl-list/index.html" target="_top">Mulberry XSL Mailing List</A> is an |
| excellent place to ask XSLT questions; please search |
| <A href="http://www.dpawson.co.uk/xsl/" target="_top">XSL Frequently Asked Questions</A> to ensure your question has not been already asked. |
| </P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N1003F"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>What are TrAX and JAXP, and are they related?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P><A name="trax"><!--anchor--></A></P> |
| <P>TrAX is the Transformation API for XML. In November 2000, TrAX was revised and incorporated |
| into JAXP, the JAVA API for XML Processing. JAXP (including TrAX) provides users a standard, |
| vendor-neutral API for working with (and transforming) XML documents. You can use this API |
| to build applications that are not bound to the particular implementation details of a given |
| XML parser or XSL transformer.</P> |
| <P>Xalan-Java includes the JAXP packages, implements the TrAX portion of |
| that API (javax.xml.transform....), implements the XPath API of JAXP (javax.xml.xpath....), |
| and includes xercesImpl.jar from |
| <A href="http://xerces.apache.org/xerces2-j/index.html" target="_top">Xerces-Java 2.9.0</A>, which implements the parser portion of the API |
| (javax.xml.parser....).</P> |
| <P>For more information, see <A href="trax.html">Using the JAXP Transform APIs</A> and |
| <A href="http://java.sun.com/webservices/jaxp/index.jsp" target="_top">Java API for XML Processing (JAXP) 1.3</A>. |
| </P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10064"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>How do I see what version of Xalan-Java I'm running? How do I determine |
| which parser I'm using?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P> |
| <A name="environmentcheck"><!--anchor--></A> |
| </P> |
| <P> |
| <B>Using the EnvironmentCheck utility:</B> To help diagnose classpath problems and also |
| determine which version of Xalan-Java is being used, try running |
| Xalan-Java's environment checking utility. |
| </P> |
| <P>You can run this utility from the command line as follows:</P> |
| <P> |
| <CODE><FONT face="courier, monospaced">java org.apache.xalan.xslt.EnvironmentCheck [-out outFile]</FONT></CODE> |
| </P> |
| <P>You can also call this utility from within your application. For example,</P> |
| <P> |
| <CODE><FONT face="courier, monospaced">boolean environmentOK = (new EnvironmentCheck()).checkEnvironment (yourPrintWriter);</FONT></CODE> |
| </P> |
| <P>Be sure to run EnvironmentCheck in the environment where you are experiencing the problem. |
| For example, if you get a NoClassDefFound error from a command-line application, run |
| EnvironmentCheck on the command line with exactly the same classpath. If the error occurs |
| inside your Java application (or in a servlet, etc.), be sure to call the EnvironmentCheck |
| checkEnvironment(...) method from within your running application.</P> |
| <P>Best of all, you can call checkEnvironment from a stylesheet using extensions:</P> |
| <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE> |
| <?xml version="1.0"?> |
| <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" |
| xmlns:xalan="http://xml.apache.org/xalan" |
| exclude-result-prefixes="xalan"> |
| <xsl:output indent="yes"/> |
| |
| <xsl:template match="/"> |
| <out> |
| <xsl:copy-of select="xalan:checkEnvironment()"/> |
| </out> |
| </xsl:template> |
| </xsl:stylesheet></PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10095"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>How do I see what version of the Serializer I'm running? </B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <A name="serlializercheck"><!--anchor--></A> |
| <P> |
| Xalan's serialier is now shared with Xerces. It may be packaged in Xalan, or Xerces, |
| or in the JRE itself. You can run the serializer's <B>Version</B> utility from the command line as follows: |
| </P> |
| <P> |
| <CODE><FONT face="courier, monospaced">java org.apache.xml.serializer.Version</FONT></CODE> |
| </P> |
| The output should indicate which serializer you are using. |
| </FONT></TD></TR></TABLE><BR><A name="faq-N100AE"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Which version of Xerces-Java should I be using?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P><A href="http://xalan.apache.org/old/xalan-j" target="_top">Xalan-Java Version 2.7.1</A> has been tested with <A href="http://xerces.apache.org/xerces2-j/index.html" target="_top">Xerces-Java 2.9.0</A>. |
| See <A href="readme.html#status">Status</A>. |
| </P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N100C5"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>How do I run applications that use the Xalan-Java version 1 API with Xalan-Java</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>The Xalan-Java version 1 compatibility API has been deprecated and removed, so you |
| must use the Xalan-Java version 2 API. We strongly encourage you to use the |
| <A href="http://java.sun.com/webservices/jaxp/index.jsp" target="_top">Java API for XML Processing (JAXP) 1.3</A>. For more information, see |
| the FAQ on <A href="#trax">TrAX and JAXP.</A></P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N100D8"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>I'm having a problem building or running Xalan-Java on the JDK 1.3.</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P><A name="jdk13"><!--anchor--></A></P> |
| <P>The JDK 1.3 automatically places everything in the lib/ext directory in front of everything |
| you place on the classpath. If this directory contains a version of DOM, JAXP, or Xerces |
| that predates the Xalan-Java distribution you are using, you may have problems!</P> |
| <P>The IBM JDK 1.3 includes an earlier version of xerces.jar in the lib/ext directory, a |
| version that does not implement the JAXP 1.3 interfaces and therefore does not work with the |
| current Xalan-Java release. Accordingly, you must either remove the |
| xerces.jar that is in that directory or replace it with the xercesImpl.jar that is included |
| with the Xalan-Java distribution.</P> |
| <P>The SUN JDK 1.3 includes a pre-1.1 version of the JAXP in crimson.jar. Either remove the |
| crimson.jar in that directory or overwrite it with a newer crimson.jar that includes and |
| implements the JAXP 1.3 interfaces.</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N100EF"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>I'm having a problem running Xalan-Java on JDK/JRE 1.4 or higher</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P><A name="jdk14"><!--anchor--></A></P> |
| <P>JDK/JRE 1.4, and JDK/JRE 5.0 is packaged with an old version of Xalan-Java. The JDK/JRE |
| will attempt to use this version instead of any on the classpath. Unfortunately, |
| this causes problems when attempting to use a newer version of Xalan-Java.</P> |
| <P>You can always determine which version of Xalan-Java you are running |
| by using the <A href="#environmentcheck">EnvironmentCheck</A> class or by using the |
| xalan:checkEnvironment extension function. It is highly recommended that you use this |
| method to verify the version of Xalan-Java you are running, especially |
| before opening a bug report.</P> |
| <P>To use a newer version of Xalan-Java and override the one packaged with the JDK:</P> |
| <UL> |
| <LI>use the |
| <A href="http://java.sun.com/j2se/1.4.2/docs/guide/standards/" target="_top">Endorsed Standards Override Mechanism</A>. Place the xalan.jar, serializer.jar, xercesImpl.jar |
| and xml-apis.jar in the |
| <java-home>\lib\endorsed directory, where |
| <java-home> is where the runtime software is installed. |
| </LI> |
| </UL> |
| <P>The following methods |
| <B>do not work</B>: |
| </P> |
| <UL> |
| <LI>Using the CLASSPATH environment variable or using -classpath to place the new classes |
| in the classpath.</LI> |
| <LI>Using the -jar option to explicitly execute the classes inside the new jar files.</LI> |
| </UL> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10122"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>I got java.lang.IllegalAccessError running Xalan-Java on Tomcat with JDK 1.4.</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P><A name="tomcat"><!--anchor--></A></P> |
| <P><A href="http://tomcat.apache.org/index.html">jakarta-tomcat 4.1.*</A> is packed |
| with an old version of xercesImpl.jar. Based on the <A href="http://java.sun.com/j2se/1.4.2/docs/guide/standards/" target="_top">Endorsed Standards Override Mechanism</A>, you should |
| replace it with the newer xercesImpl.jar. You should add a newer xalan.jar and serializer.jar |
| to Tomcat as well. |
| Read the FAQ about <A href="#jdk14">Issues running Xalan-Java on JDK/JRE 1.4 or higher</A>. Place the |
| xalan.jar, serializer.jar, and xercesImpl.jar in the <Tomcat_Home>\common\endorsed directory, where |
| <Tomcat_Home> is where the Tomcat application server is installed.</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N1013D"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>I got javax.xml.transform.TransformerException running my applet which uses XSLTC in JRE 1.4.</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P><A name="applet"><!--anchor--></A></P> |
| <P>To overwrite an older version of Xalan Java; packaged with JRE 1.4 or higher you can add a newer |
| xalan.jar and serializer.jar to the <jre-home>\lib\endorsed directory. Read the FAQ about |
| <A href="#jdk14">Issues running |
| Xalan-Java on JDK/JRE 1.4 or higer</A>. If there is a META-INF/services/javax.xml.transform.TransformerFactory |
| file in xalan.jar (as there is in the Xalan Java distributions), then the TransformerFactoryImpl |
| setting in this file will be used by the JVM during the factory finder lookup procedure. |
| The TransformerFactoryImpl for the Xalan Java Interpretive processor is the default setting in the |
| META-INF/services/javax.xml.transform.TransformerFactory file, therefore, you will get an error |
| when your applet attempts to use the XSLTC implementation.</P> |
| <P>To work around this problem, you can change the contents of the |
| META-INF/services/javax.xml.transform.TransformerFactory file in xalan.jar so that it refers to the |
| transformer factory class implementation for XSLTC, org.apache.xalan.xsltc.trax.TransformerFactoryImpl. </P> |
| <P>Another solution is to create a jar that contains a META-INF/services/javax.xml.transform.TransformerFactory file |
| containing the value org.apache.xalan.xsltc.trax.TransformerFactoryImpl. Place the jar in the |
| <jre-home>\lib\endorsed directory. When you name your jar file, the ASCII code of the first |
| character should be smaller than the ASCII code of "X" to ensure that your jar will be loaded before |
| xalan.jar</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10158"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>How do I use the "signature" file to verify my download?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>For each Xalan-Java download file there is a corresponding signature file. |
| The signature file for xalan-j_2_0_1.tar.gz, for example, is xalan-j_2_0_1.tar.gz.sig. |
| </P> |
| <P>The .sig files are PGP signatures of the actual .zip or .tar.gz |
| download files. You can use these files to verify the authenticity of the download. You do not |
| need the .sig file to use the corresponding download file.</P> |
| <P>To check the authenticity of a Xalan-Java distribution, you need a copy of |
| PGP which is available in a number of licenses, including some free |
| non-commercial licenses, either from an mit.edu site or on |
| the pgp.com site. Once you have a version of PGP installed, you |
| should be able to 'verify the signature' of the .sig file, which basically verifies that the |
| corresponding .zip or tar.gz file has not been changed since we signed it.</P> |
| <P>The PGP key can be found in |
| <A href="http://svn.apache.org/viewvc/xalan/java/trunk/KEYS">KEYS.</A></P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10175"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>What can I do to speed up transformations?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>In the ongoing development of Xalan-Java, enhancing performance is |
| the primary goal of the Xalan-Java team. Here are some preliminary |
| suggestions for you to keep in mind as you set up your applications:</P> |
| <UL> |
| <LI>Use a Templates object (with a different Transformers for each transformation) to |
| perform multiple transformations with the same set of stylesheet instructions (see |
| <A href="usagepatterns.html#multithreading">Multithreading</A>). |
| <BR> |
| <BR> |
| </LI> |
| <LI>Set up your stylesheets to function efficiently. |
| <BR> |
| <BR> |
| </LI> |
| <UL> |
| <LI>Don't use "//" (descendant axes) patterns near the root of a large document. |
| <BR> |
| <BR> |
| </LI> |
| <LI>Use xsl:key elements and the key() function as an efficient way to retrieve node sets. |
| <BR> |
| <BR> |
| </LI> |
| <LI>Where possible, use pattern matching rather than xsl:if or xsl:when statements. |
| <BR> |
| <BR> |
| </LI> |
| <LI>xsl:for-each is fast because it does not require pattern matching. |
| <BR> |
| <BR> |
| </LI> |
| <LI>Keep in mind that xsl:sort prevents incremental processing. |
| <BR> |
| <BR> |
| </LI> |
| <LI>When you create variables, <BR><CODE><FONT face="courier, monospaced"><xsl:variable name="fooElem" select="foo"/></FONT></CODE><BR> is usually faster than |
| <BR><CODE><FONT face="courier, monospaced"><xsl:variable name="fooElem"><xsl:value-of-select="foo"/></xsl:variable></FONT></CODE> |
| <BR> |
| <BR> |
| </LI> |
| <LI>Be careful using the last() function. |
| <BR> |
| <BR> |
| </LI> |
| <LI>The use of index predicates within match patterns can be expensive. |
| <BR> |
| <BR> |
| </LI> |
| <LI>Decoding and encoding is expensive. |
| <BR> |
| <BR> |
| </LI> |
| </UL> |
| <LI>For the ultimate in server-side scalability, perform transform operations on the client. |
| For examples, see |
| <A href="samples.html#appletxmltohtml">appletXMLtoHTML</A> and |
| <A href="samples.html#get-todo-list">get-todo-list</A>. |
| </LI> |
| </UL> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N101F0"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>What is the JAXP factory lookup procedure and does it affect performance?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>JAXP uses an ordered lookup procedure to find factory implementations, such as |
| an implementation of javax.xml.transform.TransformerFactory. For information |
| on this procedure, refer to Section 3 Plugability in <A href="http://java.sun.com/webservices/jaxp/index.jsp" target="_top">JAXP 1.3</A>. |
| </P> |
| <P>In most cases, Factory classes need only be looked up once for an application, so |
| performance is not an issue. However, there may be scenarios where the lookup |
| procedure executes multiple times which could impact performance. In these cases, |
| users may want to set system properties or populate the jaxp.properties file in order |
| to shorten the time spent in the lookup procedure. |
| </P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10207"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>XPath isn't retrieving nodes that are in the default namespace I defined. How do I get them?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>If you are looking for nodes in a namespace, the XPath expression must include a namespace |
| prefix that you have mapped to the namespace with an xmlns declaration. If you have declared |
| a default namespace, it does not have a prefix (see |
| <A href="http://www.w3.org/TR/xpath.html#node-tests">XPath Node Tests</A>). In order |
| to construct XPath expressions to retrieve nodes from this namespace, you must add a |
| namespace declaration that provides a prefix you can include in the XPath expressions.</P> |
| <P>Suppose, for example, you you want to locate nodes in a default namespace declared as follows: |
| <BR> |
| <CODE><FONT face="courier, monospaced">xmlns="http://my-namespace"</FONT></CODE> |
| </P> |
| <P>Add a namespace declaration with a prefix: |
| <BR> |
| <CODE><FONT face="courier, monospaced">xmlns:foo="http://my-namespace"</FONT></CODE> |
| </P> |
| <P>Then you can use foo: in your XPath expression.</P> |
| <P>Hint: Avoiding the use of default namespaces will prevent this problem from occuring.</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N1022E"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B> |
| How do I set my parser to be namespace aware? |
| </B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P><A name="namespace-aware"><!--anchor--></A></P> |
| <P>If you use a TransformerFactory to process a stylesheet Source and generate a Transformer, |
| the TransformerFactory instructs the SAXParserFactory to set the parser's namespaceAware |
| property to true. But if you call the parser directly, you may need to set the namespaceAware |
| property yourself. for example:</P> |
| <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>javax.xml.parsers.SAXParserFactory spFactory = |
| javax.xml.parsers.SAXParserFactory.newInstance(); |
| spFactory.setNamespaceAware(true);</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV> |
| <TABLE border="0" cellpadding="0" cellspacing="3" width="100%"><TR><TD valign="top" width="20"><IMG alt="Note" border="0" height="24" hspace="0" src="resources/note.gif" vspace="0" width="20"></TD><TD valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><I>For more information about setting the namespaceAware property, and SAX2 vs. JAXP default |
| settings, see <A href="http://people.apache.org/~edwingo/jaxp-faq.html#nsDefaults">JAXP FAQ: |
| Warning about namespace processing defaults</A>. |
| </I></FONT></TD></TR></TABLE> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N1024D"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>I'm getting a NoClassDefFound error. What has to be on the classpath?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <OL> |
| <LI>xalan.jar, serializer.jar, xml-apis.jar, and xercesImpl.jar -- or the XML parser you are using -- must |
| always be on the classpath. |
| <BR> |
| <BR> |
| </LI> |
| <LI>To run the samples in the samples subdirectories, xalansamples.jar must be on the |
| classpath. To run the servlet samples, you must place xalanservlet.war |
| on a web server with a servlet engine and you must put the javax.servlet and |
| javax.servlet.http packages on the classpath. These packages |
| are available via the servlet.jar file found in Apache Tomcat ( see <A href="http://tomcat.apache.org/" target="_top">The Jakarta Site - Apache Tomcat</A> ). |
| <BR> |
| <BR> |
| </LI> |
| <LI>To run extensions which use the component and script extension elements (including the |
| samples in samples/extensions), bsf.jar must be on the classpath. To run extensions |
| implemented in JavaScript, js.jar must also be on the classpath. For information on what |
| you need to run extensions implemented in other scripting languages, see |
| <A href="extensions.html#supported-lang">Supported languages</A>. |
| </LI> |
| </OL> |
| You can check the correctness of your environment with the |
| <A href="#environmentcheck">EnvironmentCheck</A> feature. |
| <P>For more information, see |
| <A href="getstarted.html#classpath">Setting up the system classpath</A>. |
| </P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N1027F"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Why do I get a "DOM006 Hierarchy request error" when I try to transform into a DOM Document node?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>This error occurs when Xalan-Java tries to add a Node to a Document node |
| where it isn't allowed. For example, attempting to add non-whitespace text to the DOM Document |
| node produces this error.</P> |
| <P>The error can also occur when a Document node is created with the DOMImplementation |
| createDocument() method, which takes a qualified name as an argument and creates an element |
| node. If you then pass the returned Document node to Xalan-Java, you |
| get a "DOM006 Hierarchy request error" when Xalan-Java tries to add a |
| second element to the Document node. The solution is to either use the DocumentBuilder |
| newDocument() method to create a Document that does not contain an element node, or use a |
| DocumentFragment. It should be noted that the DocumentBuilder newDocument() method is |
| "Non-preferred" according to the JAXP 1.3 documentation.</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N1028F"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Why am I getting a "Namespace not supported by SAXParser exception?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>We have seen this problem arise for two quite different reasons:</P> |
| <UL> |
| <LI>SAX1 interfaces are on your classpath in front of the SAX2 interfaces provided with |
| your XML parser. |
| <BR> |
| <BR> |
| or |
| <BR> |
| <BR> |
| </LI> |
| <LI>The parser you are using to process a stylesheet Source and generate a Transformer does |
| not have the namespaceAware property set to true.</LI> |
| </UL> |
| <P> |
| <B>SAX1 on the classpath</B> |
| </P> |
| <P>SAX1 should not be on your classpath. The SAX1 interfaces and implementations of the SAX1 |
| SAX parser are not namespace aware.</P> |
| <P>To help diagnose your classpath, you can use the |
| <A href="#environmentcheck">EnvironmentCheck |
| utility</A>. If you are running under JDK 1.3, see |
| <A href="#jdk13">Issues running Xalan-Java on JDK |
| 1.3</A>. If you are running a servlet, make sure the webserver is not placing SAX1 on the |
| classpath. |
| </P> |
| <P>When you create a Transformer, you must use a |
| <A href="#namespace-aware">namespace-aware</A> parser to parse the stylesheet. |
| </P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N102C8"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>I'm getting an error about my stylesheet missing the xsl:version attribute - what's wrong?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>There are two common causes for this error.</P> |
| <OL> |
| <LI>Using the wrong URI for the xsl: prefix will cause this message. URIs, and namespace |
| URIs in particular, are case sensitive. Ensure the URI for the xsl namespace is |
| "http://www.w3.org/1999/XSL/Transform".<BR><BR></LI> |
| <LI>The parser you are using to process a stylesheet Source and generate a Transformer |
| does not have the namespaceAware property set to true.<BR> |
| When you create a Transformer, you must use a <A href="#namespace-aware">namespace-aware</A> parser to parse the stylesheet.</LI> |
| </OL> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N102E6"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Xalan-Java dies with a java.lang.StackOverflowError when I run a deeply |
| recursive stylesheet. The same stylesheet worked fine in the past (or on other machines). |
| What's happening?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>That may not be our fault. As of JDK 1.3.x, many Java Virtual Machine publishers reduced |
| the default size of a thread's call stack from 1MB to 256KB. This allows more threads to |
| run simultaneously, but it means that each thread is more limited in how deeply its function |
| calls can be nested.</P> |
| <P>Some JVMs may offer an option that allows you to raise this limit. For example, in Sun |
| JDK 1.3.1 you can start JVM with the -Xss1m option to allow each thread to use a full |
| megabyte. In IBM's JDK you can start with the -Xss1m and -Xoss1m options. Other JVMs |
| may set this in other ways, or may not allow you to control it at all; check the |
| documentation on your system for details.</P> |
| <P>Note too that on some platforms 1MB is an architectural upper limit on the stack size, so |
| setting -Xss2m (or equivalent) may not allow deeper recursion than -Xss1m.</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N102F9"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>I get a java.lang.OutOfMemoryError when I try to process multiple documents with the |
| document() function. What can I do?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>As a general rule, Xalan-Java currently caches all of the documents |
| that you read in with the document() function during a transformation.</P> |
| <P>If your objective is to transform a series of documents, you can break the process into a |
| series of transformations. The |
| <A href="extensionslib.html#pipedocument">PipeDocument</A> extension element |
| provides one strategy for batching a series of parallel transformations.</P> |
| <P>Another alternative is to place your document() call in the select attribute of an |
| xsl:for-each instruction element and use a custom PI (Processing Instruction) to turn off |
| document caching. Include an XPath expression in your document() call if you do not |
| need to process the entire document.</P> |
| <P>Sample stylesheet fragment:</P> |
| <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE> |
| <xsl:template match="doc"> |
| <xsl:for-each select="document(@href)/bar/zulu"> |
| <?xalan-doc-cache-off?> |
| <!-- process each document --> |
| <xsl:for-each> |
| </xsl:template></PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV> |
| <TABLE border="0" cellpadding="0" cellspacing="3" width="100%"><TR><TD valign="top" width="20"><IMG alt="Note" border="0" height="24" hspace="0" src="resources/note.gif" vspace="0" width="20"></TD><TD valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><I>PIs do not ordinarily uses namespaces, so "xalan:" is a 'fake' namespace we have |
| included to indicate that this is not a standard PI.</I></FONT></TD></TR></TABLE> |
| <P>If you include an XPath expression in your document() call, you can also turn on |
| <A href="dtm.html#incremental">incremental transform</A> to eliminate the need |
| to read in the entire document. In fact, you can take advantage of the incremental transform |
| feature even if you are not turning off document caching. |
| </P> |
| <P>You can also increase your JVM heap size with the -Xmx or -mx flag, depending on which JVM |
| you are using (you can include both flags, and the JVM will ignore the one it doesn't |
| understand). For example, to give your JVM 64 meg, try |
| <BR> |
| <CODE><FONT face="courier, monospaced"> java -Xmx64m -mx64m |
| <I>Class</I> |
| </FONT></CODE> |
| </P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N1032D"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Why do I get 'file not found' when I pass c:\path\filename.txt?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>Xalan-Java often requires legal URLs as system identifiers, not local |
| pathnames (this is partly due to underlying parsers requiring this). A simple (but not always |
| correct!) way to change a local pathname into a URL in Java 1.1x is:</P> |
| <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE> |
| public static String filenameToURL(String filename) |
| { |
| File f = new File(filename); |
| String tmp = f.getAbsolutePath(); |
| if (File.separatorChar == '\\') |
| { |
| tmp = tmp.replace('\\', '/'); |
| } |
| // Note: gives incorrect results when filename already begins with |
| file:/// |
| return "file:///" + tmp; |
| } |
| </PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV> |
| <P>For a slightly more detailed example, see org.apache.xml.utils.SystemIDResolver.</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10340"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>What does: "XSLT Error (javax.xml.transform.TransformerException): |
| org.apache.xml.dtm.DTMException: No more DTM IDs are available" mean?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>It means you are probably using a very old version of Xalan or Xalan-Java, |
| likely the version 2.2D11 which was packaged in JDK1.4. Architectural changes made in |
| early 2002 should have eliminated this issue for almost all cases.</P> |
| <P>You should verify the version of Xalan-Java you are using by running |
| the <A href="#environmentcheck">EnvironmentCheck</A> utility, |
| and read the FAQ about <A href="#jdk14">Issues running Xalan-Java |
| on JDK 1.4</A>.</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10358"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Why do I get a "java.lang.IllegalAccessError" or the message |
| "Could not load the property file 'output_xml.properties'" when I try |
| to transform using XSLTC or Xalan-Java Interpretive?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>These errors may occur if you use JDK 1.4 or later releases.</P> |
| <P>JRE 1.4 and later releases contain copies of Xalan-Java. In some |
| cases, the JRE includes only Xalan-Java Interpretive, while in other cases it also |
| includes XSLTC. Typically, the copy of the processor packaged |
| with the JRE will be loaded in preference to any copy of Xalan-Java on |
| your class path.</P> |
| <P>Beginning with Xalan-Java 2.5, Xalan-Java Interpretive and XSLTC are both |
| packaged in xalan.jar, and share some of the same classes. If you |
| are using a version of the JRE that contains Xalan-Java Interpretive, but not |
| XSLTC, and you try to use XSLTC on your class path, |
| classes from that version of XSLTC may be loaded along with |
| classes from the version of Xalan-Java packaged with your JRE.</P> |
| <P>Because the classes may be from different versions of Xalan-Java, the |
| results may be unpredictable. In particular, a |
| <CODE><FONT face="courier, monospaced">java.lang.IllegalAccessError</FONT></CODE> may be thrown, or an |
| <CODE><FONT face="courier, monospaced">org.apache.xml.utils.WrappedRuntimeException</FONT></CODE> containing |
| the message: <CODE><FONT face="courier, monospaced">"Could not load the property file |
| 'output_xml.properties' for output method 'xml' (check |
| CLASSPATH)"</FONT></CODE> may be thrown.</P> |
| <P>To work around those problems, please read the FAQ entitled |
| <A href="#jdk14">Issues running Xalan-Java on JDK 1.4</A>.</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10382"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>How do you chain together a series of transformations?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>Xalan-Java supports two strategies for chaining together a series of |
| transformations such that the output of each transformation provides input for the next |
| transformation.</P> |
| <UL> |
| <LI>For each transformation in the series, you can set one SAX ContentHandler to process |
| the input, and another ContentHandler to process the output. |
| <BR> |
| <BR> |
| </LI> |
| <LI>You can also set up a series of parent-child relationships between an XMLReader and |
| one or more XMLFilters.</LI> |
| </UL> |
| <P>For the details and links to examples, see |
| <A href="usagepatterns.html#outasin">Using transformation output as input for |
| another transformation</A>.</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N103A4"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>How do I validate an XSL stylesheet?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>An XSL stylesheet is an XML document, so it can have a DOCTYPE and be subject to |
| validation, right?</P> |
| <P>The XSLT Recommendation includes a |
| <A href="http://www.w3.org/TR/xslt#dtd">DTD Fragment |
| for XSL Stylesheets</A> with some indications of what you need to do to create a |
| complete DTD for a given stylesheet. Keep in mind that stylesheets can include literal |
| result elements and produce output that is not valid XML.</P> |
| <P>You can use the xsl:stylesheet doctype defined in xsl-html40s.dtd for stylesheets that |
| generate HTML.</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N103BB"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>Why is the output character encoding I set in the stylesheet not being used?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>If you use a character output stream to instantiate the |
| <A href="apidocs/javax/xml/transform/stream/StreamResult.html">StreamResult</A> object |
| which holds the transformation output, the Writer uses its own encoding, not the encoding |
| you specify in the stylesheet.</P> |
| <P>If you want to use the stylesheet output encoding, do not use StreamResult(java.io.Writer) |
| to instantiate the holder for the output. Alternatively, you can specify the encoding when |
| you create a Writer (java.io.OutputStreamWriter). Once the Writer exists, you cannot change |
| its encoding. If the transformation is run in a servlet, it is possible |
| that the Writer is coming from the ServletResponse object. |
| </P> |
| <P> |
| If the stylesheet is run using the JAXP APIs and the Transformer's setOutputProperty() |
| method is invoked, it is possible to set the <B>"encoding"</B> property and |
| over-ride the value in the stylesheet. |
| </P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N103D5"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>How do I get line numbers for errors in the XML or XSL input when I am performing a |
| transformation?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>Use or mimic the command-line processor (<A href="apidocs/org/apache/xalan/xslt/Process.html">org.apache.xalan.xslt.Process</A>). |
| </P> |
| <P>A |
| <A href="apidocs/javax/xml/transform/TransformerException.html">TransformerException</A> generally wraps another exception, often a SAXParseException. The command-line processor uses the static |
| <A href="apidocs/org/apache/xml/utils/DefaultErrorHandler.html">org.apache.xml.utils.DefaultErrorHandler</A> printLocation() method to chase down the exception cause and get a |
| <A href="apidocs/javax/xml/transform/SourceLocator.html">SourceLocator</A> that can usually report line and column number. |
| </P> |
| <P>Suppose you wanted to modify the ValidateXMLInput sample in the samples/Validate |
| subdirectory to include line and column numbers . All you need to do is call |
| DefaultErrorHandler.printLocation() in the the Handler internal class error() and warning() |
| methods. For example, replace</P> |
| <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>public void error (SAXParseException spe) |
| throws SAXException |
| { |
| System.out.println("SAXParseException error: " + spe.getMessage()); |
| }</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV> |
| <P>with</P> |
| <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE>public void error (SAXParseException spe) |
| throws SAXException |
| { |
| PrintWriter pw = new PrintWriter(System.out, true); |
| org.apache.xml.utils.DefaultErrorHandler.printLocation(pw, spe); |
| pw.println("SAXParseException error: " + spe.getMessage()); |
| }</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV> |
| <P>You can also replicate code from the printLocation() method to obtain a SourceLocator, and |
| then use the SourceLocator getLineNumber() and getColumnNumber() methods. The |
| getRootSourceLocator() method below returns a SourceLocator.</P> |
| <DIV align="right"><TABLE border="0" cellpadding="0" cellspacing="4" width="464"><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#ffffff" width="462"><FONT size="-1"><PRE> |
| import javax.xml.transform.SourceLocator; |
| import javax.xml.transform.TransformerException; |
| import org.xml.sax.SAXException; |
| import org.xml.sax.SAXParseException; |
| import org.apache.xml.utils.SAXSourceLocator; |
| import org.apache.xml.utils.WrappedRuntimeException; |
| .... |
| public static SourceLocator getRootSourceLocator(Throwable exception) |
| { |
| SourceLocator locator = null; |
| Throwable cause = exception; |
| |
| // Try to find the locator closest to the cause. |
| do |
| { |
| if(cause instanceof SAXParseException) |
| { |
| locator = new SAXSourceLocator((SAXParseException)cause); |
| } |
| else if (cause instanceof TransformerException) |
| { |
| SourceLocator causeLocator = |
| ((TransformerException)cause).getLocator(); |
| if(null != causeLocator) |
| locator = causeLocator; |
| } |
| if(cause instanceof TransformerException) |
| cause = ((TransformerException)cause).getCause(); |
| else if(cause instanceof WrappedRuntimeException) |
| cause = ((WrappedRuntimeException)cause).getException(); |
| else if(cause instanceof SAXException) |
| cause = ((SAXException)cause).getException(); |
| else |
| cause = null; |
| } |
| while(null != cause); |
| |
| return locator; |
| }</PRE></FONT></TD><TD bgcolor="#0086b2" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" height="1" width="462"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="462"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></DIV> |
| <TABLE border="0" cellpadding="0" cellspacing="3" width="100%"><TR><TD valign="top" width="20"><IMG alt="Note" border="0" height="24" hspace="0" src="resources/note.gif" vspace="0" width="20"></TD><TD valign="top"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><I> |
| <B>Xalan-Java exception handling:</B> The exception architecture |
| in Xalan-Java and with transforms in general is tricky because of |
| multiple layers of exception handling, involving movement back and forth between SAX and |
| Transformer exceptions and across pipes. Xalan-Java often uses a |
| WrappedRuntimeException to throw over many layers of checked exceptions, in order not to |
| have every possible checked exception be declared for every function in the stack, which |
| means it has to catch this exception at the upper levels and unwrap the exception to pass |
| it on as a TransformerException. |
| <BR> |
| <BR>A JAXP 1.3 TransformerException often wraps another exception. Two of the |
| TransformerException structures that are frequently used to construct contained exceptions |
| in JAXP 1.3 do not set the locator. The locator is not set because we don't know the type |
| of exception that the Throwable argument represents. The solution is to chase up the |
| contained exceptions to find the root cause, which will usually have a location set for |
| you. This can be somewhat tricky, as not all the exceptions may be TransformerExceptions. |
| A good sample is in the DefaultHandler static printLocation() method, which the |
| Xalan-Java command-line processor uses to report errors. You can also |
| roll your own functions along the lines of the getRootSourceLocator() example above. |
| </I></FONT></TD></TR></TABLE> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10411"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>My servlet cannot find classes that implement extension functions or elements. What can I do?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>If you install xalan.jar in the webserver's lib directory (e.g., tomcat/lib), as |
| opposed to the servlet application's lib directory, then the Xalan-Java classes |
| are loaded by a classloader that does not see the classes in the application's classloader |
| (i.e., the extension classes, if you placed them there). The Xalan-Java |
| classes try to load the extension classes using their own classloader, and that attempt |
| fails.</P> |
| <P>Workaround: place xalan.jar in the servlet application's lib directory and NOT in the webserver's |
| lib directory. Another workaround is to place the extension classes also in the webserver's |
| lib directory, but you generally want to avoid cluttering that directory.</P> |
| <P>Thanks to Gunnlauger Thor Briem (gthb@dimon.is) for providing this information.</P> |
| </FONT></TD></TR></TABLE><BR><A name="faq-N10424"><!--anchor--></A><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="666699" colspan="2" width="484"><TABLE border="0" cellpadding="0" cellspacing="0" width="484"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="482"><FONT color="#ffffff" face="arial,helvetica,sanserif"><IMG alt="" border="0" height="2" hspace="0" src="resources/void.gif" vspace="0" width="2"><B>My stylesheet is named foo-bar.xsl, but XSLTC |
| created a translet named foo_bar. Is that a bug?</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="482"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="482"></TD><TD bgcolor="#017299" height="1" width="1"><IMG alt="" border="0" height="1" hspace="0" src="resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="474"><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"><BR> |
| <P>No. The name of a translet is usually the name of the stylesheet, |
| the name specified using the <CODE><FONT face="courier, monospaced">translet-name</FONT></CODE> attribute on |
| the XSLTC <CODE><FONT face="courier, monospaced">TransformerFactory</FONT></CODE> or the name |
| specified for the translet on the command-line invocation. |
| However, the name of the translet is also the name of a Java class. |
| Any character that is not permitted in a class name is replaced with |
| an underscore.</P> |
| </FONT></TD></TR></TABLE><BR><BR></FONT></TD></TR></TABLE><BR></TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG alt="dot" height="1" src="resources/dot.gif" width="1"></TD></TR><TR><TD align="center"><FONT color="#0086b2" size="-1"><I> |
| Copyright © 2006 The Apache Software Foundation. |
| All Rights Reserved. |
| </I></FONT></TD></TR></TABLE></BODY></HTML> |