Thursday, August 07, 2008

BizTalk Mapper - Specific Namespace Prefix

By default, BizTalk Maps generates the output xml files with ns0, ns1, ns2, ... namespace prefix. If we need to set this prefixes to a specific value, we will have to use the map's "Custom XSL Path" property by following these steps:

1) We validate our current Map (the original map, that generates ns0, ... prefixes) -> Right Click on Map File and select "Validate Map".

2) We get the generated XSL file. The path is in the Results Panel:
The output XSLT is stored in the following file: <file:///C:\Documents and Settings\F1504\Configuración local\Temp\_MapData\CsvEntrada2XmlCache.xsl>

3) We change the namespace values in the generated XSL file, finding and replacing "ns0:" to whatever we want.

4) We add a new map to our Project, with source and destination schemas the same as out original map.

5) We set "Custom XSL Path" property in our new map, selecting the XSLT file that previously we have modified.

No comments: