AnsweredAssumed Answered

How to perform a XSLT transformation inside FileMaker?

Question asked by ibrahim_bittar on May 17, 2018
Latest reply on May 17, 2018 by fmpdude

Hi all

 

I have a XML file that is a Mexican Electronic Invoice. It has it's own structure and its contents are inside a text field in my solution.

 

The process to build that XML is as follows:

  1. Put together a text string (called "Original String") with the required fields for the invoice.
  2. Digitally sign the original string.
  3. Build the XML through a (big) calculation.
  4. Send the XML to the Mexican Tax authority via REST.
  5. Get and parse the response.

 

This process we've been doing it for years without a problem but now we are required to perform the reverse process: We have the XML file and we need to build the original string from it.

 

I found the XSLT file that performs this transformation but haven't found a way to perform this transformation from within FileMaker. I know I can perform a XML import of a file that conforms to the FMPXMLRESULT DTD but this is not the case. This XSLT will transform the XML into a simple text string that I will put in a text field. What I need is to perform kind of a Replace that will read the XML text and convert it into the original string. I'm willing to use a plugin like BaseElements or any other that is necessary to perform this task.

 

Here is an example of the original string:

||3.3|E|9101|2018-05-17T07:51:47|99|00001000000406408780|15|15000.00|MXN|1|17400.00|I|PPD|37148|EIK100209S16|Empresas Ficticias SA de CV|601|XEXX010101000|Auto Parts SC|CRI|3101311234|G03|82101500|1.00|H87|Pieza|This is a test|15000.00|15000.00|15000.00|002|Tasa|0.160000|2400.00|002|Tasa|0.160000|2400.00|2400.00||

 

If someone who knows well XSLT ( beverly please ) could jump in and guide me I'll appreciate it a lot.

 

The XSLT file and a Sample XML file are attached to this post.

 

Best regards

 

Ibrahim

Outcomes