Skip to content
This repository was archived by the owner on Jan 6, 2020. It is now read-only.
This repository was archived by the owner on Jan 6, 2020. It is now read-only.

Including raw HTML when using variables #59

@mwilliamson-firefly

Description

@mwilliamson-firefly

At the moment, we include raw HTML with something like:

<xsl:value-of="html" disable-output-escaping="yes"/>

Unfortunately, disable-output-escaping is a bit of a hack: rather than turning that into a bunch of nodes, it's still just a string with a hint to the serializer not to both escaping it. That hint is lost as the nodes are passed around through variables and further templates. A better solution is to turn the HTML into actual nodes, by doing one of:

  • Ensure that Firefly always outputs valid XML when including HTML, and that it's actually included as XML nodes rather than a string. This is simplest, but might mean needing to duplicating content since some existing templates rely on the HTML being a string rather XML nodes i.e. we'll need to provide both.
  • Add an extension that turns a string into XML. This might change the output slightly since it will need to be well-formed XML, but in practice I think this should be fine. I'm not sure how this would work with whatever C library (libxml2?) has been playing with. I might suggest that, if possible, we just use one XSL engine for both the pattern library and Firefly i.e. use the engine in .NET, which both allows us to write extensions in one way, and also means that the behaviour is more likely to be consistent.
  • Write an XSL template that can turn XML strings into actual nodes. I suspect this is rather ill-advised.
  • Something I haven't thought of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions