Jump to content

Miguel Moreno

Members
  • Content Count

    9
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Miguel Moreno


  1. On 3/20/2024 at 4:58 PM, chgemini said:

    Good morning all, I'm sorry to bump an old post but I could do with some help please.

     

    I am using XML Mapper but cannot get the attached XML file mapped, it only has 2 fields but is a soap response, any ideas at all please? I have tried with both the old version and the Malawi version.

     

    The files were mapped using XTR files some 10+ years ago by another developer, but the spec has since changed and I cannot see any results when testing the transformation on the file.

     

    Thanks so much in advance

     

     

    SOAP_GetCAPRangeResponse.txt

     

    Hello.

     

    Yeah, you are correct, the file you have posted is in fact a "SOAP web service response file".

     

    XML Mapper is a tool designed to help you convert ("transform") an XML file that contains data in a repeating pattern to a Delphi dataset data file.

     

    To achieve this, XML Mapper expects you to have the XML schema (XSD file) representing the structure of the source XML file you want to convert into a Delphi dataset.  XML Mapper is not designed to read or process web service response files, be it SOAP or REST.  That is a task that you must do separately.

     

    Now, let's take a look at your SOAP response file:

     

    1. The SOAP response file is correctly formatted:  it has an XML "Envelope" section with header data and an XML "Body" section with the actual payload.

    XML_Mapper__SOAP_GetCAPRangeResponse__001_Envelope_and_body.thumb.png.49037aafaa916a4ce23581ad01582607.png

     

    2. In the XML "Body" section (payload), we can see first the XMLSchema of the response dataset:

    XML_Mapper__SOAP_GetCAPRangeResponse__002_Returned_DataSet__Schema.thumb.png.cd7a193c045229895bc66b6651f6470e.png

     

    3. Right after the XML Schema, we can see the actual XML dataset with its row data:

    XML_Mapper__SOAP_GetCAPRangeResponse__003_Returned_DataSet__Data.thumb.png.fc4f5f423cf802ba86a76007a654130d.png

     

    4. We can extract the XML Schema to a separate individual file, adding the same XML header as found in the SOAP envelope.  Let's save it as "SOAP_Dataset_Schema.xsd":

    XML_Mapper__SOAP_GetCAPRangeResponse__004_Returned_DataSet__Schema_extracted.thumb.png.4f14d764c69f81e3297a5908f9b1d213.png

     

    5. By the same token, we can extract the XML dataset to a separate individual file, again adding the same XML header as found in the SOAP envelop.  Let's save it as "SOAP_Dataset.xml":

    XML_Mapper__SOAP_GetCAPRangeResponse__005_Returned_DataSet__Data_extracted.thumb.png.89c63c244d5734f3947f4aeae34c7814.png

     

    6. Open the XML Schema file ("SOAP_Dataset_Schema.xsd") in XML Mapper:

    XML_Mapper__SOAP_GetCAPRangeResponse__006_Schema_extracted_loaded_in_XML_Mapper.thumb.png.d5cef21615af3a851da65f4ea17f0b8e.png

     

    7. Create the "transformation" file:

         a) Right click on the schema panel and click on "Select all"

         b) Right click on the schema panel and click on "Create Datapacket from XML"

         c) Click on the center button "Create and Test Transformation"

         d) The test transformation window pops up with sample transformation data

    XML_Mapper__SOAP_GetCAPRangeResponse__007_Transformation_test_in_XML_Mapper.thumb.png.bf3f2fa6619c26a3ea85e159a1ef0f4e.png

     

    8. Load and process the XML dataset (“SOAP_Dataset.xml”):

         a) Click on the “Open file” toolbar icon of the “Test transformation” window

         b) Select and open the “SOAP_Dataset.xml” file

         c) XML Mapper will load and transform the XML dataset

         d) The data will be shown in the “Test transformation” window in a DBGrid with a TClientDataSet as the source

    XML_Mapper__SOAP_GetCAPRangeResponse__008_Transformation_with_data_extracted.thumb.png.13ff41d13681c5f7a0bca720e277d1d2.png

     

    I hope this example can guide you on what XML Mapper can do and what you need to do on your own to use it properly.

     

    If you have further doubts please let us know.

     

    Thanks,

     

         Miguel

     

    • Like 1

  2. On 2/5/2024 at 2:57 PM, Lars Fosdal said:

    @Miguel Moreno It seems that the XMLMapper the 12.0 GetIt, is the old version again 😞

    It crashes on the recursive TPack.xsd, and it fails to correctly render a relatively simple schema, while the newer XMLMapper in 11.3 does the job right.

    11.3 version on top, 12.0 version on bottom.

    image.thumb.png.795573870882528933a8e9dc3bcfaf8d.png

     

    Hello Lars.

     

    I am sorry, but your screenshots do not make sense...

     

    1. Both screenshots show the "XML Mapper" with its new face (VCL Styes) -- only the XML Mapper that we distribute through "GetIt" has the new face lift.
    2. One screenshot is for the "Schema view, the other for the "XML View (document)"
    3. We have not released any new version of "XML Mapper" for Delphi 12.  What you get in Delphi 12 is the "stock good old XML Mapper".

     

    So all of this seems odd.

     

    If this is still an issue, can you please elaborate on the actual problem after considering my feedback in the previous paragraphs ?

     

    Thanks,

     

         Miguel.

     

    ( FYI, this is how the "stock XML Mapper" shipped with Delphi looks like: )
    1557719446_ScreenShot2024-03-23at08_01_02.thumb.png.a598fe10acdd845e2a328506e08f3b27.png


  3. On 4/20/2023 at 8:04 PM, Lars Fosdal said:

    @Miguel Moreno - I have an XSD schema that the XMLMapper doesn't like.

    Should I create an entry in Quality Portal?

     

    When I try to select the entire structure, I get multiple of these.

    image.thumb.png.ce424b92b5ff170a44a7376fd7acac3b.png

     

    The document also has more than one root - which seems to be handled.

     

    Hello Lars.

     

    Sorry for not replying on time...  For some reason my email notifications coming from "Delphi-Praxis" started to go to my "junk" mailbox and I did not noticed until now.  This has been fixed now. 😊

     

    Regarding the error message that you are getting (see above):

     

    1. We have made big changes in the way that XML mapper handles errors.  In the past, it would simply either ignore all errors -- no error message or feedback to the user -- or not handle them at all -- causing "blind" crashes with no clue or info about why it crashed.
    2. As part of the error handling overhauling, we have added several error handlers and we now try to give feedback to the user in all of them, so she/he knows what is going on.
    3. One of those errors has to do with a design flaw in the original XML mapper:
      1. XML Mapper was designed to handle "repeating XML elements" (i.e., "nested datasets") based on simple, non-complex elements ( Definition of XML complex elements ).
      2. Originally, XML Mapper "assumed" that the input XML always complied to the rule above, so it didn't even check or validated the XML data -- as a result, XML Mapper would simply hang up when the rule was not met.
      3. Once we detected this case, we added logic to validate the XML data, "catch" the error and inform the end user about the non-compliant issue.

    After we made these changes, we have now found several "modern day" XML files and schemas with "complex" XML elements defined as "repeating" ("nested dataset").  As part of our current development milestone -- correctly handle all valid modern day XML files -- we have focused on getting this issue fixed once and for all.

     

    We can only share for right now that the task has not been trivial -- it has required us to rewrite considerable parts of the original parsing and XML data structure logic to get it done right.

     

    This is currently the key milestone we must complete before releasing our next official XML Mapper version, so you will hear from us very soon when we feel that XML Mapper is now "good to go".

     

    In the mean time, I am sorry to inform you that there is nothing you can do about it -- XML Mapper will not be able to process your XML file, but at least you are now been "kindly informed" about it instead of just crashing 😁.

     

    Thanks,

     

         Miguel


  4. On 2/7/2022 at 12:29 AM, Jim C said:

    Thanks Uwe for your reply. Yes, I did download the XML Mapper through Getit (picture below) and "Create..." is grayed out in both the Menu and Button with XML data loaded (picture below). I looked over the documentation and it states: "Note: XML mapper relies on two .DLLs (midas.dll and msxml.dll) to work correctly. Be sure that you have both of these .DLLs installed before you try to use xmlmapper.exe. In addition, msxml.dll must be registered as a COM server. You can register it using Regsvr32.exe."  I'm assuming that it's not working because msxml.dll is missing from my PC but Mapper did work with my previous version of Delphi (10.3), so I am even more confused? 

      :

    image.thumb.png.e953668dad1b002f3b67ec63fe134790.png

     

     

    Just to clarify the issue experienced by Jim ( see text and image quoted above ) and to avoid further confusion:

     

    • If the image posted by Jim faithfully represents the issue he is experiencing, then the problem is that there are some preliminary steps that need to be completed in order to have the "Create and Test Transformation" button enabled.
    • The preliminary steps missing in his screenshot are as follows:
      • Selection of the XML nodes in the left hand side panel to be mapped.
      • Loading or creation of an XML data packet in the right hand side panel.
      • Definition of mappings for each XML node on the left to each data packet field on the right.  These would be shown in the middle panel.
    • Once these steps are completed, the "Create and Test Transformation" button becomes "active" and you can now, as expected, create and test the XML mapping transformation.

     

    Thank you.


  5. Lars and Dick:

     

    I am please to inform you that Embarcadero has released the official "XML Mapper" for Delphi 11.3, internal version 28.0.47991.2819, via the GetIt package manager.

     

    We have made an extensive effort to make XML Mapper reliable and usable with any modern XSD and/or XML file.

     

    Please give it a try and let us know of any issue you may find through Embarcadero's Quality Central.

     

    Thanks.

     

    GetIt - XML Mapper 28.0.47991.2819.png

    • Like 1
    • Thanks 2

  6. Dick:

     

    The filters you expect to see  are there  ...     Just switch to the "Schema View" tab on the left side panel 😊

     

    Those filters apply only when you load an XML XSD schema ...

     

    When loading a raw XML file the filters do not apply, so that is the reason you do not see them when the "Document View" tab is selected.

     

    And do not feel bad ...   We also feel that the source panel ( left side one ) of XML Mapper is a bit confusing ...

     

    We would like to overhaul the user interface to make it more intuitive, but for right now our main priority is to make XML Mapper fully usable, bug and crash free, and to support all modern XML documents and schemas.

     

    Please report any issue or bug that you find using the "Malawi Beta" XML Mapper ...

    • Like 1

  7. Hello Dick.

     

    For the new Delphi Alexandria 11.3,  the included XML Mapper is still the old legacy version.

     

    To get the "XML Mapper Malawi Beta" version in the mean time, you have to launch the "GetIt Package Manager" from the tools menu ...

    1139856873_XMLMapperBetainDelphiAlexandria11.3-Image001.thumb.png.ba997205387b3d69acc1abee7cc747aa.png


    Once you get the "GetIt" main dialog, type "xml mapper" in the search box ...

    1946232766_XMLMapperBetainDelphiAlexandria11.3-Image002.thumb.png.f7a0cb4ceca3d579613d54c31d4cf844.png


    The "XML Mapper Malawi Beta" will show up in the available packages list.  Click on the "Install" button to install it in your Delphi environment ...

    1951660462_XMLMapperBetainDelphiAlexandria11.3-Image003.thumb.png.4410768202304b7e3916e551232378af.png


  8. Lars and CDL:

     

    Yes, the final release of XML Mapper 11.3 is just around the corner and for right now it will still be distributed via GetIt.

     

    In the mean time, as suggested by Lars, you can get the 11.3 Beta XML Mapper to explore the new features.  The companion document highlights the bugs fixed and the limitations of the beta.

     

    I will let you know once the final release is available for you to install.

     

    PS:  Yes !!  If you find something please report it via Quality Central !!

    • Thanks 1
×