Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pf:transform #50

Open
bertfrees opened this issue Jun 10, 2015 · 1 comment
Open

pf:transform #50

bertfrees opened this issue Jun 10, 2015 · 1 comment
Assignees

Comments

@bertfrees
Copy link
Member

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 (daisy@b9066cd).

This new approach is clearly more flexible:

  • The input text can have semantic info attached, which can be used by the transformer. With pf:text-transform the input to the transformer is limited to the text segments plus style info (CSS). We need to keep a clear distinction between semantics and style.
  • The output text could possibly have different semantics (e.g. the "writing system" part of the language tag could be changed).
  • The output text could have style info attached, e.g. in case only part of the style at the input was applied.
@bertfrees
Copy link
Member Author

Since c6f8e17, 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' , ... }.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant