Skip to content

Transform xml-stylesheet processing instructions#9102

Merged
devongovett merged 3 commits into
parcel-bundler:v2from
AndrewKvalheim:transformer-xml/xml-stylesheet
Oct 9, 2023
Merged

Transform xml-stylesheet processing instructions#9102
devongovett merged 3 commits into
parcel-bundler:v2from
AndrewKvalheim:transformer-xml/xml-stylesheet

Conversation

@AndrewKvalheim

Copy link
Copy Markdown
Contributor

↪️ Pull Request

XML documents may link to external assets via xml-stylesheet processing instructions. This is commonly used to transform XML into HTML via XSLT.

#6535 explored this prior to the addition of transformer-xml to support the use case of applying CSS to SVGs and ended up specializing as transformer-svg, but XSLT remains unsupported.

💻 Examples

Transformation:

- <?xml-stylesheet type="text/xsl" href="atom.xsl"?>
+ <?xml-stylesheet type="text/xsl" href="/atom.090d4d94.xsl"?>

This blog post explains practical usage and links to examples in the wild.

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

Comment thread packages/transformers/xml/src/processing-instruction.js Outdated
XML documents may link to external assets via xml-stylesheet processing
instructions:

    https://www.w3.org/TR/xml-stylesheet/

This is commonly used to transform XML into HTML via XSLT:

    https://developer.mozilla.org/en-US/docs/Web/API/XSLTProcessor/Generating_HTML
@AndrewKvalheim AndrewKvalheim force-pushed the transformer-xml/xml-stylesheet branch from d1efaa4 to 3f4a139 Compare June 22, 2023 00:05
@AndrewKvalheim AndrewKvalheim marked this pull request as ready for review June 22, 2023 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants