You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Steve Hathaway <sh...@e-z.net> on 2012/06/07 08:06:38 UTC
XALANC: Error Handling in XPath Functions
Error Handling in XPath Functions - brief architecture description
The Xalan/XPath standard library error messages for "en_US" are
found in file:
(src)/xalanc/NLS/en_US/XalanMsg_en_US.xlf
The messages in xliff format use 0-3 parameter substitutions.
The xlif file is processed by the MsgCreator program to create header files.
nls/include/LocalMsgData.hpp and
nls/include/localMsgIndex.hpp
Which are also used to build the message library shared objects
for Windows
bin/XalanMessages_1_11.dll and
bin/XalanMessages_1_11D.dll
for Unix/Linux
bin/libxalanMsg.so.111.0
bin/libxalanMsg.so.111 -> libxalanMsg.so.111.0
bin/libxalanMsg.so -> libxalanMsg.so.111.0
Standard message reporting uses the following method to create
XalanDOMString messages from a message index and 0-3 parameters.
const XalanDOMString& XalanMessageLoader::getMessage(
XalanDOMString& theResult,
XalanMessages::{the string identifier}, // See the xliff file
"Parameter {0}",
"Parameter {1}",
"Parameter {2}");
We can add new messages to the library for Date, DateTime, Duration,
and other specific string formatted validations.
Index: "InvalidDateTime_3Param"
Text: "Function '{0}' parameter '{1}' has bad DateTime format '{2}'"
Index: "InvalidDate_3Param"
Text: "Function '{0}' parameter '{1}' has bad Date format '{2}'"
Index: "InvalidTime_3Param"
Text: "Function '{0}' parameter '{1}' has bad Time format '{2}'"
Index: "InvalidDuration_3Param"
Text: "Function '{0}' parameter '{1} has bad Duration format '{2}'"
where '{0}' = name of the XPath function
where '{1}' = number of the XPath function parameter
where '{2}' = string value of the error
There are several methods, depending upon severity of error, that can
be used to register messages to the XPath interpreter and Stylesheet
Transformer processes.
Sincerely,
Steven J. Hathaway
Xalan Documentation Project
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org