[ 
https://issues.apache.org/jira/browse/CAMEL-25481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18125414#comment-18125414
 ] 

Claus Ibsen commented on CAMEL-25481:
-------------------------------------

PR: https://github.com/apache/camel/pull/27612

Implemented phase 1 (XML input) and phase 2 (XML output):
* XML input: selectors match elements by local name (SOAP), ns directives and 
.ns#name selectors, .@ and ..*, empty elements are null, object functions see 
child elements in document order, and non-XML outputs no longer include the 
DataSonnet XML model (attributes, xmlns, ~ positions).
* XML output: attributes key @(...), namespace-qualified keys, null as empty 
element, arrays/object spreads/repeated keys as repeated elements in script 
order, input elements written with their attributes and namespaces, 
writeDeclaration and skipNullOn writer properties.
* 29 new corpus entries, all XML entries verified against the DataWeave CLI (dw 
2.12).

Also found and fixed while testing: DataSonnet 3.0.1.3 does not memoize lazy 
values (Val.Lazy.force uses a local lazy val), so every use of a function 
argument re-evaluates it. Nested calls of camel-dataweave.libsonnet functions 
were exponential in the nesting depth (e.g. 300 items through 
map/filter/orderBy took over 120s, now 0.6s). The library functions now 
evaluate their arguments once. This is worth reporting upstream to DataSonnet 
as it affects plain DataSonnet scripts too.

_Claude Code on behalf of davsclaus_

> camel-dataweave - XML fidelity (design spike)
> ---------------------------------------------
>
>                 Key: CAMEL-25481
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25481
>             Project: Camel
>          Issue Type: Sub-task
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Major
>
> Align DataWeave XML semantics with DataSonnet's XML model: element text, 
> attributes @(..) on output, namespaces ns#, repeated elements, .* on XML 
> input; writer properties such as skipNullOn.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to