This is an automated email from the ASF dual-hosted git repository.

mbeckerle pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil.git


The following commit(s) were added to refs/heads/main by this push:
     new c1173a2ab Earlier commit (f5ca77) missed this useful comment.
c1173a2ab is described below

commit c1173a2ab19102fcded01a64e448767a0b7ff000
Author: Michael Beckerle <[email protected]>
AuthorDate: Wed Aug 16 16:51:38 2023 -0400

    Earlier commit (f5ca77) missed this useful comment.
    
    DAFFODIL-1559
---
 .../src/main/scala/org/apache/daffodil/core/dsom/Facets.scala  | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git 
a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Facets.scala 
b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Facets.scala
index 86877a369..0d088ca99 100644
--- a/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Facets.scala
+++ b/daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/Facets.scala
@@ -191,6 +191,16 @@ trait Facets { self: Restriction =>
           // The XSD numeric character entity &#xE000; can be used to match 
ASCII NUL
           // (char code 0).
           //
+          // This remapping is for pattern facets, which are inside a DFDL 
schema,
+          // and so will not contain CR characters, since XML reading will 
convert those
+          // to LF. To discuss CR in this pattern we can't use `&#x0d;` syntax 
because that
+          // turns into a CR which gets turned into a LF. Plus the pattern 
value is
+          // an XML attribute, the value of which gets its whitespace 
collapsed, all
+          // line-ending chars converted to spaces, and adjacent spaces 
collapsed to one.
+          //
+          // So a pattern facet must use `\r` and '\n' to describe 
line-endings within the pattern.
+          // And in general one must be careful about whitespace.
+          //
           val remapped: String = XMLUtils.remapPUAToXMLIllegalCharacters(v)
           (f, remapped.r)
         }

Reply via email to