none
Namespace in scripting functoid XSLT RRS feed

  • Question

  •  

    In my scripting functoid, I use inline XSLT

    <ns0:RECORD9 >
     <DoNotDeliverAfterDate>
      <xsl:value-of select="$var:v48" />
      </DoNotDeliverAfterDate>
    </ns0:RECORD9>

     

    But when validate, the error says ns0 is not declared. The ns0 is declared on top of map. xmlns:ns0="http://schemas.microsoft.com/BizTalk/2006"

    How to solve that?

     

    Thanks

     

     

    Monday, October 6, 2008 5:09 AM

Answers

  • The problem stems from the namespace not being recognized within the context of the script even though it is correctly declared.

     

    To work around this issue, simply use either approach:

    Code Snippet

    <xsl:element name="ns0:RECORD9">

        <DoNotDeliverAfterDate>

            <xsl:value-of select="$var:v48" />

        </DoNotDeliverAfterDate>

    </xsl:element>

     

     

    or alternatively declare the namespace locally as:

    Code Snippet

    <ns0:RECORD9 xmlns:ns0="http://schemas.microsoft.com/BizTalk/2006">

        <DoNotDeliverAfterDate>

            <xsl:value-of select="$var:v48" />

        </DoNotDeliverAfterDate>

    </ns0:RECORD9>

     

     

    I prefer first method as it saves me the trouble of maintaining namespaces in script if changes occur.

     

    Hope that helps!

    Monday, October 6, 2008 6:12 AM