You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Naveen Srinivasa Murthy <sm...@lycos.com> on 2001/04/20 14:59:40 UTC

Xerces-Xalan XPath utility problem if it is used to parse xml with namespace att

Hello friends,

I am using xerces-xalan xpath utility to do some elimentary xml
parsing. But im finding that when I am trying to parse an
xml with namespace like 
<root xmlns="http://xx.ww.com/aaa">
</root>

the parsing fails and i get an empty string result. It is not
throwing any exception, but the result 
if I remove that xmlns attribute and then do the xpath parse,
then i get the correct results.

Any idea of on this limitation? Can u suggest any
workaround if any of u guys have previouly seen this happen? Is there
any extra care to be taken when we parse xml with namespaces?

Thanks and regards
Naveen


Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Xerces-Xalan XPath utility problem if it is used to parse xml with namespace att

Posted by calvin loh <ca...@ihivetech.com>.
Had the same problem here, last time. It
fails only when the namespace is at the
root element. Never did solve the problem.
In the end, we just decided not to support
namespaces.

You should have no problems
if the namespace declaration is under the
root element.

Can't remember if the problem is from
xerces or xalan. Did some testing last
time, but couldn't remember the result.

Regards,
Calvin Loh


----- Original Message -----
From: "Naveen Srinivasa Murthy" <sm...@lycos.com>
To: <xe...@xml.apache.org>
Sent: Friday, April 20, 2001 8:59 PM
Subject: Xerces-Xalan XPath utility problem if it is used to parse xml with
namespace att


> Hello friends,
>
> I am using xerces-xalan xpath utility to do some elimentary xml
> parsing. But im finding that when I am trying to parse an
> xml with namespace like
> <root xmlns="http://xx.ww.com/aaa">
> </root>
>
> the parsing fails and i get an empty string result. It is not
> throwing any exception, but the result
> if I remove that xmlns attribute and then do the xpath parse,
> then i get the correct results.
>
> Any idea of on this limitation? Can u suggest any
> workaround if any of u guys have previouly seen this happen? Is there
> any extra care to be taken when we parse xml with namespaces?
>
> Thanks and regards
> Naveen
>
>
> Get 250 color business cards for FREE!
> http://businesscards.lycos.com/vp/fastpath/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Xerces-Xalan XPath utility problem if it is used to parse xml with namespace att

Posted by René Jensen <lu...@tbkol.dk>.
Hey there

I think I know this one. (Havent tryied it out yet).

In my Post "OT : Xalan-question" my problem basiclly is the same, and I
think I found the answer in the faq.
( http://xml.apache.org/xalan-j/faq.html#faq-11 )

You'll have to add a prefix to your namespace, and use that prefix in the
XPath.
Default namespaces sucks when using XPath...

I could still use a xalan mailinglist though...

                              _\|/_
                            (@ @)
-------------oOOo-(_)-oOOo------------
                        René Jensen
                  lundeman@tbkol.dk
--------------------------------------------


----- Original Message -----
From: "Naveen Srinivasa Murthy" <sm...@lycos.com>
To: <xe...@xml.apache.org>
Sent: Friday, April 20, 2001 2:59 PM
Subject: Xerces-Xalan XPath utility problem if it is used to parse xml with
namespace att


> Hello friends,
>
> I am using xerces-xalan xpath utility to do some elimentary xml
> parsing. But im finding that when I am trying to parse an
> xml with namespace like
> <root xmlns="http://xx.ww.com/aaa">
> </root>
>
> the parsing fails and i get an empty string result. It is not
> throwing any exception, but the result
> if I remove that xmlns attribute and then do the xpath parse,
> then i get the correct results.
>
> Any idea of on this limitation? Can u suggest any
> workaround if any of u guys have previouly seen this happen? Is there
> any extra care to be taken when we parse xml with namespaces?
>
> Thanks and regards
> Naveen
>
>
> Get 250 color business cards for FREE!
> http://businesscards.lycos.com/vp/fastpath/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org