cancel
Showing results for 
Search instead for 
Did you mean: 

White space not preserved with XSL Mapping

0 Kudos

Hello

Is there a problem with preserving white space when using a XSL mapping? My schema has the following included:

 
              <xs:element name="FileVersion" minOccurs="1" maxOccurs="1">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:length value="5"/>
                    <xs:whiteSpace value="preserve"/>
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>              

The whiteSpace attribute alone didn't do it, so I've added length as well which didn't help either.

My imported XSL mapping writes a fix value of " 6.00" (having a leading space) into the field:


	<FileVersion>
		<xsl:value-of select="' 6.00'"/>
	</FileVersion>

Processing the mapping with an external tool provides the correct output with a leading space.

The leading space is missing in the output file or when I do testing in the integration builder. Looking at the target payload in sxmb_moni also shows me the value without leading space:


  <FileVersion>6.00</FileVersion> 

What do I miss? I haven't really found a posting regarding the issue, hence I assume it isn't really one!? Any feedback is appreciated.

Thanks,

Daniel

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos

Is your XSLT mapping using xsl:preserve-space declaration: http://www.w3schools.com/xsl/el_preserve-space.asp

0 Kudos

My XSLT mapping does not have a preserve-space declaration. I am using Altova MapForce, and apparently preserve-space is not a declaration that is supported by MapForce. I would need to manually add it to the mapping after generating it in the tool. Nevertheless, isn't preserve-space the default anyway if nothing is declared, and therefore not necessary?.

former_member200962
Active Contributor
0 Kudos
isn't preserve-space the default anyway if nothing is declared

yes, it is