A few weeks ago, while I was testing and troubleshooting a RosettaNet BizTalk Server map inside Visual Studio, I endup getting the following error:
XslLoadException
——————-
XSLT compile error.XmlException
—————
Prefix ‘ns2’ cannot mapped to namespace reserved for “xml” or “xmlns”. Line 2, position 484.
Just to clarify, this map is a normal BizTalk Server map, but it uses a RosettaNet schema — a PIP schema — as input or output.
Cause
In some, if not all, RosettaNet PIP schemas, we must include an XML schema in the PIP for them to work and open in the Schema Editor.
However, when we try to debug a BizTalk Mapper inside Visual Studio, the Visual Studio raises this error, complaining about the prefix. We can test it, and it will provide the output of that test, but it will fail if we try to debug it.
Solution
The solution to be able to solve this limitation is a small workaround.
- Once you first try to debug the map and it fails, it also produces the XSLT output behind the BizTalk Mapper.
- Access the XSLT code and look for the prefix that is causing the problem. In my case, it was xmlns:ns2
- Remove that prefix – that means remove the entire sentence: xmlns:ns2=”HTTP://www.w3.org/XML/1998/namesapce”
- Now, within the XSLT code, from the Visual Studio menu, click Debug -> Start XSLT Debugging.
Now, you will be able to debug the map. Of course, you must do this workaround whenever you want to debug your map.
I hope you find this helpful! If you liked the content or found it useful and want to help me write more, you can buy (or help me buy) my son a Star Wars Lego!