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 4013878
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:25:35+00:00 2026-05-20T09:25:35+00:00

I’d like to parse a SOAPUI Project file and generate some documentation from the

  • 0

I’d like to parse a SOAPUI Project file and generate some documentation from the file. I’ve written an XSLT to parse the project (my plan being that I run a scheduled job using Msxsl to automatically generate the latest “documentation” for my smoke tests).

The problem >>
my xml files will contain multiple projects and within those projects there are lists of test cases. I’d ideally like to wrap those test cases in a collapsible div so that the overall document is more readable. Currently my div is being created and I’m trying to give it a unique name using the position of the Testsuite node.

<?xml version="1.0" encoding="ISO-8859-1"?>

  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:con="http://eviware.com/soapui/config">
    <xsl:output method="html" encoding ="utf-8"/>
    <xsl:template match="/">
      <html>
        <head>
          <script language="javascript">
            function toggleDiv(divid){
            if(document.getElementById(divid).style.display == 'none')
              {
                document.getElementById(divid).style.display = 'block';
              }
            else
              {
                 document.getElementById(divid).style.display = 'none';
              }
            }
          </script>

          <style type="text/css">
            body {font-family:Arial,Helvetica; }

            h1 {color:black;
            font-size:0.975em;

            }

            h2.ex {color:black;
            font-size:0.875em;


            }

            li.tc {
            font-size:0.875em;
            }

            p.desc {
            margin: 2%;
            border: 1px dotted black;
            font-size:0.775em;
            line-height:90%
            }


          </style>
        </head>
        <body>

          <xsl:apply-templates/>

        </body>
      </html>
    </xsl:template>

    <xsl:template match="con:soapui-project">
      <h1>
        Project Name:<xsl:value-of select="@name"/>
      </h1>
      <br />
      <xsl:apply-templates/>

    </xsl:template>



    <xsl:template match="con:testSuite">
      <hr></hr>

      <a href="javascript:;" onmousedown="toggleDiv('<xsl:value-of select="position()"/>');">
        <xsl:attribute name="onmousedown"><xsl:value-of select="position()"/></xsl:attribute> 
        <h2 class="ex">
          TestSuite:      <xsl:value-of select="@name"/>
        </h2>
      </a>
      <br>
        <p class="desc">
          Description: <xsl:value-of select="con:description"/>

        </p>
      </br>

      <br />
      <div id="mydiv" style="display:none">
        <xsl:apply-templates />
      </div>
    </xsl:template>


    <xsl:template match="con:testCase">

        <ul>
          <li class="tc">
            (#<xsl:value-of select="position()-3"/>) Testcase:      <xsl:value-of select="@name"/>
          </li>

          <xsl:if test="con:description=''">
            (RICHARD - PLEASE PROVIDE A DESCRIPTION!!)
          </xsl:if>

          <p class="desc">
            Description: <xsl:value-of select="con:description"/>
          </p>
        </ul>
        <xsl:apply-templates />

    </xsl:template>


    <xsl:template match="*"></xsl:template>


  </xsl:stylesheet>

This currently fails because of a validation error when I try to put XSLT syntax into the Javascript. I feel like I’m close, but usual escape methods aren’t working for me.

Can someone offer the final piece?

Cheers,
– Richard

  • 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-05-20T09:25:36+00:00Added an answer on May 20, 2026 at 9:25 am

    One obvious problem:

      <a href="javascript:;"
      onmousedown="toggleDiv(<xsl:value-of select="position()"/>');"> 
    <xsl:attribute name="onmousedown">
       <xsl:value-of select="position()"/>
      </xsl:attribute> 
    

    Must be:

       <a href="javascript:;"/>
    
       <xsl:attribute name="onmousedown">
        <xsl:value-of select="position()"/>
       </xsl:attribute> 
    

    The reason for this problem is that markup (elements) is not allowed as value of an attribute in any well-formed XML document.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have text I am displaying in SIlverlight that is coming from a CMS
I have some data like this: 1 2 3 4 5 9 2 6
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i want to parse a xhtml file and display in UITableView. what is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I have a bunch of posts stored in text files formatted in yaml/textile (from
I want to count how many characters a certain string has in PHP, but

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.