You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by jana957 <ja...@rsa.com> on 2011/09/27 19:54:41 UTC

XalanC1.10: selectNodeList does not retrieve non-namespace nodes

Hi,
I am new to XalanC++1.10, trying to enhance an application to retrieve new
XML nodes for processing. Below is an example XML:

Expand|Select|Wrap|Line Numbers
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:sd="http://example.org/2008/04/sdee">
  <sd:events>
   <sd:evIdsAlert eventId="1234567" vendor="example"
severity="low">...</sd:evIdsAlert>
   <sd:evIdsAlert eventId="1234568" vendor="example"
severity="low">...</sd:evIdsAlert>
  <evStatus> 
  <appname>mainApp</appname>
  </evStatus>
   </sd:events>
  </env:Envelope>


Code as described below looks like this:


XalanDocumentPrefixResolver resolver(xmldoc);
 
eventNodeList = evaluator.selectNodeList(
evntnodeList,
domSupport,
doc,
"/env:Envelope/sd:events/evStatus",
prefixResolver);
When i use Xalan's "selectNodeList()" with "prefixResolver" instance and
"/env:Envelope/sd:events/evStatus" as xpath, it does not return any node. If
i give <evIdsAlert> or <events> in the xpath, then it returns instances of
them.

May i please know how can we retrieve non-namespace nodes.
Any pointers/help is greatly appreciated.
-- 
View this message in context: http://old.nabble.com/XalanC1.10%3A-selectNodeList-does-not-retrieve-non-namespace-nodes-tp32536960p32536960.html
Sent from the Xalan - C - Users mailing list archive at Nabble.com.


Re: XalanC1.10: selectNodeList does not retrieve non-namespace nodes

Posted by jana957 <ja...@rsa.com>.
Hi,

My problem resolved after I prefixed the node with default namespace, now
selectNodeList retrieves the node. The doc also contains a default namespace
"cid" which was not posted here since i was not too much aware of it (i only
cut and paste a sample doc)

Thanks for the help

Regards
Janardan


David Bertoni wrote:
> 
> On 9/27/2011 10:54 AM, jana957 wrote:
>>
>> Hi,
>> I am new to XalanC++1.10, trying to enhance an application to retrieve
>> new
>> XML nodes for processing. Below is an example XML:
>>
>> Expand|Select|Wrap|Line Numbers
>> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
>> xmlns:sd="http://example.org/2008/04/sdee">
>>    <sd:events>
>>     <sd:evIdsAlert eventId="1234567" vendor="example"
>> severity="low">...</sd:evIdsAlert>
>>     <sd:evIdsAlert eventId="1234568" vendor="example"
>> severity="low">...</sd:evIdsAlert>
>>    <evStatus>
>>    <appname>mainApp</appname>
>>    </evStatus>
>>     </sd:events>
>>    </env:Envelope>
>>
>>
>> Code as described below looks like this:
>>
>>
>> XalanDocumentPrefixResolver resolver(xmldoc);
>>
>> eventNodeList = evaluator.selectNodeList(
>> evntnodeList,
>> domSupport,
>> doc,
>> "/env:Envelope/sd:events/evStatus",
>> prefixResolver);
>> When i use Xalan's "selectNodeList()" with "prefixResolver" instance and
>> "/env:Envelope/sd:events/evStatus" as xpath, it does not return any node.
>> If
>> i give<evIdsAlert>  or<events>  in the xpath, then it returns instances
>> of
>> them.
>>
>> May i please know how can we retrieve non-namespace nodes.
>> Any pointers/help is greatly appreciated.
> 
> I cannot reproduce your problem using the latest code in the repository, 
> but I don't believe much has changed since the 1.10 release.
> 
> Are you sure the document snippet you posted matches your actual data?
> 
> Dave
> 
> 

-- 
View this message in context: http://old.nabble.com/XalanC1.10%3A-selectNodeList-does-not-retrieve-non-namespace-nodes-tp32536960p32622161.html
Sent from the Xalan - C - Users mailing list archive at Nabble.com.


Re: XalanC1.10: selectNodeList does not retrieve non-namespace nodes

Posted by David Bertoni <db...@apache.org>.
On 9/27/2011 10:54 AM, jana957 wrote:
>
> Hi,
> I am new to XalanC++1.10, trying to enhance an application to retrieve new
> XML nodes for processing. Below is an example XML:
>
> Expand|Select|Wrap|Line Numbers
> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
> xmlns:sd="http://example.org/2008/04/sdee">
>    <sd:events>
>     <sd:evIdsAlert eventId="1234567" vendor="example"
> severity="low">...</sd:evIdsAlert>
>     <sd:evIdsAlert eventId="1234568" vendor="example"
> severity="low">...</sd:evIdsAlert>
>    <evStatus>
>    <appname>mainApp</appname>
>    </evStatus>
>     </sd:events>
>    </env:Envelope>
>
>
> Code as described below looks like this:
>
>
> XalanDocumentPrefixResolver resolver(xmldoc);
>
> eventNodeList = evaluator.selectNodeList(
> evntnodeList,
> domSupport,
> doc,
> "/env:Envelope/sd:events/evStatus",
> prefixResolver);
> When i use Xalan's "selectNodeList()" with "prefixResolver" instance and
> "/env:Envelope/sd:events/evStatus" as xpath, it does not return any node. If
> i give<evIdsAlert>  or<events>  in the xpath, then it returns instances of
> them.
>
> May i please know how can we retrieve non-namespace nodes.
> Any pointers/help is greatly appreciated.

I cannot reproduce your problem using the latest code in the repository, 
but I don't believe much has changed since the 1.10 release.

Are you sure the document snippet you posted matches your actual data?

Dave