Return-Path: X-Original-To: apmail-xalan-commits-archive@www.apache.org Delivered-To: apmail-xalan-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C8A26DA73 for ; Mon, 22 Oct 2012 19:24:30 +0000 (UTC) Received: (qmail 18375 invoked by uid 500); 22 Oct 2012 19:24:30 -0000 Delivered-To: apmail-xalan-commits-archive@xalan.apache.org Received: (qmail 18357 invoked by uid 500); 22 Oct 2012 19:24:30 -0000 Mailing-List: contact commits-help@xalan.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list commits@xalan.apache.org Received: (qmail 18348 invoked by uid 99); 22 Oct 2012 19:24:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 19:24:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 19:24:13 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B5CD32388ABC for ; Mon, 22 Oct 2012 19:23:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1401023 [6/15] - /xalan/site/docs/xalan/xalan-c/ Date: Mon, 22 Oct 2012 19:23:04 -0000 To: commits@xalan.apache.org From: shathaway@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121022192305.B5CD32388ABC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: xalan/site/docs/xalan/xalan-c/faq.html URL: http://svn.apache.org/viewvc/xalan/site/docs/xalan/xalan-c/faq.html?rev=1401023&r1=1401022&r2=1401023&view=diff ============================================================================== --- xalan/site/docs/xalan/xalan-c/faq.html (original) +++ xalan/site/docs/xalan/xalan-c/faq.html Mon Oct 22 19:23:03 2012 @@ -1,732 +1,732 @@ - - - - -ASF: Frequently asked questions - - - - - - -
- - - - - - - - - - -
- -Trademark Logo - - -Xalan-C/C++ Version 1.11 -
Frequently asked questions
- - - - - - - - - - -
-Apache Foundation - -Xalan Project - -Xerces Project - -Web Consortium - -Oasis Open -
-
- -
-

Questions

-
    -
  1. -Where do I go to learn about XSLT -
  2. -
  3. -Asking questions about Xalan-C++ -
  4. -
  5. -What is Xerces-C++? -
  6. -
  7. -Which version of Xerces should I be using? -
  8. -
  9. -Should I be using the Xerces DOM or Xalan DOM? -
  10. -
  11. -Problems with samples in Windows -
  12. -
  13. -Building on Windows -
  14. -
  15. -Building on UNIX -
  16. -
  17. -Make errors on UNIX platforms -
  18. -
  19. -What is ICU -
  20. -
  21. -A tar checksum error on Solaris -
  22. -
  23. -Xalan-C++ in Apache -
  24. -
  25. -Is Xalan-C++ thread-safe? -
  26. -
  27. -What can I do to speed up transformations? -
  28. -
  29. -Stylesheet validation -
  30. -
  31. -What does the XalanDOMException HIERARCHY_REQUEST_ERR mean? -
  32. -
  33. -Submitting Patches -
  34. -
  35. -Transformation Output Methods -
  36. -
  37. -Problems Using Sun's Forte/Workshop Compiler with code containing std::istrstream -
  38. -
  39. -Modifying an instance of XalanDocument -
  40. -
  41. -Changing Where Error Output is Sent -
  42. -
  43. -Programmatic Error Information -
  44. -
  45. -String Transcoding -
  46. -
  47. -Error Code/Exception Summary -
  48. -
  49. -Extension Functions -
  50. -
  51. -Outputting results to a file on Windows 95/98 -
  52. -
  53. -Using format-number and ICU -
  54. -
  55. -Perl wrapper for Xalan-C++? -
  56. -
  57. -Missing LocalMsgIndex.hpp file -
  58. -
-

Answers

-

1. Where do I go to learn about XSLT

-
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 a brief listing of tutorials, discussion forums, and other materials, see Getting up to speed with XSLT.

-
-

-(top) -

-

2. Asking questions about Xalan-C++

-
Where can I ask a question?
-
-
-
-

For specific questions on Xalan-C++, see list archives: - xalan-c-users - and xalan-dev. - You must subscribe to these Apache mailing lists before posting your questions.

-

The Apache Software Foundation has information on how you can subscribe to - the mailing lists.

-

You can post messages to the lists by sending mail to:
- Post message to xalan-c-users. (User's list)
- Post message to xalan-dev list. (Developer's list)

-

Again, please review the archives before posting a new question.

-
-

-(top) -

-

3. What is Xerces-C++?

-
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://xerces.apache.org -

-
-

-(top) -

-

4. Which version of Xerces should I be using?

-
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 -

-
-

-(top) -

-

5. Should I be using the Xerces DOM or Xalan DOM?

-
Should I be using the Xerces DOM or Xalan DOM?
-
-
-
-

The Xalan DOM implementation is highly optimised for transformations. However, whilst you can build documents in the Xalan DOM, - subsequent modification will not work. The Xalan DOM is designed to be either an input or an output from a transformation, not - as a general DOM implementation.

-

So in cases where you want to simply transform documents using Xalan, using the internal DOM implementation is the best approach.

-

In cases where you want to modify the DOM document on the fly, you should use the Xerces DOM as the base document. You can wrap - the Xerces DOM in a wrapper (see passing in a Xerces DOM) - to then use as an input to a Xalan transformation. Alternatively you can output the result of a transformation to a Xerces DOM - document (see working with DOM input and output). In either case, the Xerces document - can be freely modified. However, after you modify the document, you need to re-build the wrapper so that any changes are replicated - in the Xalan wrappers.

-
-

-(top) -

-

6. Problems with samples in Windows

-
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. -
  3. Click the C/C++ tab.
    -
    -
  4. -
  5. In the Category drop-down list, select Code Generation.
    -
    -
  6. -
  7. 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.
  8. -
-

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

-
-

-(top) -

-

7. Building on Windows

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

In order to build Xalan-C++ on Windows, you will need the following:

-
    -
  • The Xalan-C/C++ source distribution package.
  • -
  • The Xerces-C/C++ source distribution package or a compatible binary distribution package.
  • -
  • A compatible Microsoft Visual Studio .NET (2003, 2005, 2008, 2010) software development platform.
  • -
-

The Xalan-C/C++ Version 1.11 (pre-release) is available from the Apache Subversion - repository at http://svn.apache.org/repos/asf/xalan/c/trunk/. -

-

After Xalan-C/C++ Version 1.11 is released, it can be downloaded from: - Xalan Distributions.

-

The Xerces-C/C++ Version 3.1.1 is can be downloaded from: - Xerces Distributions.

-

If you are building with the - IBM-ICU - International Components for Unicode library, you will - need to rebuild both the Xerces and Xalan libraries.

-

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

-
-

-(top) -

-

8. Building on UNIX

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

To build Xalan-C++ on supported UNIX platforms, you need Xerces-C++, the GNU make utility, and a supported C++ compiler. For more - details see: Steps for doing a UNIX build.

-
-

-(top) -

-

9. Make errors on UNIX platforms

-
I get errors in the Makefile when running the make utility. What's wrong?
-
-
-
-

You must use the GNU make utility. Other make utilities may not work with the Xalan Makefile

-
-

-(top) -

-

10. What is ICU

-
What is ICU and why do I need it?
-
-
-
-

The IBM-ICU - 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/icu/index.html.

-

Xalan release 1.10 was tested with International Components for Unicode(ICU) version 3.2. The curent Xalan - release 1.11 is not fully tested with IBM-ICU.

-

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

- -
-

-(top) -

-

11. A tar checksum error on Solaris

-
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.

-
-

-(top) -

-

12. Xalan-C++ in Apache

-
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.

-
-

-(top) -

-

13. Is Xalan-C++ thread-safe?

-
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.

-
-

-(top) -

-

14. What can I do to speed up transformations?

-
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.
      -
      -
    • -
    -
-
-

-(top) -

-

15. Stylesheet validation

-
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.

-
-

-(top) -

-

16. What does the XalanDOMException HIERARCHY_REQUEST_ERR mean?

-
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.

-
-

-(top) -

-

17. Submitting Patches

-
Who do I submit patches to?
-
-
-
-

Your contributions are much appreciated! You can e-mail your patches to - Xalan Development Mailing List or raise an issue on the - Jira issue tracking system.

-

The Xalan projects use Jira as the issue tracking system. Any significant bug or feature request is - posted to this system. You must subscribe to the system in order to submit patches and raise - issues.

- -

Issues posted to the project on Jira at XALANC are automatically posted to the - Xalan Development Mailing List -

-

Our mailing lists are moderated. You should subscribe to the mailing list in order to - post a message, otherwise message delivery requires manual intervention or may be dropped.

-
-

-(top) -

-

18. Transformation Output Methods

-
How do I output a transformation to a DOM, a file, an in-memory buffer, or as input to another transformation? Since the C++ - language can automatically construct an XSLTResultTarget from any of its constructor's argument types, you usually don't need - to create one explicitly.
-
-
-
-

The output parameter of XalanTransformer::transform() is an XSLTResultTarget which has many constructors.

-

Output to a file:

-
    -
  • The easiest way is to use a null-terminated string containing the file name to create an XSLTResultTarget. Or, use an - instance of std::ofstream. The command line executables, and many of the sample applications use file names, so take a - look through the source code for more information.
  • -
-

Output to an in-memory buffer:

-
    -
  • Use an instance of std::ostrstream or std::ostringstream to create an XSLTResultTarget. See the StreamTransform sample - for more information.
  • -
-

Input to another transformation:

-
    -
  • Any of the previous output targets could be used as the input to another transformation, but the FormatterToSourceTree - is probably the best for efficiency reasons. See the source code for the TestXSLT command line program for more - information.
  • -
-
-

-(top) -

-

19. Problems Using Sun's Forte/Workshop Compiler with code containing std::istrstream

-
Why won't XSLTInputSource work with std::istrstream on Sun Solaris using Forte/Sun Workshop compiler?
-
-
-
-

There is a bug in Sun's C++ standard library implementation - for the Forte/Workshop compiler. - The short answer is that you need to get a patch. - The bugzilla subsystem for Xalan issue tracking is no longer available. The ticket recorded - here included a patch.

-
-
-
-
-

The issue is resolved if you use the SunStudio platform for your code development. - The Solaris SunStudio is now available from Oracle.

-
-

-(top) -

-

20. Modifying an instance of XalanDocument

-
My transformation outputs to a XalanDocument (actually XalanSourceTreeDocument underneath) but W3C DOM functions like - DOMElement::setAttribute don't work! Am I going crazy or what?
-
-
-
-

No, you aren't going crazy. Xalan's default source tree is read-only for efficiency. If you need a DOM that supports - modifications, use the Xerces DOM instead. See the TransformToXercesDOM sample for more information.

-
-

-(top) -

-

21. Changing Where Error Output is Sent

-
XalanTransformer outputs errors to the console. How do I, for example, output error to a file?
-
-
-
-

By default, XalanTransformer creates a XalanTransformerProblemListener (a subclass of ProblemListener) that writes - output to std::cerr. To change this you can:

-
    -
  • Redirect std::cerr from the command line.
  • -
  • Call XalanTranformer::setWarningStream with a different std::ostream before calling XalanTransformer::transform.
  • -
  • Instantiate your own XalanTransformerProblemListener with a different output stream and call - XalanTransformer::setProblemListener() before calling XalanTransformer::transform().
  • -
  • Subclass some ProblemListener type and do custom handling of errors (you still then need to tell XalanTransformer - instances to use your ProblemListener.)
  • -
-

In most case you probably want to do one of the first two.

-
-

-(top) -

-

22. Programmatic Error Information

-
How do I programmatically get the file name, line number, and column number for an error in an XML file?
-
-
-
-

Create a custom ErrorHandler (a Xerces-C++ class) and call XalanTransformer::setErrorHandler before parsing any sources.

-
-

-(top) -

-

23. String Transcoding

-
How do I make a char* out of XalanDOMString (or vice-versa)?
-
-
-
-

See the static method XalanDOMString::transcode, or the functions TranscodeToLocalCodePage in the API documentation. - However, you should be very careful when transcoding Unicode characters to the local code page, because not all Unicode - characters can be represented.

-
-

-(top) -

-

24. Error Code/Exception Summary

-
Is there a table of error codes somewhere? How about a summary of what methods throw which exceptions?
-
-
-
-

There isn't, but we're working on it.

-
-

-(top) -

-

25. Extension Functions

-
The Xalan extension functions (xalan:node-set, etc.) don't work for me. Help!
-
-
-
-

Did you declare the namespace on the xsl:stylesheet or xsl:transform element? It should look like this:

-

<xsl:stylesheet version="1.0" xmlns:xalan="http://xml.apache.org/xalan"> ...rest of stylesheet

-

If you did and you still have problems, you might want to ask the mailing list.

-
-

-(top) -

-

26. Outputting results to a file on Windows 95/98

-
Why can't I ouput my results to a file on Windows 95/98?
-
-
-
-

Well, you can, but it doesn't always work. Neither Windows 95 or 98 are supported or tested. There have been reports of - problems on it, especially regarding Unicode support. See - this post.

-
-

-(top) -

-

27. Using format-number and ICU

-
Why does Xalan emit a warning when using the XSLT function format-number()?
-
-
-
-

Did you build with ICU support? See Using the International Components for - Unicode (ICU).

-
-

-(top) -

-

28. Perl wrapper for Xalan-C++?

-
Is there a Perl wrapper for Xalan-C++?
-
-
-
-

There is no Apache Perl wrapper, however Edwin Pratomo has written a wrapper for Xalan-C++ version 1.4 that can be found - on CPAN

-
-

-(top) -

-

29. Missing LocalMsgIndex.hpp file

-
Why can't I find the LocalMsgIndex.hpp file?
-
-
-
-

The LocalMsgIndex.hpp file is not shipped with the distributions because this file is generated during compile time. This - file is created at the start of the build process and customized for the locale and message set you are using.

-

On Windows, the LocalMsgIndex.hpp header is generated by the Localization project. By building any project that has a - dependency on the Localization project, will trigger the Message Localization component to built and the LocalMsgIndex.hpp - to be generated.

-

On Windows binary distributions, the LocalMsgIndex.hpp file is a member of the "Include" directory.

-

On Unix binary distributions, the LocalMsgIndex.hpp file is a member of the "include/xalanc/PlatformSupport" directory.

-
-

-(top) -

-
- - - + + + + +ASF: Frequently asked questions + + + + + + +
+ + + + + + + + + + +
+ +Trademark Logo + + +Xalan-C/C++ Version 1.11 +
Frequently asked questions
+ + + + + + + + + + +
+Apache Foundation + +Xalan Project + +Xerces Project + +Web Consortium + +Oasis Open +
+
+ +
+

Questions

+
    +
  1. +Where do I go to learn about XSLT +
  2. +
  3. +Asking questions about Xalan-C++ +
  4. +
  5. +What is Xerces-C++? +
  6. +
  7. +Which version of Xerces should I be using? +
  8. +
  9. +Should I be using the Xerces DOM or Xalan DOM? +
  10. +
  11. +Problems with samples in Windows +
  12. +
  13. +Building on Windows +
  14. +
  15. +Building on UNIX +
  16. +
  17. +Make errors on UNIX platforms +
  18. +
  19. +What is ICU +
  20. +
  21. +A tar checksum error on Solaris +
  22. +
  23. +Xalan-C++ in Apache +
  24. +
  25. +Is Xalan-C++ thread-safe? +
  26. +
  27. +What can I do to speed up transformations? +
  28. +
  29. +Stylesheet validation +
  30. +
  31. +What does the XalanDOMException HIERARCHY_REQUEST_ERR mean? +
  32. +
  33. +Submitting Patches +
  34. +
  35. +Transformation Output Methods +
  36. +
  37. +Problems Using Sun's Forte/Workshop Compiler with code containing std::istrstream +
  38. +
  39. +Modifying an instance of XalanDocument +
  40. +
  41. +Changing Where Error Output is Sent +
  42. +
  43. +Programmatic Error Information +
  44. +
  45. +String Transcoding +
  46. +
  47. +Error Code/Exception Summary +
  48. +
  49. +Extension Functions +
  50. +
  51. +Outputting results to a file on Windows 95/98 +
  52. +
  53. +Using format-number and ICU +
  54. +
  55. +Perl wrapper for Xalan-C++? +
  56. +
  57. +Missing LocalMsgIndex.hpp file +
  58. +
+

Answers

+

1. Where do I go to learn about XSLT

+
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 a brief listing of tutorials, discussion forums, and other materials, see Getting up to speed with XSLT.

+
+

+(top) +

+

2. Asking questions about Xalan-C++

+
Where can I ask a question?
+
+
+
+

For specific questions on Xalan-C++, see list archives: + xalan-c-users + and xalan-dev. + You must subscribe to these Apache mailing lists before posting your questions.

+

The Apache Software Foundation has information on how you can subscribe to + the mailing lists.

+

You can post messages to the lists by sending mail to:
+ Post message to xalan-c-users. (User's list)
+ Post message to xalan-dev list. (Developer's list)

+

Again, please review the archives before posting a new question.

+
+

+(top) +

+

3. What is Xerces-C++?

+
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://xerces.apache.org +

+
+

+(top) +

+

4. Which version of Xerces should I be using?

+
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 +

+
+

+(top) +

+

5. Should I be using the Xerces DOM or Xalan DOM?

+
Should I be using the Xerces DOM or Xalan DOM?
+
+
+
+

The Xalan DOM implementation is highly optimised for transformations. However, whilst you can build documents in the Xalan DOM, + subsequent modification will not work. The Xalan DOM is designed to be either an input or an output from a transformation, not + as a general DOM implementation.

+

So in cases where you want to simply transform documents using Xalan, using the internal DOM implementation is the best approach.

+

In cases where you want to modify the DOM document on the fly, you should use the Xerces DOM as the base document. You can wrap + the Xerces DOM in a wrapper (see passing in a Xerces DOM) + to then use as an input to a Xalan transformation. Alternatively you can output the result of a transformation to a Xerces DOM + document (see working with DOM input and output). In either case, the Xerces document + can be freely modified. However, after you modify the document, you need to re-build the wrapper so that any changes are replicated + in the Xalan wrappers.

+
+

+(top) +

+

6. Problems with samples in Windows

+
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. +
  3. Click the C/C++ tab.
    +
    +
  4. +
  5. In the Category drop-down list, select Code Generation.
    +
    +
  6. +
  7. 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.
  8. +
+

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

+
+

+(top) +

+

7. Building on Windows

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

In order to build Xalan-C++ on Windows, you will need the following:

+
    +
  • The Xalan-C/C++ source distribution package.
  • +
  • The Xerces-C/C++ source distribution package or a compatible binary distribution package.
  • +
  • A compatible Microsoft Visual Studio .NET (2003, 2005, 2008, 2010) software development platform.
  • +
+

The Xalan-C/C++ Version 1.11 (pre-release) is available from the Apache Subversion + repository at http://svn.apache.org/repos/asf/xalan/c/trunk/. +

+

After Xalan-C/C++ Version 1.11 is released, it can be downloaded from: + Xalan Distributions.

+

The Xerces-C/C++ Version 3.1.1 is can be downloaded from: + Xerces Distributions.

+

If you are building with the + IBM-ICU + International Components for Unicode library, you will + need to rebuild both the Xerces and Xalan libraries.

+

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

+
+

+(top) +

+

8. Building on UNIX

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

To build Xalan-C++ on supported UNIX platforms, you need Xerces-C++, the GNU make utility, and a supported C++ compiler. For more + details see: Steps for doing a UNIX build.

+
+

+(top) +

+

9. Make errors on UNIX platforms

+
I get errors in the Makefile when running the make utility. What's wrong?
+
+
+
+

You must use the GNU make utility. Other make utilities may not work with the Xalan Makefile

+
+

+(top) +

+

10. What is ICU

+
What is ICU and why do I need it?
+
+
+
+

The IBM-ICU + 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/icu/index.html.

+

Xalan release 1.10 was tested with International Components for Unicode(ICU) version 3.2. The curent Xalan + release 1.11 is not fully tested with IBM-ICU.

+

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

+ +
+

+(top) +

+

11. A tar checksum error on Solaris

+
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.

+
+

+(top) +

+

12. Xalan-C++ in Apache

+
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.

+
+

+(top) +

+

13. Is Xalan-C++ thread-safe?

+
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.

+
+

+(top) +

+

14. What can I do to speed up transformations?

+
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.
      +
      +
    • +
    +
+
+

+(top) +

+

15. Stylesheet validation

+
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.

+
+

+(top) +

+

16. What does the XalanDOMException HIERARCHY_REQUEST_ERR mean?

+
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.

+
+

+(top) +

+

17. Submitting Patches

+
Who do I submit patches to?
+
+
+
+

Your contributions are much appreciated! You can e-mail your patches to + Xalan Development Mailing List or raise an issue on the + Jira issue tracking system.

+

The Xalan projects use Jira as the issue tracking system. Any significant bug or feature request is + posted to this system. You must subscribe to the system in order to submit patches and raise + issues.

+ +

Issues posted to the project on Jira at XALANC are automatically posted to the + Xalan Development Mailing List +

+

Our mailing lists are moderated. You should subscribe to the mailing list in order to + post a message, otherwise message delivery requires manual intervention or may be dropped.

+
+

+(top) +

+

18. Transformation Output Methods

+
How do I output a transformation to a DOM, a file, an in-memory buffer, or as input to another transformation? Since the C++ + language can automatically construct an XSLTResultTarget from any of its constructor's argument types, you usually don't need + to create one explicitly.
+
+
+
+

The output parameter of XalanTransformer::transform() is an XSLTResultTarget which has many constructors.

+

Output to a file:

+
    +
  • The easiest way is to use a null-terminated string containing the file name to create an XSLTResultTarget. Or, use an + instance of std::ofstream. The command line executables, and many of the sample applications use file names, so take a + look through the source code for more information.
  • +
+

Output to an in-memory buffer:

+
    +
  • Use an instance of std::ostrstream or std::ostringstream to create an XSLTResultTarget. See the StreamTransform sample + for more information.
  • +
+

Input to another transformation:

+
    +
  • Any of the previous output targets could be used as the input to another transformation, but the FormatterToSourceTree + is probably the best for efficiency reasons. See the source code for the TestXSLT command line program for more + information.
  • +
+
+

+(top) +

+

19. Problems Using Sun's Forte/Workshop Compiler with code containing std::istrstream

+
Why won't XSLTInputSource work with std::istrstream on Sun Solaris using Forte/Sun Workshop compiler?
+
+
+
+

There is a bug in Sun's C++ standard library implementation + for the Forte/Workshop compiler. + The short answer is that you need to get a patch. + The bugzilla subsystem for Xalan issue tracking is no longer available. The ticket recorded + here included a patch.

+
+
+
+
+

The issue is resolved if you use the SunStudio platform for your code development. + The Solaris SunStudio is now available from Oracle.

+
+

+(top) +

+

20. Modifying an instance of XalanDocument

+
My transformation outputs to a XalanDocument (actually XalanSourceTreeDocument underneath) but W3C DOM functions like + DOMElement::setAttribute don't work! Am I going crazy or what?
+
+
+
+

No, you aren't going crazy. Xalan's default source tree is read-only for efficiency. If you need a DOM that supports + modifications, use the Xerces DOM instead. See the TransformToXercesDOM sample for more information.

+
+

+(top) +

+

21. Changing Where Error Output is Sent

+
XalanTransformer outputs errors to the console. How do I, for example, output error to a file?
+
+
+
+

By default, XalanTransformer creates a XalanTransformerProblemListener (a subclass of ProblemListener) that writes + output to std::cerr. To change this you can:

+
    +
  • Redirect std::cerr from the command line.
  • +
  • Call XalanTranformer::setWarningStream with a different std::ostream before calling XalanTransformer::transform.
  • +
  • Instantiate your own XalanTransformerProblemListener with a different output stream and call + XalanTransformer::setProblemListener() before calling XalanTransformer::transform().
  • +
  • Subclass some ProblemListener type and do custom handling of errors (you still then need to tell XalanTransformer + instances to use your ProblemListener.)
  • +
+

In most case you probably want to do one of the first two.

+
+

+(top) +

+

22. Programmatic Error Information

+
How do I programmatically get the file name, line number, and column number for an error in an XML file?
+
+
+
+

Create a custom ErrorHandler (a Xerces-C++ class) and call XalanTransformer::setErrorHandler before parsing any sources.

+
+

+(top) +

+

23. String Transcoding

+
How do I make a char* out of XalanDOMString (or vice-versa)?
+
+
+
+

See the static method XalanDOMString::transcode, or the functions TranscodeToLocalCodePage in the API documentation. + However, you should be very careful when transcoding Unicode characters to the local code page, because not all Unicode + characters can be represented.

+
+

+(top) +

+

24. Error Code/Exception Summary

+
Is there a table of error codes somewhere? How about a summary of what methods throw which exceptions?
+
+
+
+

There isn't, but we're working on it.

+
+

+(top) +

+

25. Extension Functions

+
The Xalan extension functions (xalan:node-set, etc.) don't work for me. Help!
+
+
+
+

Did you declare the namespace on the xsl:stylesheet or xsl:transform element? It should look like this:

+

<xsl:stylesheet version="1.0" xmlns:xalan="http://xml.apache.org/xalan"> ...rest of stylesheet

+

If you did and you still have problems, you might want to ask the mailing list.

+
+

+(top) +

+

26. Outputting results to a file on Windows 95/98

+
Why can't I ouput my results to a file on Windows 95/98?
+
+
+
+

Well, you can, but it doesn't always work. Neither Windows 95 or 98 are supported or tested. There have been reports of + problems on it, especially regarding Unicode support. See + this post.

+
+

+(top) +

+

27. Using format-number and ICU

+
Why does Xalan emit a warning when using the XSLT function format-number()?
+
+
+
+

Did you build with ICU support? See Using the International Components for + Unicode (ICU).

+
+

+(top) +

+

28. Perl wrapper for Xalan-C++?

+
Is there a Perl wrapper for Xalan-C++?
+
+
+
+

There is no Apache Perl wrapper, however Edwin Pratomo has written a wrapper for Xalan-C++ version 1.4 that can be found + on CPAN

+
+

+(top) +

+

29. Missing LocalMsgIndex.hpp file

+
Why can't I find the LocalMsgIndex.hpp file?
+
+
+
+

The LocalMsgIndex.hpp file is not shipped with the distributions because this file is generated during compile time. This + file is created at the start of the build process and customized for the locale and message set you are using.

+

On Windows, the LocalMsgIndex.hpp header is generated by the Localization project. By building any project that has a + dependency on the Localization project, will trigger the Message Localization component to built and the LocalMsgIndex.hpp + to be generated.

+

On Windows binary distributions, the LocalMsgIndex.hpp file is a member of the "Include" directory.

+

On Unix binary distributions, the LocalMsgIndex.hpp file is a member of the "include/xalanc/PlatformSupport" directory.

+
+

+(top) +

+
+ + + --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@xalan.apache.org For additional commands, e-mail: commits-help@xalan.apache.org