Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

xslt import window in filemaker doesn't show fields defined in xslt for importing


This topic is 3528 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have an xslt that I modified awhile ago.  It imports eye exam data from refraction equipment into our software.  It worked fine for a long time.  The XML data format was changed in a few elements so I modified the xslt to match the format change.  Now when I try and import the data into filemaker the fields are not listed in the import window and, as a result, doesn't get imported.  Can someone look at the code and see if there is any obvious reason the fields aren't in the import window in Filemaker?

 

Note: I am not a xml/xslt expert and the original code was written by someone else.  I've just modified it over the years.

 

The following elements were originally as follows:

 

<?xml version="1.0"?>

<MarcoData-XML>

...

   <DataSet>

      <UnaidedVisualAcuity_Data>

         <DIST_OD>  20/20 </DIST_OD>

         <DIST_OS>  20/20 </DIST_OS>

         <DIST_OU>  10/20 </DIST_OU>

         ...

      </UnaidedVisualAcuity_Data>

...

   </DataSet>

</MarcoData-XML>

 

The format of their data was changed to:

 

<?xml version="1.0"?>

<MarcoData-XML>

...

   <DataSet>

      <UnaidedVisualAcuity_Data>

         <DIST_OD>  20 </DIST_OD>

         <DIST_OS>  20 </DIST_OS>

         <DIST_OU>  10 </DIST_OU>

         ...

      </UnaidedVisualAcuity_Data>

...

   </DataSet>

</MarcoData-XML>

 

Here is the relevant xslt

 

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT BUILD="" NAME="Filemaker Pro" VERSION="" />
<DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="" RECORDS="" TIMEFORMAT="h:mm:ss a" />
<METADATA>

 

    <xsl:if test="string-length(/MarcoData-XML/DataSet/UnaidedVisualAcuity_Data/DIST_OD) != 0">
       <FIELD NAME="Entrance VA OD"    TYPE="TEXT" />
    </xsl:if>
    <xsl:if test="string-length(/MarcoData-XML/DataSet/UnaidedVisualAcuity_Data/DIST_OS) != 0">
       <FIELD NAME="Entrance VA OS"    TYPE="TEXT" />
    </xsl:if>
    <xsl:if test="string-length(/MarcoData-XML/DataSet/UnaidedVisualAcuity_Data/DIST_OU) != 0">
       <FIELD NAME="OU Va uncorrected" TYPE="TEXT" />
    </xsl:if>

 

</METADATA>

<RESULTSET FOUND="">
<xsl:for-each select="/MarcoData-XML/DataSet">
<ROW MODID="" RECORDID="">

<!-- Entrance VA OD -->
<xsl:if test="string-length(./UnaidedVisualAcuity_Data/DIST_OD) != 0" >
   <COL>
   <DATA>
      <xsl:value-of select="./UnaidedVisualAcuity_Data/DIST_OD" />
   </DATA>
   </COL>
</xsl:if>
<!-- Entrance VA OS -->
<xsl:if test="string-length(./UnaidedVisualAcuity_Data/DIST_OS) != 0">
   <COL>
   <DATA>  
      <xsl:value-of select="./UnaidedVisualAcuity_Data/DIST_OS" />
   </DATA>
   </COL>
</xsl:if>
<!-- OU Va uncorrected -->
<xsl:if test="string-length(./UnaidedVisualAcuity_Data/DIST_OU) != 0">
   <COL>
   <DATA>
      <xsl:value-of select="./UnaidedVisualAcuity_Data/DIST_OU" />
   </DATA>
   </COL>
</xsl:if>

 

</ROW>
</xsl:for-each>
</RESULTSET>
</FMPXMLRESULT>
</xsl:template>

</xsl:stylesheet>

 

See attached XML and xslt below for more information.  NOTE:  I changed the .xsl to .txt so it would upload.

RT5100Output.xml

RT5100-xsl 4 import-without habitual.txt

Posted

I don't understand your question:

 

You say that "the XML data format was changed" - but the only change you show us is in the data, not in the format.

 

You say that "the fields are not listed in the import window" - but when I try to import the XML file you have attached, using the stylesheet you have attached, I see this:

 

post-72594-0-91670700-1427830628_thumb.p

 

Posted

Sorry,  it is the data, not the format.

And, I don't see the first three fields listed at the top of the window.

That is my problem.

 

When I do an import I specify matching names and update existing records in found set.

Posted

And, I don't see the first three fields listed at the top of the window.

That is my problem.

 

It's a problem I cannot reproduce using the two files you have attached. So either you are not using the same two files, or your Filemaker is behaving differently than mine.

Posted

It's a problem I cannot reproduce using the two files you have attached. So either you are not using the same two files, or your Filemaker is behaving differently than mine.

 

The files I attached are my production code.

So, it seems my Filemaker is behaving differently than yours.

 

That said, do you know what sorts of things in the database could cause this to happen or have any idea how to go about debugging the problem?

I would hate to tell the doctors to enter the data manually if it doesn't import correctly.

That defeats the purpose of the interface.

 

Thanks for all your help.

Posted

Yes, you are correct the data imports correctly on the test case.

Thanks for verifying that for me.

So, my xml and xslt are correct.

 

But, the reality is, it doesn't import correctly in our live databases (as in multiple customers)

I'm trying to figure out what could be causing the problem.

This topic is 3528 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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