cancel
Showing results for 
Search instead for 
Did you mean: 

xsl can not read <ns:TagName

Former Member
0 Kudos

When SAP generates xml it creates <ns: in front of TagName which would be OK except that when I try to read the document using xsl it does not work. However when I remove the ns: part from the source it works fine.

here is the code:

does not work

<xsl:for-each select='ns:MT_HSBCData/HSBCRecordSet/HSBCRecord'>

<xsl:value-of select='HSBCLine'/>

<xsl:text>&#60;br&#62;</xsl:text>

</xsl:for-each>

does work

<xsl:for-each select='MT_HSBCData/HSBCRecordSet/HSBCRecord'>

<xsl:value-of select='HSBCLine'/>

<xsl:text>&#60;br&#62;</xsl:text>

</xsl:for-each>

Accepted Solutions (1)

Accepted Solutions (1)

GabrielSagaya
Active Contributor
0 Kudos

It should work even when you prefix ns in your message type.

Also check whether you have defined namespace and its prefix ns in the top of XSLT mapping...

Former Member
0 Kudos

Thanks all, I just missed defining my namespace in the xsl. It is all good now

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

It can work even work with ns: just add your namespace to the xslt.

like here:

http://www.xml.com/pub/a/2001/04/04/trxml/index.html

/wg