bartneck / swiML

A project to formalise swimming programs using XML
MIT License
2 stars 2 forks source link

import/export not working #89

Open bartneck opened 4 months ago

bartneck commented 4 months ago

I wrote a very simple program to test the import/export function import-export-test-01.py:

import swiML
program=swiML.readXML('JasiMasters2024021301.xml')
swiML.writeXML('JasiMasters2024021301-phyton-out.xml',program)

I get many errors when running this script. The XML is valid swiML.

calloc262 commented 4 months ago

Could you check the filename for the write as that file doesn't exist in your testing folder python is also misspelled (phyton) so that could also be an issue

bartneck commented 4 months ago

The output file does not exist. Python fails to write it. Here is a screenshot of the program and the error.

Screenshot 2024-02-23 at 12 43 09 PM
bartneck commented 2 months ago

I had added the <layoutWidth> element and the python code does not yet know about it and the transformation fails.

import swiML 
swiML.writeXML('importExportTest/JasiMasters2024032401-rewrite.xml',swiML.readXML('importExportTest/JasiMasters2024032401.xml'))
bartneck commented 2 months ago

When running the program seen above, it also changes the XML file that was read. It removes all of the meta data. Here is the original XML:

<?xml version="1.0" encoding="UTF-8"?>
<program xmlns="https://github.com/bartneck/swiML"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="https://github.com/bartneck/swiML/version/2/2.1 https://raw.githubusercontent.com/bartneck/swiML/main/swiML.xsd">

and here it is after it was read.

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

This is NOT the file that was written. It also changes the XML file that is read. This should of course not happen.