[
https://issues.apache.org/jira/browse/DAFFODIL-2379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17170018#comment-17170018
]
John Interrante commented on DAFFODIL-2379:
-------------------------------------------
I did not realize how extensive those changes might be. The current
[spec|[http://daffodil.apache.org/docs/dfdl/]] on the Apache site requires most
DFDL expression contexts to identify a single node, not an array (aka sequence
of nodes), otherwise a processor must raise a schema definition error
"Expression value is not single node". There are a few exceptions such as the
fn:count(…) function, where the path expression must be an array or optional
element. Are the intersect and except operators going to be allowed only in
these few expression contexts (e.g., inside fn:count(...)), or is the DFDL
specification going to allow most DFDL expressions to select arrays? That
would indeed cause more extensive code-rewriting than simply adding two new
operators, and the implementer would need a copy of the DFDL specification
latest working group draft in order to see what the required changes are.
h2. Set difference and intersection
These operators are new in XPath 2.0.
The expression {{E1 except E2}} selects all nodes that are in {{E1}} unless
they are also in {{E2}}. Both expressions must return sequences of nodes. The
results are returned in document order. For example, {{@* except @note}}
returns all attributes except the {{note}} attribute.
The expression {{E1 intersect E2}} selects all nodes that are in both {{E1}}
and {{E2}}. Both expressions must return sequences of nodes. The results are
returned in document order. For example, {{preceding::fig intersect
ancestor::chapter//fig}} returns all preceding {{fig}} elements within the
current chapter.
> intersect and except operators for DFDL expression language
> -----------------------------------------------------------
>
> Key: DAFFODIL-2379
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2379
> Project: Daffodil
> Issue Type: New Feature
> Components: Back End, Front End
> Affects Versions: 2.7.0
> Reporter: Mike Beckerle
> Priority: Minor
> Labels: beginner
> Fix For: 3.0.0
>
>
> These operators intersect and except from XPath 2.0 spec were added to the
> DFDL specification (latest working group draft), so are forthcoming in the
> spec.
> These need to be added to the expression language.
> Labeled this beginner since there are well established code-patterns to copy
> in creating these operators. It touches a lot of the DPath language code -
> syntax analyzer/parser, all the way to the runtime, but.... there's things to
> copy at every level.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)