Skip to Content
0

XSLT Mapping

May 09, 2017 at 04:02 PM

52

avatar image

Hi SDNites,

I am building an XSLT mapping to achieve split functionality. I have written the code to carry out the mapping and is working absolutely fine.

The issue in above mapping is that as soon as I mention ns0 or ns1 in the element tags, it stops working. Can you please guide what could be the issue.

I am using NWDS to build and test XSLT mapping.

Regards,

Abhi

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Evgeniy Kolmakov May 09, 2017 at 04:13 PM
0

Hi Abhishek!

If you use namespaces in your transformation you should declare it first, either in element definition or in transformation header. So please check if namespaces with used prefixes have already been declared before using it.

Regards, Evgeniy.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Evgeniy,

Thanks for the response.

I am able to use the namespace in transformation with above suggestions. Below are some of my findings. Can you please confirm my understanding is correct,

1. Namespace used in XML and XSLT need not be same. For ex. xmlns:t1 (used in XML) and xmls:t2 (Used in XSLT)

2. URL used in XML and XSLT has to be same. For ex. xmlns:t1="http://testurl" (used in XML) and xmlns:t2="http://testurl" (Used in XSLT)

Regards,

Abhi

0

Hi Arhishek!

Namespaces are used to differentiate elements within XML structure.

Namespace used in XML and XSLT need not be same

Not namesapces but namespace prefixes. You link namespace to prefix using "xmlns:" namespace attributes and further parser qualifies element by combining namespace set for given prefix and element name. So you can use different prefixes in different documents, they just should describe the same namespace. And yes - if element is qualified with any namespace, you should use the same namespace for it in any place you want to refer it (but you can set different prefix for that namespace).

Regards, Evgeniy.

0

Thanks Evgeniy for valuable explanation.

0