Commit e16ce57
committed
Formatter / Full view missing/extra matching nodes
In #9000, we added a tentative fix for improving labels when translations contains labels with xpath context.
eg.
```xml
<element name="gmd:description" context="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:description">
<label>Beschrijving temporele dekking</label>
<description>temporele dekking van de data, gespecificeerd als een periode.</description>
</element>
```
This was not working due to the formatter reading the editor config, find matching field/section to render using saxon `evaluate` function. One drawback is that when using this function, the returned node does not have its context (eg. `..` to get its parent). So the logic to get label based on xpath can't work.
To avoid this a check was made to retrieve the corresponding the original node in the document and `deep-equal` function was used for that. But we noticed some case not handled
* #9163 2 sections matching the xpath of the editor config (due to wrong usage of deep-equal)
* More than one node matching at different location in the document (eg. a DCAT-AP document with the same license in Catalog and Service will display the 2 license for the service).
* No matching element when using a section with a forEach attribute.
Note: In edit mode, unique ref in `gn:element` is used to retrieve
original node which is more reliable but can't be used in view mode.
Proposal is to find the original node using `deep-equal` and then checking using node xpath matching when the xpath does not make use of wildcard. If wildcard, then `evaluate` returned nodes are used (and may cause the label issue).
Related
* #9000
* #91631 parent de01d4b commit e16ce57
File tree
1 file changed
+25
-4
lines changed- web/src/main/webapp/WEB-INF/data/data/formatter/xslt
1 file changed
+25
-4
lines changedLines changed: 25 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
559 | | - | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
560 | 562 | | |
561 | 563 | | |
562 | 564 | | |
563 | | - | |
| 565 | + | |
564 | 566 | | |
565 | 567 | | |
566 | 568 | | |
| |||
570 | 572 | | |
571 | 573 | | |
572 | 574 | | |
573 | | - | |
574 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
575 | 596 | | |
576 | 597 | | |
577 | 598 | | |
| |||
0 commit comments