I believe the issue here is that you're trying to use a comma as the variable value, but the -D option lets you define multiple variables at once with each separated by a comma, e.g.
-D var1=a,var2=b So our argument parser sees this comma and gets confused and says "Separator=," is not a valid format. I think what you need to do is provide a backlash before the comma, which tells our argument parser that the comma is an actual comma and not separating two variables. Note that some shells treat backslash as an escape character, so you may need to escape the escape character with a second backslash, e.g. -D Separator=\\, Note that the same problem occurs with the equal sign, so you would need something like this to set the separator as a equal sign: -D Separator=\\= No other characters should need special escaping. - Steve On 4/19/19 1:51 PM, Costello, Roger L. wrote: > Hello DFDL community, > > When I invoke Daffodil, I want to dynamically feed into my DFDL schema a > value for a variable. > > I invoke Daffodil this way: > > daffodil.bat parse > -s label-message-characterization-2.dfdl.xsd > -r input > -D Separator=, > -o output/label-message-characterization-2.xml > > That results in this error message: > > [error] Bad arguments for option 'D': 'Separator=,' - wrong arguments format > > How do I fix this? > > Also, here's what I have in my DFDL schema to "catch" the value that I > dynamically feed into the schema: > > <xs:annotation> > <xs:appinfo source="http://www.ogf.org/dfdl/"> > <dfdl:format ref="default-dfdl-properties" /> > <dfdl:defineVariable name="Separator" type="xs:string" > external="true">:</dfdl:defineVariable> > <dfdl:defineFormat name="colonSeparator"> > <dfdl:format separator="{ $Separator }" > separatorPosition="infix" /> > </dfdl:defineFormat> > </xs:appinfo> > </xs:annotation> > > Is that correct? > > /Roger >
