-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitespace is removed when exporting table data as XML Format #422
Comments
Thanks for reporting this! Are you referring to data within a field? Would you be able to provide a screenshot or example? |
Thanks, that is helpful! |
I have reproduced this issue in the testing database. The change is coming from the |
Thank you for looking into this. This project is great! |
Well, even with the help of ChatGPT, I was unable to fully figure out how to adjust the transformation while leaving the content intact. When I removed the template section with the I will go ahead and push this change to the |
We don't want to change the actual data inside the tags when exporting table data to XML. #422
For reference, here is the original XSLT: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="@*">
<xsl:copy/>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>
<xsl:template match="*">
<xsl:param name="indent" select="''"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="$indent"/>
<xsl:copy>
<xsl:apply-templates select="@*|*|text()">
<xsl:with-param name="indent" select="concat($indent, ' ')"/>
</xsl:apply-templates>
</xsl:copy>
<xsl:if test="count(../*) > 0 and ../*[last()] = . and not(following-sibling::*)">
<xsl:text>
</xsl:text>
<xsl:value-of select="substring($indent, 3)"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet> I removed the following: <xsl:template match="text()">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template> |
The issue is that the XSLT transformation does manual indentation rather than letting the parser do the indentation which would be too wide. In order to do the indenting, it has to add the indentation which is achieved by treating XML as if it were text and then indenting it. The problem is that we necessarily don't want to strip spaces from the values but we do want to strip the spaces from the tags (e.g. the XML structure itself). Will have to see if we can find a way to make the distinction. |
I'm trying to export my table data with the XML Format. However, I noticed that some of my text fields are losing some whitespace characters.
For example, the string " system normal " will be exported as "system normal".
It seems to be working fine with the Tab Delimited format, but I would prefer to use the XML Format.
My sanitize level is set to "None (Off)".
I'm using v4.0.15-beta with Access 2016.
The text was updated successfully, but these errors were encountered: