10 August, 2010

XSLT namespace fun in scripting functoids

Another thing I frequently forget...

To find the namespace prefix to use in a scripting functoid in a map, right click on the map, select "validate map" and view the resulting xsl file. The opening stylesheet tag should show you which namespace prefixes apply to each input message (eg. s0 / s1).

If you're using aggregate schemas (particularly if you changed an existing map to use an aggregate input schema), you may now need to include the root node name in your XSLT. For example, if you have a message

<?xml:namespace prefix="ns0" /><ns0:request ns0="http://myschema">
<ns0:order>
<ns0:id>1234</ns0:id>
</ns0:order>
</ns0:request>

and you previously referenced the ID element using s0:order/so:id

you may now need to reference it using //s0:Request/s0:order/so:id

No comments:

Post a Comment