Saxonica - sgml/signature GitHub Wiki
S.O.L.I.D. XSLT 1.0
When designing XSLT code, applying SOLID principles can lead to more maintainable and flexible transformations. Let's explore how each SOLID principle can be relevant in this context:
-
Single Responsibility Principle
- Ensure that each XSLT template or function has a single responsibility. For example, separate logic for transforming data from logic related to formatting or output.
- Avoid mixing concerns like data manipulation and presentation within the same template.
-
Open-Closed Principle
- Design your XSLT code to be open for extension but closed for modification.
- Use template modes or named templates to allow easy extension without altering existing templates.
-
Liskov Substitution Principle
- Ensure that any XSLT template or function can be replaced by its subtype (specialized version) without affecting correctness.
- Follow consistent naming conventions and parameter structures to maintain compatibility.
-
Interface Segregation Principle
- In XSLT, interfaces are not directly applicable, but you can think of them as abstract templates or common patterns.
- Avoid creating overly complex templates that try to do too much. Break them down into smaller, focused templates.
-
Dependency Inversion Principle
- In XSLT, dependencies are typically external data sources (XML files, databases, etc.).
- Design your XSLT code to depend on abstractions (e.g., XPath expressions) rather than concrete implementations.
- Use parameters or global variables to inject dependencies.
XSLT 3.0
- https://www.xml.com/articles/2017/02/14/why-you-should-be-using-xslt-30/
- https://www.balisage.net/Proceedings/vol10/html/Novatchev01/BalisageVol10-Novatchev01.html
- https://dnovatchev.wordpress.com/2012/10/15/recursion-with-anonymous-inline-functions-in-xpath-3-0-2/
- http://dh.obdurodon.org/xslt3.xhtml
- http://www.saxonica.com/papers/xmlprague-2019mhk.pdf
- https://www.saxonica.com/html/documentation/about/gettingstarted/gettingstartedjava.html
- https://docs.aws.amazon.com/cloud9/latest/user-guide/sample-java.html
Installation
- https://www.saxonica.com/documentation9.5/using-xsl/commandline.html
- http://johnbokma.com/mexit/2011/07/04/installing-saxon-he-ubuntu.html
- https://www.saxonica.com/saxon-c/doc/html/saxonc.html
- https://github.com/ajelenak/pysaxon
Tail Recursion / DVC
- https://stackoverflow.com/search?q=dvc+xslt+tail
- https://dnovatchev.wordpress.com/2007/01/26/some-experience-with-tail-recursion-optimization-by-xslt-2-0-processors/
- https://stackoverflow.com/questions/12709797/print-every-year-in-a-loop-with-xslt
- https://stackoverflow.com/questions/5435881/xslt-processing-recursion-depth