Closed emchateau closed 9 years ago
sounds great, because I encounter the same needs... but no time to try right now :( i also have the need for different patterns in a same templating call (for example for full text search results which find results in different types of objects...) don't now how to implement this for now...
On 18/05/2015 10:39, Emmanuel Chateau wrote:
This is a proposed new templating mechanism
- update the element node instead of the text node or attribute node
- render differently according to the type of the map value
- if map value is text() render as xs:string
- if map value is an xs:integer cast to xs:string
- if map value is a sequence copy the node with each value [main goal of the new templating mechanism]
This new templating allows to repeat the element to update, and the allows the use of various types in the data map.
I didn't reproduced yet the injecting functions for inc introduced by @mingarao https://github.com/mingarao recently for .//*[@data-url] because exemple is needed.
You can test it with synopsx.mappings.htmlWrapping:wrapperNew(...) instead of synopsx.mappings.htmlWrapping:wrapper(...) in the RESTXQ
You can view, comment on, or merge this pull request online at:
https://github.com/ahn-ens-lyon/synopsx/pull/77
Commit Summary
- début de travail sur le templating
- content versus other keys
- changed functions names
- documentation
- types of serialization
- typeswitch
- use of analyse-string
- without attributes
- insert sequence
- replace attributes
duplicate node if sequence
File Changes
M mappings/htmlWrapping.xqm https://github.com/ahn-ens-lyon/synopsx/pull/77/files#diff-0 (87)
Patch Links:
- https://github.com/ahn-ens-lyon/synopsx/pull/77.patch
- https://github.com/ahn-ens-lyon/synopsx/pull/77.diff
— Reply to this email directly or view it on GitHub https://github.com/ahn-ens-lyon/synopsx/pull/77.
We merge the new templating as it doesn't affect existing things
This is a proposed new templating mechanism
This new templating allows to repeat the element to update, and it allows the use of various types in the data map.
I didn't reproduced yet the injecting functions for inc introduced by @mingarao recently for .//*[@data-url] because exemple is needed.
You can test it with synopsx.mappings.htmlWrapping:wrapperNew(...) instead of synopsx.mappings.htmlWrapping:wrapper(...) in the RESTXQ