Skip to content

Mustang CLI: "&", "ä", "ö", "ü" in filename causes mustang to not find the file #780

@cave2253

Description

@cave2253

When trying to validate a file with a "&", "ä", "ö", "ü" e.g. "test&file.xml" mustang cli cant find the file, even when escaping the character doesn't fix the issue:

java -Xmx1G -Dfile.encoding=UTF-8 -jar mustang.jar --action validate --source "test&file.xml" 
Picked up _JAVA_OPTIONS: -Dhttp.proxyHost=proxy.logicway.net -Dhttp.proxyPort=3128 -Dhttps.proxyHost=proxy.logicway.net -Dhttps.proxyPort=3128
[main] INFO com.helger.schematron.xslt.SchematronResourceXSLTCache - Compiling XSLT instance [cpPath=/xslt/en16931schematron/EN16931-UBL-validation.xslt; urlResolved=true; URL=jar:file:/home/murat/Dokumente/test/mustang.jar!/xslt/en16931schematron/EN16931-UBL-validation.xslt]
[main] INFO com.helger.schematron.xslt.SchematronResourceXSLTCache - Compiling XSLT instance [cpPath=/xslt/XR_30/XRechnung-UBL-validation.xslt; urlResolved=true; URL=jar:file:/home/murat/Dokumente/test/mustang.jar!/xslt/XR_30/XRechnung-UBL-validation.xslt]
[main] WARN com.helger.xml.transform.LoggingTransformErrorListener - [warn] Transformation warning (net.sf.saxon.trans.XPathException: A function that computes atomic values should use xsl:sequence rather than xsl:value-of)
[main] WARN com.helger.xml.transform.LoggingTransformErrorListener - [warn] Transformation warning (net.sf.saxon.trans.XPathException: A function that computes atomic values should use xsl:sequence rather than xsl:value-of)
[main] ERROR org.mustangproject.validator.ZUGFeRDValidator - Error on line 1 of document  : The reference to entity "file.xml" must end with the ';' delimiter.
[main] ERROR org.mustangproject.validator.ZUGFeRDValidator - Cannot invoke "org.dom4j.Document.getDocType()" because "doc" is null
[main] INFO org.mustangproject.validator.ZUGFeRDValidator - Parsed PDF:absent XML:valid Signature:null Checksum:5713E44988DD0F258D2B4FABC2E001F1F7E5037A Profile:urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0 Version:2 Took:4926ms Errors:[] ErrorIDs: []
<?xml version="1.0" encoding="UTF-8"?>

or escaping the character by itself

java -Xmx1G -Dfile.encoding=UTF-8 -jar mustang.jar --action validate --source test\&file.xml
Picked up _JAVA_OPTIONS: -Dhttp.proxyHost=proxy.logicway.net -Dhttp.proxyPort=3128 -Dhttps.proxyHost=proxy.logicway.net -Dhttps.proxyPort=3128
[main] INFO com.helger.schematron.xslt.SchematronResourceXSLTCache - Compiling XSLT instance [cpPath=/xslt/en16931schematron/EN16931-UBL-validation.xslt; urlResolved=true; URL=jar:file:/home/murat/Dokumente/test/mustang.jar!/xslt/en16931schematron/EN16931-UBL-validation.xslt]
[main] INFO com.helger.schematron.xslt.SchematronResourceXSLTCache - Compiling XSLT instance [cpPath=/xslt/XR_30/XRechnung-UBL-validation.xslt; urlResolved=true; URL=jar:file:/home/murat/Dokumente/test/mustang.jar!/xslt/XR_30/XRechnung-UBL-validation.xslt]
[main] WARN com.helger.xml.transform.LoggingTransformErrorListener - [warn] Transformation warning (net.sf.saxon.trans.XPathException: A function that computes atomic values should use xsl:sequence rather than xsl:value-of)
[main] WARN com.helger.xml.transform.LoggingTransformErrorListener - [warn] Transformation warning (net.sf.saxon.trans.XPathException: A function that computes atomic values should use xsl:sequence rather than xsl:value-of)
[main] ERROR org.mustangproject.validator.ZUGFeRDValidator - Error on line 1 of document  : The reference to entity "file.xml" must end with the ';' delimiter.
[main] ERROR org.mustangproject.validator.ZUGFeRDValidator - Cannot invoke "org.dom4j.Document.getDocType()" because "doc" is null
[main] INFO org.mustangproject.validator.ZUGFeRDValidator - Parsed PDF:absent XML:valid Signature:null Checksum:5713E44988DD0F258D2B4FABC2E001F1F7E5037A Profile:urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0 Version:2 Took:4751ms Errors:[] ErrorIDs: []
<?xml version="1.0" encoding="UTF-8"?>

it would be nice if this could be fixed so that files with with these characters could be accepted

  • Os: Arch Linux
  • Mustang version: 2.16.3
  • Shell: Bash 5.2.37

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions