http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Overview

Downloads
Getting Started

FAQs

Sample Apps
Command Line
Usage Patterns

C++ API

Extensions
Extensions Library

Release Notes

Bugs
Testing

Questions
 

Answers
 
Where do I go to learn about XSLT?
 

The definitive sources are the W3C XSLT and XPath recommendations: W3C Recommendation 16 November 1999 XSL Transformations (XSLT) Version 1.0 and XML Path Language (XPath) Version 1.0.

For general questions not specific to Xalan-C++, see Dave Pawson's XSL Frequently Asked Questions and Michael Kay's XSLT Programmer's Reference.

For a brief listing of tutorials, discussion forums, and other materials, see Getting up to speed with XSLT.


Where can I ask a question?
 

For generic questions about XSL stylesheets and transformations, use the XSL-List -- Open Forum on XSL hosted by Mulberry Technologies. There is an archive that can be searched as well. Please review the archive before posting a new question.

For specific questions on Xalan-C++, see xalan-c-users@xml.apache.org and xalan-dev@xml.apache.org on http://archive.covalent.net/. To subscribe to these mailing lists, see Mailing Lists. Again, please review the archives before posting a new question.


What is Xerces-C++ and why do I need it?
 

Xerces-C++ is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data. Like Xalan-C++, Xerces-C++ is available from the Apache XML site: http://xml.apache.org/xerces-c/index.html


Which version of Xerces should I be using?
 

The Xalan-C++ release notes includes information about the Xerces-C++ release with which the Xalan-C++ release has been coordinated and tested. See Status


I have encountered problem executing the Xalan-C++ sample applications after rebuilding them under Win32 Environment (Windows NT 4.0, SP3). When I tried to execute the sample, I receive the error message "Debug Assertion Failed! ... Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)".
 

You may be mixing debug and release versions of executables and libraries. In other words, if you are compiling the sample for debug, then you should link with the debug version of the Xalan-C++ and Xerces-C++ libraries and run with the debug version of the dynamic link libraries.

You must also make sure your application is linking with the Debug multithreaded DLL run-time library or the Multithreaded DLL run-time library. To check this setting do the following in Visual C++:

  1. Select Settings from the Project menu.

  2. Click the C/C++ tab.

  3. In the Category drop-down list, select Code Generation.

  4. In the Use run-time library drop-down list, select Multithreaded DLL for the Win32 Release configuration, or select Debug Multithreaded DLL for the Win32 Debug configuration.

Once you have changed this setting, you must rebuild your project.


What do I need to rebuild Xalan-C++ on Windows?
 

To build Xalan-C++ on Windows, you need Xerces-C++ and MS Visual C++ 6.0 installed with Service Pack 3 for Visual C++ and Visual Studio. You should also apply the bug fixes for the C++ standard library that shipped with Visual C++ 6.0. These fixes are available from the Dinkumware site: http://www.dinkumware.com/vc_fixes.html.

If you do not want to apply the Dinkumware patches, or you are using a different Service Pack, you must rebuild all of the Xerces and Xalan binaries.

For more details, see Steps for doing a Windows build.


What do I need to rebuild Xalan-C++ on UNIX?
 

To build Xalan-C++ on supported UNIX platforms, you need Xerces-C++ and a supported C++ compilers (see the table below).

For more details see: http://xml.apache.org/xalan-c/readme.html#unix

Platform - Operating System  Compilers 
AIX 4.3  IBM C and C++ for AIX 5.02 
Solaris 2.6  Sun Workshop 6 update 2 
HP/UX 11.0  aCC A.03.33 
Red Hat Linux 7.2  gcc 3.1 

For more details see: Steps for doing a UNIX build.


What is ICU and why do I need it?
 

The International Components for Unicode(ICU) is a C and C++ library that provides robust and full-featured Unicode support on a wide variety of platforms. Xalan-C++ uses the ICU to extend support for encoding, number formatting, and sorting.

The ICU is available for download from http://oss.software.ibm.com/developerworks/opensource/icu/project/index.html.

This release of Xalan was tested with ICU 2.2.

For more details see: Using the International Components for Unicode (ICU).


I am getting a tar checksum error on Solaris. What's the problem?
 

The Solaris tar utility you are using does not properly handle files with long pathnames. You must use GNU tar (gtar), which handles arbitrarily long pathnames and is freely available on every platform on which Xalan-C++ is supported. If you don't already have GNU tar installed on your system, you can obtain it from the Free Software Foundation http://www.gnu.org/software/tar/tar.html. For additional background information on this problem, see the online manual GNU tar and POSIX tar for the utility.


Is it possible to run Xalan-C++ from an Apache server?
 

A simple Apache module called ApacheModuleXSLT is provided as a sample. It demonstrates how to integrate Xalan-C++ with Apache.


Is Xalan-C++ thread-safe?
 

Instances of XalanTransformer are not thread-safe; each thread should use its own instance.

In order to support very efficient use in multi-threaded applications, Xalan-C++ is designed to avoid synchronization as much as possible. Each thread of execution is required to have its own set of "support" objects that contain the state of the transformation. Accordingly, no synchronization is required when multiple threads are executing.

Parsed ("compiled") stylesheets (see Compiling stylesheets) and parsed source documents may be freely shared by multiple threads of execution without worrying about providing synchronized access to them. The only exception to this rule: You use XercesParserLiaison to parse a document after calling XercesParserLiaison::setBuildBridgeNodes(false) or XercesParserLiaison::setThreadSafe(false). In this case, the document cannot be shared by multiple threads of execution. For reasons of performance, we do not recommend the use of XercesParserLiaison, so this should not be an issue for most applications.

All other objects in Xalan-C++ are not thread-safe. Each thread must have its own instance of each object.

See the ThreadSafe sample program for more information.


What can I do to speed up transformations?
 

To maximize performance, here are some suggestions for you to keep in mind as you set up your applications:

  • Use a compiled stylesheet when you expect to use the stylesheet more than once.

  • Set up your stylesheets to function efficiently.

    • Don't use "//" (descendant axes) patterns near the root of a large document.

    • Use xsl:key elements and the key() function as an efficient way to retrieve node sets.

    • Where possible, use pattern matching rather than xsl:if or xsl:when statements.

    • xsl:for-each is fast because it does not require pattern matching.

    • Keep in mind that xsl:sort prevents incremental processing.

    • When you create variables, <xsl:variable name="fooElem" select="foo"/> is usually faster than <xsl:variable name="fooElem"><xsl:value-of-select="foo"/></xsl:variable>.

    • Be careful using the last() function.

    • The use of index predicates within match patterns can be expensive.


Can I validate an XSL stylesheet?
 

An XSL stylesheet is an XML document, so it can have a DOCTYPE and be subject to validation, but you probably will have to write a custom DTD for the purpose.

The XSLT Recommendation includes a DTD Fragment for XSL Stylesheets 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.

You can use the xsl:stylesheet doctype defined in xsl-html40s.dtd for stylesheets that generate HTML.


What does the XalanDOMException HIERARCHY_REQUEST_ERR mean?
 

It means that an attempt was made to add a node to a DOM that would create an invalid structure. For example, text nodes are not allowed as children of the document node.

This is a common error when attempting to transform to DOM. Source documents and stylesheets that might produce valid serialized XML might not produce value DOM. The usual suspect is text nodes being generated before the document element is generated.

If you think you have seen this error because of a bug in Xalan-C++'s source tree implementation, please post a bug report on Bugzilla, and attach a minimal source document and stylesheet that produce the problem to the bug report.


Who do I submit patches to?
 

Your contributions are much appreciated! Please e-mail your patches to Xalan Development Mailing List.




Copyright © 2001 The Apache Software Foundation. All Rights Reserved.