xsltproc: extrat xml attributes code example

Example: xsltproc: extrat xml attributes

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output omit-xml-declaration="no" indent="yes" method="text" />
  <xsl:strip-space elements="*" />

  <xsl:template match="user[@name][@email]">
    <xsl:value-of select="parent::*/@id" />
    <xsl:text> - </xsl:text>
    <xsl:value-of select="@name" />
    <xsl:text>
</xsl:text>
  </xsl:template>

</xsl:stylesheet>

Tags:

Php Example