snaekobbi / pipeline-mod-braille

ARCHIVED. Please don't make any new issues or pull requests in this repo.
0 stars 0 forks source link

pf:transform #50

Open bertfrees opened 9 years ago

bertfrees commented 9 years ago

Or: an XPath function that works on nodes in general instead of text nodes (pf:text-transform).

First I have to check whether this is possible at all. (EDIT: yes it is possible)

The function signature would be node()* pf:transform(xs:string type,xs:string query, node()* input). It would use transformers of type "DOMTransform", "SAXTransform", etc.

EDIT: removed 'type' argument because type integrated in query (https://github.com/daisy/pipeline-mod-braille/commit/b9066cdb015d5e6c5012ad420b73f560d81f9457).

This new approach is clearly more flexible:

bertfrees commented 6 years ago

Since c6f8e173ecf270d041d02ef6cc0300a45c9f58e0, the pf:text-transform function supports an optional "text-attributes" argument. Currently it is interpreted as the locale, but the idea is that we can extend it to a XSLT 3.0 map that can contain other semantic info: map { 'locale': 'en' , ... }.