[ 
https://issues.apache.org/jira/browse/XALANJ-2469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12653185#action_12653185
 ] 

rohit singh commented on XALANJ-2469:
-------------------------------------

Hi Henry !!

This is what i tried. 

I used xpath expression as "/abc:Invoice" and defined the prefix abc as 
abc="http://edi.carquest.com/2007/types/transnet";. The xml is same with default 
namespace as xmlns="http://edi.carquest.com/2007/types/transnet"; in the 
root-tag. But this also did not help. 

We have already suggested about using 
/*[local-name()='Invoice']/*[local-name()='InvoiceHeader']/*[local-name()='InvoiceParty']
  but this will be a performance hit when large XML files are processed.

I have also referred the RFC. Pulled out this section below, but not able to 
make much out of it :- 

"A QName in the node test is expanded into an expanded-name using the namespace 
declarations from the expression context. This is the same way expansion is 
done for element type names in start and end-tags except that the default 
namespace declared with xmlns is not used: if the QName does not have a prefix, 
then the namespace URI is null (this is the same way attribute names are 
expanded). It is an error if the QName has a prefix for which there is no 
namespace declaration in the expression context."  




> Xpath support in Xalan does not work if default namespace is used
> -----------------------------------------------------------------
>
>                 Key: XALANJ-2469
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2469
>             Project: XalanJ2
>          Issue Type: Bug
>      Security Level: No security risk; visible to anyone(Ordinary problems in 
> Xalan projects.  Anybody can view the issue.) 
>          Components: XPath
>    Affects Versions: 2.0.x
>         Environment: Windows, IBM WebSphere Application Server - ND,          
> 6.1.0.7
>            Reporter: rohit singh
>            Priority: Blocker
>             Fix For: 2.0.x
>
>
> We are trying to use path for example "/Invoice/InvoiceHeader/InvoiceParty" 
> as an X-Path expression. The XML document on which this xpath is evaluated 
> has a default namespace defined. This xpath expression does return the 
> specified elements value. I check the specification on xpath 1.0 on this url 
> http://www.w3.org/TR/xpath and got this text below 
> "There is an element node for every element in the document. An element node 
> has an expanded-name computed by expanding the QName of the element specified 
> in the tag in accordance with the XML Namespaces Recommendation [XML Names]. 
> The namespace URI of the element's expanded-name will be null if the QName 
> has no prefix and there is no applicable default namespace."
> According to the above the xpath should work irrespective of whether we have 
> specified a default namespace or not. Please take this as a high priority and 
> fix this problem. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to