gchq/CyberChef

Operation request: XSLT processor

Open

#418 aberto em 20 de nov. de 2018

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)JavaScript (3.944 forks)batch import
help wantedoperation

Métricas do repositório

Stars
 (34.843 stars)
Métricas de merge de PR
 (Mesclagem média 57d 13h) (62 fundiu PRs em 30d)

Description

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>

Guia do colaborador