cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT Mapping

itabhishek9
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member190293
Active Contributor
0 Kudos

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.

itabhishek9
Participant
0 Kudos

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

former_member190293
Active Contributor
0 Kudos

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.

itabhishek9
Participant
0 Kudos

Thanks Evgeniy for valuable explanation.

Answers (0)