gchq/CyberChef

Operation request: XSLT processor

Open

#418 opened on 2018年11月20日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)JavaScript (3,944 forks)batch import
help wantedoperation

Repository metrics

Stars
 (34,843 stars)
PR merge metrics
 (平均マージ 57d 13h) (30d で 62 merged PRs)

説明

Summary

An operation to process XSLT over XML input.

https://en.wikipedia.org/wiki/XSLT

Example

Input

<?xml version="1.0" ?>
<persons>
  <person username="JS1">
    <name>John</name>
    <family-name>Smith</family-name>
  </person>
  <person username="MI1">
    <name>Morka</name>
    <family-name>Ismincius</family-name>
  </person>
</persons>

XSLT

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="/persons">
    <root>
      <xsl:apply-templates select="person"/>
    </root>
  </xsl:template>

  <xsl:template match="person">
    <name username="{@username}">
      <xsl:value-of select="name" />
    </name>
  </xsl:template>

</xsl:stylesheet>

Output

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <name username="JS1">John</name>
  <name username="MI1">Morka</name>
</root>

コントリビューターガイド