Steve,
Thanks for the suggestion.
It is an auto generated log file so cannot add the delimiter so trying to find 
a creative way to solve the parsing issue.
Was trying to think if a "look ahead" could help.
Thanks

-----Original Message-----
From: Steve Lawrence <slawre...@apache.org> 
Sent: Thursday, April 6, 2023 9:27 AM
To: users@daffodil.apache.org
Subject: Re: How do you handle an Escape character within an Escape block

External Email Alert

This email has been sent from an account outside of the BAE Systems network.

Please treat the email with caution, especially if you are requested to click 
on a link, decrypt/open an attachment, or enable macros.  For further 
information on how to spot phishing, access “Cybersecurity OneSpace Page” and 
report phishing by clicking the button “Report Phishing” on the Outlook toolbar.


Assuming your lengthKind is delimited and comma is your delimiter, Daffodil 
sees the first inner quote (i.e. the quote before $b2) as the end of the escape 
block and will expect a following comma. Since it won't find a comma it will 
create a parse error.

Ideally your inner quotes would be escaped with a character specified by the 
escapeEscapeCharacter property. For example:

   <dfdl:escapeScheme
     dfdl:escapeKind="escapeBlock"
     dfdl:escapeBlockStart="&quot;"
     dfdl:escapeBlockEnd="&quot;"
     dfdl:escapeEscapeCharacter="\"
     ...
     />

Then your data would look like this:

   "Warning ...: string \"$b2\" may slow down scanning",

In this case, the infoset will contain the string with the outer quotes and 
back slashes removed but the inner quotes included. E.g.

   <field>Warning ...: string "$b2" may slow down scanning</field>

- Steve


On 2023-04-05 03:37 PM, Hardesty, Mark C (US) wrote:
> Ex.   ,"Warning in rule [xxxxxxx] in xxxx rules file [xxxxx.xxx]: 
> string "$b2" may slow down scanning",
> 

Reply via email to