View Single Post
  #4 (permalink)  
Old May 24th, 2018, 06:36 AM
Neal Neal is offline
Friend of Wrox
Points: 718, Level: 10
Points: 718, Level: 10 Points: 718, Level: 10 Points: 718, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jan 2006
Location: Ennis, Clare, Ireland.
Posts: 131
Thanks: 10
Thanked 0 Times in 0 Posts

Thank you both...

You both helped me overcome the main problem. I still have an issue with the 'MessageParts' output. Please can either of you assist?

Michael - I have updated using your advise and the result worked great for the 'DocumentDestinationPartner'.

Martin - I am bound by company protocol and there is no plans to move to 2.0 in the near future but thanks for your help.

The updated XSLT file

HTML Code:
<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:m="">
	<!--<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>-->
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	<!-- -->
	<xsl:template match="/">
        <xsl:apply-templates />

    <!-- Identity template : copy all text nodes, elements and attributes -->
    <xsl:template match="@*|node()">
            <xsl:apply-templates select="@*|node()"/>
    <!-- -->
    <!-- 1. Append '#D' or 'D'-->
	<xsl:template match="m:DocumentDestinationPartner">
				<xsl:when test="contains(., '#D')">
					<xsl:value-of select="concat(., 'D')"/>
					<xsl:value-of select="concat(., '#D')"/>
	<!-- -->
	<xsl:template match="text()">
		<xsl:value-of select="normalize-space()" />
	<!-- -->
The MessageParts element is still outputting as
HTML Code:
i.e. it is missing the attribute. How can I resolve this to retain the original?
HTML Code:
<MessageParts xmlns="">

Thanks in advance,

A Northern Soul
Reply With Quote