MichielCM / xsd2html2xml

Generates plain HTML5 forms from XML schemas (XSDs). Transforms filled-in forms into XML.
MIT License
95 stars 42 forks source link

inputs no terminated #10

Closed matiasCo closed 6 years ago

matiasCo commented 6 years ago

Hi! I'm testing this project, using the examples. I have already generated the form with data using xsd+xml2html.xsl, but I'm having trouble using the html2xml.xsl. When I use the result of the xsd+xml2html.xsl to html2xml.xsl, I get this error:

The element type "input" must be terminated by the matching end-tag "".

Inspecting the generated form using xsd+xml2html.xsl, I found that the input elements are never closed, this happens even on the examples.

Is this a bug or am I doing something wrong?

Regards, Matias

MichielCM commented 6 years ago

Hi Matias,

In HTML, input elements should not be closed. In XHTML, they should. You are trying to run HTML through an XML processor, which results in the error you mentioned.

If you want to use html2xml, make sure to set output method in xsd+xml2html to 'xhtml'.

However, you don't really need html2xml. If you use xsd+xml2html with output method 'html' and config-xml-generator 'js' (the default values), JavaScript generates valid XML automatically. So unless you REALLY want to generate your final XML with XSLT, just use JavaScript and don't bother with html2xml.

Best regards, Michiel

matiasCo commented 6 years ago

Thanks Michiel! It worked using XHTML but, as you said, the output generated with JavaScript works better for me.

Regards, Matias