Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:13:42+00:00 2026-06-14T18:13:42+00:00

I have the following xml content in a file: <testsuite errors=1 failures=1 name=unittest.suite.TestSuite tests=3

  • 0

I have the following xml content in a file:

<testsuite errors="1" failures="1" name="unittest.suite.TestSuite" tests="3" time="6.540">
  <properties>
    <property name="comp1" value="0.0.0.0:80=0.0.1"/>
    <property name="comp2" value="12.34.56.78:80=0.0.1"/>

and I want to create a table like

Name  Value
comp1 0.0.0.0:80=0.0.1
comp2 12.34.56.78:80=0.0.1

with an xsl. I tried the following

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <body>    
    <table border="1">
      <tr bgcolor="#9acd32">
        <th>Name</th>
        <th>Value</th>
      </tr>
      <xsl:for-each select="testsuite/properties/property">
      <tr>
        <td><xsl:value-of select="name"/></td>
        <td><xsl:value-of select="value"/></td>
      </tr>
      </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet> 

which just gives an empty table. How to do this correctly? I only found examples on the internet which were way to complex. If someone knows a good tutorial on such things, I am welcome as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:13:43+00:00Added an answer on June 14, 2026 at 6:13 pm

    Try

        <td><xsl:value-of select="@name"/></td>
        <td><xsl:value-of select="@value"/></td>
    

    When accessing an attribute you need @ before the name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following contents in my XML file: <items> <item id=1><content><![CDATA[<p>string</p>]]></content></item> </items> I
I have a xml file main.xml with following markup and data. main.xml <xml> <content>
I have a file test.xml with the following content : <body> <content> <p>Lorem ipsum
I have following, very simple, XML config for PHPUnit: <phpunit bootstrap=/_tests/TestAutoload.php> <testsuites> <testsuite name=Unit
I have a file with the following content (myfile.xml). I have to get all
I have a file with the following content (myfile.xml). I have to get all
I have the following Ant build file: <?xml version=1.0 encoding=UTF-8?> <project default=build name=MyAntScript> <!--
For example I have file config.xml in that file I have following xml content
Lets assume a xml file named data.xml with following content: <root> <record> <id>1</id> <name>test
I have an XML file content similar to the following: <?xml version=1.0 encoding=utf-8?> <Content>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.