Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Error message during XML export

Featured Replies

I have modified a copy of a well working script for XML export. I have modified the fieldheaders in the xsl-file and changed the destination of the output file, but no further changes.

I makes an error (see attachment). It states that the is an invalid character somewhere, but where do I find and correct it?

For the record (and yes, the separator is TAB):

<?xml version="1.0" encoding="UTF-8"?>



<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:fmp="http://www.filemaker.com/fmpxmlresult">



<xsl:output method="text" encoding="ISO-8859-1"/>



<xsl:variable name="CRLF">

<xsl:text>&#x000D;&#x000A;</xsl:text>

</xsl:variable>



<xsl:variable name="delimiter">

<xsl:text> </xsl:text>

</xsl:variable>



<xsl:template match="/">

<xsl:text>v_products_model v_products_name_1 v_products_short_description_1 v_products_description_1 v_products_page_title_1 v_products_meta_keywords_1 v_products_meta_description_1 v_products_image v_products_price_per v_products_manufacturer_model v_products_ean v_products_price v_products_quantity v_products_weight v_date_avail v_date_added v_categories_name_1_1 v_categories_name_2_1 v_manufacturers_name v_tax_class_title v_status EOREOR&#x000D;&#x000A;</xsl:text>



<xsl:for-each select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW">

<xsl:for-each select="fmp:COL">

<xsl:value-of select="fmp:DATA"/>

<xsl:choose>

<xsl:when test="position()=last()">

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

</xsl:when>

<xsl:otherwise>

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

</xsl:otherwise>

</xsl:choose>

</xsl:for-each>

</xsl:for-each>



</xsl:template>

</xsl:stylesheet>

post-106146-0-94259800-1343980450_thumb.

The error message seems to indicate that the invalid character is in one of the exported fields. The character is a non-printing control code - perhaps inadvertently pasted into the field.

  • Author

The error message seems to indicate that the invalid character is in one of the exported fields. The character is a non-printing control code - perhaps inadvertently pasted into the field.

That sounds reasonable, BUT ... How am I surposed to search for something I don't what is?

Likely it's line ends, e.g. CR and/or LF. I recall something about the character codes 010 and 013, but how do I search (inside FM) for 013? &013; or ...?

Or can I "clean" a CSV-file for later re-import?

I have not tried it but you define CRLF in UTF-16 while the output is set to UTF-8. Did you change the encoding?

Apart from that: the xml standard defines all ASCII chars except (9, 10 & 13) in the range 0-31 as illegal. My guess it's the 000a 000d combos.

That sounds reasonable, BUT ... How am I surposed to search for something I don't what is?

Try defining a calculation field (or an expression in Data Viewer) as =

PatternCount ( Field1 & Field2 & ... & FieldN ; Char ( 1 ) )

Then see which record returns a result > 1.

Before you do that, see if the error is thrown when you export as XML without a stylesheet.

you define CRLF in UTF-16

What makes you think so?

What makes you think so?


<xsl:variable name="CRLF">

<xsl:text>&#x000D;&#x000A;</xsl:text>

</xsl:variable>

Looks to me like CR+LF in UTF-16BE.

But I was wrong on that being the error.

Technically, it may be in a UTF-16 compatible format, but leading zeros do not count and anything in the lower ASCII range will evaluate the same.

  • Author


<xsl:variable name="CRLF">

<xsl:text>&#x000D;&#x000A;</xsl:text>

</xsl:variable>





Looks to me like CR+LF in UTF-16BE.



But I was wrong on that being the error.

The code shown in my message above has been working perfectly in months now. The only change is the field names in this line:

<xsl:text>
  • Author

Try defining a calculation field (or an expression in Data Viewer) as =

PatternCount ( Field1 & Field2 & ... & FieldN ; Char ( 1 ) )

Then see which record returns a result > 1.

I don't know why, but ... IT WORKED!

Two records with ... ehhhhm, a lot of errors (content pasted from another application) :cry:

Thanks a lot :hug:

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.