Tom Hartland
  • Blog
  • Photos

Listing XML nodes in XSLT

How to show the name/value of all nodes in an XML element using XSLT

Occassionally you don't know what XML data is being passed through to XSLT for process, so the following can be used to quickly show the data...

<xsl:for-each select="//mydata/*">
  <xsl:value-of select="name()"/> = <xsl:value-of select="."/><br/>
</xsl:for-each>

And if you need the attributes, simply add a @ character...

<xsl:for-each select="//mydata/@*">
  <xsl:value-of select="name()"/> = <xsl:value-of select="."/><br/>
</xsl:for-each>
Added 17/05/2022 15:32
  • 2025
    • July
      • TSQL XML Manipulation
  • 2024
    • October
      • Align SQL Login to User
    • May
      • SQL XML Ordering
  • 2023
    • December
      • Chrome Self-Signed SSL HSTS
    • May
      • String Template Format
    • February
      • Convert List<object> to List<int>
      • URI encoding in Javascript
      • Merging jQuery objects
  • 2022
    • May
      • Listing XML nodes in XSLT
      • XML node value in TSQL
      • Class-less JSON (Newtonsoft)
  • 2021
    • April
      • Variables in TSQL XML
  • 2020
    • March
      • Override Default Mobile Font Size
    • January
      • DNS Info Via Command Line
  • 2019
    • May
      • Restore USB Stick Full Capacity
    • April
      • Removing Entire Unix Directory
    • January
      • Handling 404 Errors in Development
  • 2018
    • November
      • Generating Row Numbers in SQL
    • September
      • Show/Hide via Checkbox and CSS
    • August
      • Javascript Nested Loop Break
    • July
      • CSS "nth-child" Processing
    • June
      • Client-Side Script After UpdatePanel Refresh
      • UpdatePanel Button Click via Javascript
      • ASP.NET Fire Validation
    • April
      • SQL Server CSV From Data
      • SQL Server Dynamic Script Permissions
    • March
      • Purpose of this blog
© 2025 Tom Hartland. All Rights Reserved