Splitcells Network's XSL/XML Code Guidelines

These are the guidelines used for XSL code on this site. These represent part of my current understanding of XSL and may be incorrect.

  1.  Patterns and antipatterns in XSLT micropipelining 
  1.  W3C XML Schema: DOs and DON'Ts 

Use attributes only in order state that its content should not be processed by templates. Use explicit elements in the other case. If it makes sense, attributes and values should be supported. If the distinction does not make sense, attributes should not be used or supported. An attribute and its equivalent should not both be present in the same element.

Templates should be applied as late as possible. Example: Inside a template an intermediate element is created and templates are applied to it. Such intermediate elements often contain child elements with additional information. if intermediate elements are created which can be adapted with elements from the inputs

    d:todo
    1. Use intermediate XML document in order to support different types of XML documents for the layout.

Create for each namespace a template that terminates the execution with an error via xsl:message terminate="true" . This way incorrect elements can be detected without any XSD.

 Value-of extracts the value of the node that is queried by the select attribute. All elements that are children of the selected node are thereby striped.   Copy-of creates a copy of the queried node. In general copy-of should be used to generate XML nodes and value-of should be used to generate strings that are not XML nodes.

In order to output objects where all processing is already done, use a template that matches */text()[normalize-space()] . This template should not be called directly. Instead it should be applied implicitly via apply-templates . This ensures ensures that results does not contain any unprocessed values.

    d:todo
    1. normalize-space($variable-name) != ''

    d:todo
    1. normalize-space($variable-name) != ''

Whitespace is best rendered by the non breaking space entity 160 which works for HTML output.

Document that everything is subject, object or predicated. Everything else is just a library of these.

wide screen

These are the guidelines used for XSL code on this site. These represent part of my current understanding of XSL and may be incorrect.

  1. External Guidelines
    1. XSL Guidelines
    2. XSD Guidelines
  2. Design and Architecture
    1. XML Structures
      1. Attributes and Values
    2. Template Application Time
    3. Layout Template Structure
  3. Details of XSLT
    1. value-of , copy-of and $
    2. Check if Variable is set.
    3. * vs. node()
    4. Special Characters
  4. RDF/XML
  1.  Open Tasks 
  1. guidelines
    1. backwards-compatibility.html
    2. changelog.html
    3. commonmark.html
    4. complexity-management.html
    5. dependency.html
    6. documentation.html
    7. filesystem.html
    8. gist
      1. git.html
      2. pgp.html
    9. index.html
    10. infrastructure.html
    11. java.html
    12. linking.html
    13. maven.html
    14. program-code.html
    15. project.html
    16. software-project-file-system-standards.html
    17. software-project-file-system-standards.todo.html
    18. source-types.html
    19. task-management.html
    20. technology-stack.html
    21. tickets.html
    22. xml.html
    23. xslt.html
  1. guidelines
    1. backwards-compatibility.html
    2. changelog.html
    3. commonmark.html
    4. complexity-management.html
    5. dependency.html
    6. documentation.html
    7. filesystem.html
    8. gist
      1. git.html
      2. pgp.html
    9. index.html
    10. infrastructure.html
    11. java.html
    12. linking.html
    13. maven.html
    14. program-code.html
    15. project.html
    16. software-project-file-system-standards.html
    17. software-project-file-system-standards.todo.html
    18. source-types.html
    19. task-management.html
    20. technology-stack.html
    21. tickets.html
    22. xml.html
    23. xslt.html
    d:toDo
    1. d:todo
      1. Avoid using xml attributes and use them only if exact strings are required and no tempaltes should be applied to its value.

    2. d:todo
      1. Minimize abstract syntax tree complexity by avoiding using XML attributes.