ahn-ens-lyon / synopsx

Full XML corpus publishing system using BaseX XML database
Other
7 stars 11 forks source link

templating reload #77

Closed emchateau closed 9 years ago

emchateau commented 9 years ago

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

mingarao commented 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

— Reply to this email directly or view it on GitHub https://github.com/ahn-ens-lyon/synopsx/pull/77.

emchateau commented 9 years ago

We merge the new templating as it doesn't affect existing things