[ 
https://issues.apache.org/jira/browse/DAFFODIL-2479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dave Thompson closed DAFFODIL-2479.
-----------------------------------

Verified the specified commit (commit ba35b9bcb78ce91f707f3f811debef9d5f2428b0) 
is included in the latest pull from the daffodil repository.

Verified changes identified in commit comment were implemented.

Verified the affected daffodil subproject sbt test suites execute successfully 
including added tests.

Verified the nightly test schemas compile and save successfully.

Verified the nightly test suite executes successfully.

> Using %#x25; character class causes invariant abort
> ---------------------------------------------------
>
>                 Key: DAFFODIL-2479
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2479
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Front End
>    Affects Versions: 3.0.0
>            Reporter: Steve Lawrence
>            Assignee: Steve Lawrence
>            Priority: Minor
>             Fix For: 3.2.0
>
>
> I have a file format where it is natural to specify initiators using hex 
> character classes because the specification uses hex values. One case of this 
> is an initator that has a value of 0x25 in hex. In ASCII encoding this is the 
> percent character (%). For example:
> {code:xml}
> <xs:element name="foo" type="xs:string" dfdl:initiator="%#x25;" />
> {code}
> Using the above leads to the following invariant abort:
> {code:none}
> org.apache.daffodil.exceptions.Abort: Invariant broken. delimStr should not 
> end in an isolated single %. DelimStr = %
> org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
> org.apache.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:175)
> org.apache.daffodil.processors.Delimiter.buildDelimBuf(DFDLDelimiter.scala:331)
> org.apache.daffodil.processors.Delimiter.compileDelimiter(DFDLDelimiter.scala:69)
>       at org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
>       at 
> org.apache.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:175)
>       at 
> org.apache.daffodil.processors.Delimiter.buildDelimBuf(DFDLDelimiter.scala:331)
>       at 
> org.apache.daffodil.processors.Delimiter.compileDelimiter(DFDLDelimiter.scala:69)
>       at 
> org.apache.daffodil.processors.dfa.CreateDelimiterDFA$.apply(CreateDelimiterDFA.scala:68)
>       at 
> org.apache.daffodil.processors.dfa.CreateDelimiterDFA$.$anonfun$apply$3(CreateDelimiterDFA.scala:97)
> {code}
> It looks like Daffodil is treating this exactly as if it were a "%". For 
> example, if I change the initiator to this:
> {code:xml}
> <xs:element name="foo" type="xs:string" dfdl:initiator="%#x25;NL;" />
> {code}
> then it looks for a newline initator (i.e. %NL\;)
> Note that {{dfdl:initiator="%"}} does give a helpful error message, so this 
> is specific to using a character class entity that encodes to a percent.
> The workaround is to specify the initiator as "%%" (i.e. an escaped percent). 
> This works fine, but is not ideal in this case because all initiators are 
> better described using hex values.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to