cnu.kaigala
May 28th, 2009, 11:38 AM
HI,
My xml file some thing like this.
<?xml version="1.0" encoding="utf-8" ?>
<parent id="http://abc.co.in">
<name xml:lang="en">code Guru</name>
<name>My name</name>
</parent>
Now in the above xml file i tried to retrieve the name element having xml lang attribute using the xpath expression as
"(//*[starts-with(name(),name)])[lang( 'en' )]".Then it is working fine iam getting the result as "code Guru"
But if i try to retrieve the element name which is not having xml:lang attribute using the following xpath expression's
(//*[starts-with(name(),name)])[not(//@*[local-name()='lang' ])]
(//*[starts-with(name(),name)])[(@*[local-name()='lang' ])=' ' ]
//*[starts-with(name(),name)])[not(@xml:lang)]
(//*[starts-with(name(),name)])[@xml:lang=' ' ].
i failed to get the value of that element.
Could any body please suggest me how to achieve this? Please let me know if you want any pre-data regarding this?
Regards,
Venkat.
My xml file some thing like this.
<?xml version="1.0" encoding="utf-8" ?>
<parent id="http://abc.co.in">
<name xml:lang="en">code Guru</name>
<name>My name</name>
</parent>
Now in the above xml file i tried to retrieve the name element having xml lang attribute using the xpath expression as
"(//*[starts-with(name(),name)])[lang( 'en' )]".Then it is working fine iam getting the result as "code Guru"
But if i try to retrieve the element name which is not having xml:lang attribute using the following xpath expression's
(//*[starts-with(name(),name)])[not(//@*[local-name()='lang' ])]
(//*[starts-with(name(),name)])[(@*[local-name()='lang' ])=' ' ]
//*[starts-with(name(),name)])[not(@xml:lang)]
(//*[starts-with(name(),name)])[@xml:lang=' ' ].
i failed to get the value of that element.
Could any body please suggest me how to achieve this? Please let me know if you want any pre-data regarding this?
Regards,
Venkat.