You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Vikrant sutar <vi...@yahoo.com> on 2004/07/21 01:21:10 UTC

Urgent : Can we use XPath for complex xml ? (Xalan 2.0.6)

Hi All,
 
Need help .. I want to know wheather we can use, Xalan- XPath to get values from complex xml. We have complex xml and I tried evaluating expression on this, but they do not return any results. [I can evaluate SAME expression in XML Spy]
 
Following is xml code fyi ..
---------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<PSTPAuthenticator xmlns="http://www.w3.org/2001/04/xmlenc#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <userid Id="userid">
 gb
 </userid>
 <SIV Id="siv">
 340812
 </SIV>
 <SIP Id="sip">MontyPython</SIP>
</PSTPAuthenticator>
---------------------------------------------------------------------------------------------------------

Above is least comlex XML we have. I tried with sample "ApplyXPath" example.
 
If I remove "xmlns" and "xmlns:xsi" - then it works.
 
If anyone has written any code for such an xml please email me.
 
Please advice.
 
Thanks, vikrant

		
---------------------------------
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!

Re: Urgent : Can we use XPath for complex xml ? (Xalan 2.0.6)

Posted by da...@us.ibm.com.
> Need help .. I want to know wheather we can use, Xalan- XPath to get
values from complex xml.
> We have complex xml and I tried evaluating expression on this, but they
do not return any results.
> [I can evaluate SAME expression in XML Spy]

This is a FAQ:

    http://xml.apache.org/xalan-j/faq.html#faq-N101DA

If XML Spy really works as you purport it does, that's a bug.

> If I remove "xmlns" and "xmlns:xsi" - then it works.

The xmlns:xsi namespace declaration is irrelevant.  Only the default
namespace declaration affects the names of the un-prefixed element nodes.

Dave