Skip to content
June 1, 2013 / kiranpatils

XML XSLT Namespace gotcha

Challenge:

Before couple of weeks back we spent a good amount of time making XML and XSLT work, you must be thinking so easy then why this guy invested lot of time. Wait o minute coming to you.

Solution:

Basically, we had XML and we were trying to fetch few nodes via XSLT from it. But it was not working as expected. We verified everything our XPATH was correct and everything was correct then following link, pointed us towards a solution:

http://stackoverflow.com/questions/1730875/xslt-transform-xml-with-namespaces

Our XML was having xmlns deceleration,  and we were not using xmlns in our XSLT document. And that was the reason why XSLT was not able to XPATH nodes. Once, we added XMLNS to our XSLT document and changed our XPATH as per XMLNS then everything started working as expected!

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: