Skip to content

stam fromxml: expand yet simplify configuration language, allow full templating #17

Description

@proycon

The current configuration language for stam fromxml can be improved to be more powerful by introducing templating more consistently, at the same time this can also simplify the language.

Things I want to implement:

  • we already have {@x} for variables currently, but that's about it. We need blocks like {% if @x == "blah" %}{@x}{% else %}{}{% endif %}
  • allow XML namespaces for variables in templates, e.g. {@xml:id}
  • allow accessing parent elements {../@xml:id}
  • allow accessing child elements {./child/@xml:id}
  • have a syntax that raises an error if an attribute doesn't exist.
    • This is the default now unless the attribute is predeceded by ?. or skip_if_missing is set on the annotation data
  • conditional selects: /path/to/element[@x == "blah"] (without implementing all of XPath)

It's probably easiest to use an existing templating engine like upon, liquid or tera.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions