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

Rich Newcomb updated CAMEL-5826:
--------------------------------

    Attachment: CAMEL-5826.patch

The attached patch provides a solution for the issue that was reported on this 
ticket.  The XML Tokenizer was not parsing nodes that have namespace prefixes.  
This was true for the "inherit namespaces" node as well as all 
explicitly-prefixed nodes that would otherwise match a non-prefixed token tag.  
The issue occurs primarily when non-prefixed node names are configured on a 
tokenizer that is used to parse XML documents containing fully-qualified nodes.

The patch addresses this issue by matching node names for the configured token 
and the namespace provider without respect to the prefix value.  This 
loose-matching behavior occurs unless an explicit prefix value is specified.  
The explicit namespace value will still be used for matching if it is provided.

It should be noted that this treatment of XML namespaces is a little loose.  
Issues can occur if two different elements (in different namespaces) share a 
non-qualified name that matches the token tag.  Also, the use of explicit 
namespace prefixes (e.g. ns1,  ns2, etc.) is only beneficial if all documents 
that will be parsed by the tokenizer use the exact same namespace prefix 
values. 

It may be possible to expand the tokenizer to include more robust namespace 
matching.  For example, explicit namespace values could be specified as part of 
the tokenizer configuration, and logic could be written to match parsed nodes 
against those values.   I will be happy to investigate that route if there is 
interest.

I will update documentation, etc as appropriate once this patch is committed.
                
> Apache Camel 2.9 Splitter with tokenize dont work with namespaces
> -----------------------------------------------------------------
>
>                 Key: CAMEL-5826
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5826
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-stax
>         Environment: Windows
>            Reporter: Shrish Srivastava
>            Assignee: Rich Newcomb
>            Priority: Critical
>         Attachments: CAMEL-5826.patch
>
>
> when trying to tokenize a stream having namespaces, no tokens are produced 
> with inheritNamespaceTagName property.
> -------------------------------------------------------------------
> <route id="hrp.connectorsCtxt.sddRcvFile2">
> <from
>                            
> uri="file:C:\Temp\esb\sdd\in?recursive=true&amp;preMove=.processing&amp;move=../.processed"
>  />
>                     <camel:split streaming="true">
>                            <tokenize token="suiviDemande" 
> inheritNamespaceTagName="suivisDemandes" xml="true"/>
>                            <log message="${header.CamelSplitIndex} : 
> ${in.body}" />
>                     </camel:split>
>              </route>
> -------------------------------------------------------------------

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to