DesignLiquido / xslt-processor

A JavaScript XSLT processor without native library dependencies
GNU Lesser General Public License v3.0
95 stars 30 forks source link

Returning empty div of body. #18

Closed hilleer closed 5 years ago

hilleer commented 5 years ago

I have been trying to figure out why this is happening and adjusting my inputs, but haven't figured how to solve the issue.

Maybe you can point me out in the direction in the code and I'll happily contribute or if you know I made a mistake somewhere...

I am trying to convert this xml: http://www.fatturapa.gov.it/export/fatturazione/sdi/fatturapa/v1.1/IT01234567890_11001.xml using this stylesheet: http://www.fatturapa.gov.it/export/fatturazione/sdi/fatturapa/v1.1/fatturapa_v1.1.xsl

However, the html that I get back is empty:

<html><head><meta http-equiv="X-UA-Compatible" content="IE=edge"/><style type="text/css">
#fattura-container { width: 100%; position: relative; } #fattura-elettronica { font-family: sans-serif; margin-left: auto; margin-right: auto; max-width: 1280px; min-width: 930px; padding: 0; } #fattura-elettronica .versione { font-size: 11px; float:right; color: #777777; } #fattura-elettronica h1 { padding: 20px 0 0 0; margin: 0; font-size: 30px; } #fattura-elettronica h2 { padding: 20px 0 0 0; margin: 0; font-size: 20px; } #fattura-elettronica h3 { padding: 20px 0 0 0; margin: 0; font-size: 25px; } #fattura-elettronica h4 { padding: 20px 0 0 0; margin: 0; font-size: 20px; } #fattura-elettronica h5 { padding: 15px 0 0 0; margin: 0; font-size: 17px; font-style: italic; } #fattura-elettronica ul { list-style-type: none; margin: 0 !important; padding: 15px 0 0 40px !important; } #fattura-elettronica ul li {} #fattura-elettronica ul li span { font-weight: bold; } #fattura-elettronica div { padding: 0; margin: 0; } #fattura-elettronica div.page { background-color: #fff !important; position: relative; margin: 20px 0 50px 0; padding: 60px; background: -moz-linear-gradient(0% 0 360deg, #FFFFFF, #F2F2F2 20%, #FFFFFF) repeat scroll 0 0 transparent; border: 1px solid #CCCCCC; -webkitbox-shadow: 0 0 10px rgba(0, 0, 0, 0.3); -mozbox-shadow: 0 0 10px rgba(0, 0, 0, 0.3); box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); background: url('logo_sdi_trasparente.jpg') 98% 50px no-repeat; } #fattura-elettronica div.footer { padding: 50px 0 0 0; margin: 0; font-size: 11px; text-align: center; color: #777777; }
</style></head><body><div id="fattura-container"/></body></html>

Note that it actually recognises something and builds <body><div id="fattura-container"/></body> but nothing more than that.

johanneswilm commented 5 years ago

Hey, I don't have that much time and you could help me a lot by creating a test case and add it to tests/xslt.tests.js. Then I can hopefully help you a little more.

masinamichele commented 5 years ago

I have the same exact problem. Are there any fixes available yet? Thanks.

hilleer commented 5 years ago

I did not solve it with the package, but figured that the package did not support different namespaces for certain elements. I renamed those, which solved the issue.