camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raul Kripalani (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-4852) Extra logging when evaluating XPath expressions to help address namespace issues
Date Tue, 03 Jan 2012 12:10:39 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-4852?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Raul Kripalani updated CAMEL-4852:
----------------------------------

    Description: 
Create a new option {{traceNamespaces}} which audits/analyses/extracts all namespaces present
in the incoming message and logs them out, in order to help detect potential issues with namespace
referencing in XPath expressions.

Since JAXP doesn't provide any mechanism to discover namespaces, this behaviour should be
implemented with an XPath query.
To be used only in development mode, as the entire XML document will be traversed in order
to discover the [prefix -> namespace URI/URL] pairs.

The default namespace should be discovered and output too.

For each message, if the traceNamespaces option is active, Camel should dump a line similar
to the following:
E.g.: {xmlns:nsb=[http://namespaceb.net], xmlns:nsa=[http://namespacec.net, http://namespacea.net],
DEFAULT=[http://defaultNamespace.net]} 

If a prefix is declared multiple times, two things can happen:
* The prefix is always bound to the same namespace
* The prefix is bound to different namespaces in different parts of the XML document

In the first case, the duplicate should be eliminated in the log line. In the second case,
the prefix should appear bound to all unique namespaces (see prefix nsa in the above example).

Additionally, when a new XPath expression / predicate is initialised, Camel should dump the
NamespaceContext of the expression, so that the user can then compare the namespaces known
by the expression against the namespaces that exist in the incoming message.
    
> Extra logging when evaluating XPath expressions to help address namespace issues
> --------------------------------------------------------------------------------
>
>                 Key: CAMEL-4852
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4852
>             Project: Camel
>          Issue Type: Sub-task
>          Components: camel-core, camel-spring
>            Reporter: Raul Kripalani
>             Fix For: 2.10
>
>
> Create a new option {{traceNamespaces}} which audits/analyses/extracts all namespaces
present in the incoming message and logs them out, in order to help detect potential issues
with namespace referencing in XPath expressions.
> Since JAXP doesn't provide any mechanism to discover namespaces, this behaviour should
be implemented with an XPath query.
> To be used only in development mode, as the entire XML document will be traversed in
order to discover the [prefix -> namespace URI/URL] pairs.
> The default namespace should be discovered and output too.
> For each message, if the traceNamespaces option is active, Camel should dump a line similar
to the following:
> E.g.: {xmlns:nsb=[http://namespaceb.net], xmlns:nsa=[http://namespacec.net, http://namespacea.net],
DEFAULT=[http://defaultNamespace.net]} 
> If a prefix is declared multiple times, two things can happen:
> * The prefix is always bound to the same namespace
> * The prefix is bound to different namespaces in different parts of the XML document
> In the first case, the duplicate should be eliminated in the log line. In the second
case, the prefix should appear bound to all unique namespaces (see prefix nsa in the above
example).
> Additionally, when a new XPath expression / predicate is initialised, Camel should dump
the NamespaceContext of the expression, so that the user can then compare the namespaces known
by the expression against the namespaces that exist in the incoming message.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message