Jump to content

How can I transform xml document that changes namespace names?

Recommended Posts

Hi: I just started with xsl transformation a couple of days ago. I got assigned a project to handle the display of xml documents, OJT is good but difficult sometimes. I found that the xml document comes to me with different namespace declarations at different times. I am using altova xml spy to test my transformation and It looks like my stylesheet needs the exact namespace names and urls that is in the original xml before it gets transformed correctly. While looking over a variety of the documents samples I noticed that sometimes I will have xmlns;ns5="thisurl" and the next time it could be xmlns:ns5="otherURL" and xmlns:ns6="thisurl". I hope I explained this in a manner that makes sense. I don't now how I can handle this? Any help will be greatly appreciated. <stuff xmlns:ns5="thisurl"> <ns5:morestuff>this is it</ns5:morestuff></stuff> next time it may be like this <stuff xmlns:ns5="otherUrl" xmlns:ns6="thisurl"> <ns6:morestuff> <ns5:littestuff>this bit</ns5:littlestuff></ns6:morestuff><stuff>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...