That is correct. There are some different options available if you want zero length string to be considered an error:
If you just want a validation error then you can use the minLength facet. If you want a Parse Error with backtracking you could either use a combo of minLength facet and assert that calls dfdl:checkConstraints(.), or you could just have an assert like fn:string-length(.) ne 0. - Steve On 1/11/19 12:03 PM, Costello, Roger L. wrote: > Hello DFDL community, > > Here is an element declaration that uses dfdl:lengthPattern > > <xs:elementname="label" > type="xs:string" > dfdl:lengthUnits="characters" > dfdl:lengthKind="pattern" > dfdl:lengthPattern="[\x20-\x7F]+?(?=[:])"/> > > dfdl:lengthPattern does _not_ tell Daffodil, “The input must contain a string > that matches this regex.” > > Rather, it merely tells Daffodil, “If the input contains a string that > matches > this regex, then use that matched string as the value of the element; > otherwise, > the value of the element is the empty string.” > > Is that correct? > > /Roger >
