Exemplo n.º 1
0
########################################################################
# $Header: /var/local/cvsroot/4Suite/Ft/Xml/XPointer/MessageSource.py,v 1.3 2004/01/26 07:40:21 jkloth Exp $
"""
XPointer error codes and messages

Copyright 2003 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/
"""

from Ft import TranslateMessage as _
from Ft.Xml.XPointer import XPtrException

g_errorMessages = {
    XPtrException.INTERNAL_ERROR : _('There is an internal bug in 4Suite. '
        'Please make a post to the 4Suite mailing list to report this error '
        'message to the developers. Include platform details and info about '
        'how to reproduce the error. Info about the mailing list is at '
        'http://lists.fourthought.com/mailman/listinfo/4suite. '
        'The error code to report is: %s'),
    XPtrException.SYNTAX_ERROR : _("Syntax error in XPointer expression: %s"),
    XPtrException.RESOURCE_ERROR : _("Invalid resource, or not well-formed XML: %s"),
    XPtrException.SUB_RESOURCE_ERROR : _("Expression does not locate a resource"),
    }
Exemplo n.º 2
0
########################################################################
# $Header: /var/local/cvsroot/4Suite/Ft/Xml/MessageSource.py,v 1.13 2006/02/04 00:06:36 jkloth Exp $
"""
Localizable message strings

Copyright 2005 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/
"""

from Ft import TranslateMessage as _
from Ft.Xml import ReaderException, XIncludeException

XINCLUDE = {
    XIncludeException.MISSING_HREF : _('Missing or empty href attribute'),
    XIncludeException.INVALID_PARSE_ATTR : _(
    'Invalid value %r for parse attribute'),
    XIncludeException.TEXT_XPOINTER : _(
    'xpointer attribute forbidden for parse="text"'),
    XIncludeException.FRAGMENT_IDENTIFIER : _(
    'Fragment identifier not allowed in URI %r; use the xpointer attribute'),
    XIncludeException.UNSUPPORTED_XPOINTER : _(
    'Unsupported XPointer %r'),
    XIncludeException.INCLUDE_IN_INCLUDE :_(
    'xi:include has an xi:include child'),
    XIncludeException.FALLBACK_NOT_IN_INCLUDE : _(
    'xi:fallback is not the child of an xi:include'),
    XIncludeException.MULTIPLE_FALLBACKS : _(
    'xi:include with multiple xi:fallback children'),
    }
Exemplo n.º 3
0
    SYNTAX_ERROR = 1
    UNRECOGNIZED_INSTRUCTION = 2
    NO_VERSION = 10
    NO_SELECT = 11
    NO_TEST = 12
    INVALID_SELECT = 13
    UNSUPPORTED_VERSION = 14
    INVALID_DOM_NODE = 100
    UNKNOWN_NODE_TYPE = 101

    def __init__(self, errorCode, *args, **kwargs):
        FtException.__init__(self, errorCode, g_errorMessages, args, **kwargs)


g_errorMessages = {
    XUpdateException.SYNTAX_ERROR: _('Syntax error in expression %(expr)r: %(err)s'),
    XUpdateException.UNRECOGNIZED_INSTRUCTION: _('Unrecognized instruction in XUpdate namespace: %(name)r'),
    XUpdateException.NO_VERSION: _('Missing required version attribute'),
    XUpdateException.NO_SELECT: _('Missing required select attribute'),
    XUpdateException.NO_TEST: _('Missing required "test" attribute'),
    XUpdateException.INVALID_SELECT: _('select expression "%(expr)s" must evaluate to a non-empty node-set'),
    XUpdateException.UNSUPPORTED_VERSION: _('XUpdate version %(version)s unsupported by this implementation'),
    XUpdateException.INVALID_DOM_NODE: _('Invalid DOM node %(node)r'),
    XUpdateException.UNKNOWN_NODE_TYPE: _('Unknown node type %(nodetype)r'),
    }

SUPPORTED_VERSIONS = ('1.0',)

class StringWriter(NullWriter.NullWriter):
    def __init__(self):
        self._result = []
Exemplo n.º 4
0
Copyright 2004 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/
"""

from Ft import TranslateMessage as _
from Ft.Lib import UriException

# %r preferred for reporting URIs because the URI refs can be empty
# strings or, if invalid, could contain characters unsafe for the error
# message stream.
#
URI = {
    UriException.INVALID_BASE_URI:
        _("Invalid base URI: %(base)r cannot be used to resolve reference %(ref)r"),
    UriException.RELATIVE_BASE_URI:
        _("Invalid base URI: %(base)r cannot be used to resolve reference %(ref)r;"
          " the base URI must be absolute, not relative."),
    UriException.NON_FILE_URI:
        _("Only a 'file' URI can be converted to an OS-specific path; URI given was %r"),
    UriException.UNIX_REMOTE_HOST_FILE_URI:
        _("A URI containing a remote host name cannot be converted to a path on posix;"
          " URI given was %r"),
    UriException.RESOURCE_ERROR:
        _("Error retrieving resource %(loc)r: %(msg)s"),
    UriException.UNSUPPORTED_PLATFORM:
        _("Platform %r not supported by URI function %s"),
    UriException.SCHEME_REQUIRED:
        _("Scheme-based resolution requires a URI with a scheme; "
          "neither the base URI %(base)r nor the reference %(ref)r have one."),
Exemplo n.º 5
0
########################################################################
# $Header: /var/local/cvsroot/4Suite/Ft/Xml/Xslt/MessageSource.py,v 1.37 2005/04/03 06:47:13 jkloth Exp $
"""
XSLT error codes and messages

Copyright 2003 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/
"""

from Ft import TranslateMessage as _

POSITION_INFO = _('In stylesheet %s, line %s, column %s:\n%s')

EXPRESSION_POSITION_INFO = _('In stylesheet %s, line %s, column %s in "%s":\n'
                             '%s')

XSLT_EXPRESSION_POSITION_INFO = _('%s\n'
                                  'The error occurred in the expression "%s".')

BUILTIN_TEMPLATE_WITH_PARAMS = _('Built-in template invoked with params that '
                                 'will be ignored. This message will only '
                                 'appear once per transform.')

TEMPLATE_CONFLICT_LOCATION = _('In stylesheet %s, line %s, column %s, pattern %s')

# for xsl:message output
DEFAULT_MESSAGE_PREFIX = _('STYLESHEET MESSAGE:\n')
DEFAULT_MESSAGE_SUFFIX = _('\nEND STYLESHEET MESSAGE\n')

class Error:
Exemplo n.º 6
0
Copyright 2003 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/
"""

from Ft import TranslateMessage as _

from Ft.Xml.XPath import CompiletimeException, RuntimeException

# messages for expression compile-time errors
ERROR_COMPILETIME = {
    # internal/unexpected errors
    CompiletimeException.INTERNAL: _('There is an internal bug in 4XPath. '
        'Please make a post to the 4Suite mailing list to report this error '
        'message to the developers. Include platform details and info about '
        'how to reproduce the error. Info about the mailing list is at '
        'http://lists.fourthought.com/mailman/listinfo/4suite. '
        'The error code to report is: %s'),
    # other compile-time errors
    CompiletimeException.SYNTAX: _('XPath expression syntax error at line %d, column %d: %s'),
}


# messages for expression evaluation (run-time) errors
ERROR_RUNTIME = {
    # internal/unexpected errors
    RuntimeException.INTERNAL: _('There is an internal bug in 4XPath. '
        'Please make a post to the 4Suite mailing list to report this error '
        'message to the developers. Include platform details and info about '
        'how to reproduce the error. Info about the mailing list is at '
        'http://lists.fourthought.com/mailman/listinfo/4suite. '
Exemplo n.º 7
0
from Ft import TranslateMessage as _

# this works around a circular import
from Ft.Xml.Xslt.MessageSource import g_errorMessages

class Error:

    UNSUPPORTED_DOCUMENT_URI_SCHEME = 3000
    ABORTED_EXSLDOCUMENT_OVERWRITE = 3010
    NO_EXSLTDOCUMENT_BASE_URI = 3020

    ILLEGAL_DURATION_FORMAT = 3100

    RESULT_NOT_IN_FUNCTION = 3200
    ILLEGAL_RESULT_SIBLINGS = 3201


g_exsltErrorMessages = {
    Error.UNSUPPORTED_DOCUMENT_URI_SCHEME: _('4Suite\'s implementation of exsl:document only supports an href value having the "file" URI scheme, which may be implicit. Scheme "%s" was found.'),
    Error.ABORTED_EXSLDOCUMENT_OVERWRITE: _('An attempt was made to write to %s, which already exists.  The attempt to save the contents of this file to %s also failed, and so the instruction has been aborted.  If you are sure it is OK to overwrite this file, please indicate this by adding the f:overwrite-okay attribute to the exsl:document instruction.'),
    Error.NO_EXSLTDOCUMENT_BASE_URI: _('An `exsl:document` element referred to a relative reference "%s", but there is no explicit output document to provide a base URI in order to resolve this relative reference.'),
    Error.ILLEGAL_DURATION_FORMAT: _('Duration string "%s" not in xs:duration format.'),
    Error.RESULT_NOT_IN_FUNCTION: _('An EXSLT func:result element must occur within a func:function element.'),
    Error.ILLEGAL_RESULT_SIBLINGS: _('An EXSLT func:result element must not have following sibling elements besides xsl:fallback.'),
}

g_errorMessages.update(g_exsltErrorMessages)