Extract property with xslt - xslt

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.

# is used for attributes, if you don't use then it will be by default treated as an element..
so your code works fine if the XML is like this:
<testsuite errors="1" failures="1" name="unittest.suite.TestSuite" tests="3" time="6.540">
<properties>
<property>
<name>comp1</name>
<value>0.0.0.0:80=0.0.1</value>
</property>
<property>
<name>comp2</name>
<value>12.34.56.78:80=0.0.1</value>
</property>
..........
........
And here is your corrected code, observe the usage of #
<?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>

Try
<td><xsl:value-of select="#name"/></td>
<td><xsl:value-of select="#value"/></td>
When accessing an attribute you need # before the name.

Related

How to transform all same element in a node

In below xml file contain many author elements. I have mentioned in xslt and display the first element only. I want to show all author elements. Kindly provide the xslt coding for element not in the text will be shown in browser.
XML Code:
<?xml version="1.0" encoding="US-ASCII" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="view.xsl"?>
<!DOCTYPE WileyML3G [
<!ENTITY % wileyml3g.ent SYSTEM "http://v.wiley.com:3535/dtds/wileyml3g/wiley.ent">
%wileyml3g.ent;
]>
<bibliography xml:id="aic16349-bibl-0001" style="numbered" cited="no">
<title type="main">REFERENCE<!--<QUERY xml:id="Q2"><p>References "3–35" were not cited anywhere in the text. Please provide a citation. Alternatively, delete the items from the list.</p></QUERY>--></title>
<bib xml:id="aic16349-bib-0001">
<citation type="journal" xml:id="aic16349-cit-0001"><!--<QUERY xml:id="Q3"><p>Reference "1" is not cited in the text. Please indicate where it should be cited; or delete from the reference list.</p></QUERY>-->
<author><familyName>Deer</familyName> <givenNames>TR</givenNames></author>, <author><familyName>Provenzano</familyName> <givenNames>DA</givenNames></author>, <author><familyName>Hanes</familyName> <givenNames>M</givenNames></author>, et al. <articleTitle>The Neurostimulation Appropriateness Consensus Committee (NACC) Recommendations for Infection Prevention and Management</articleTitle>. <journalTitle>Neuromodulation.</journalTitle> <pubYear year="2017">2017</pubYear>;<vol>20</vol>(<issue>1</issue>):<pageFirst>31</pageFirst>‐<pageLast>50</pageLast>.</citation>
</bib>
XSLT Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h1>HTML VIEW</h1>
<table border="1" cellpadding="10px">
<tr>
<th>Authors</th>
<th>Year</th>
<th>Article_Title</th>
<th>Journal_Title</th>
<th>Volume</th>
<th>Issue</th>
<th>First_Page</th>
<th>Last_Page</th>
</tr>
<xsl:for-each select="bibliography/bib/citation">
<tr>
<td><span style="background-color:skyblue;"><xsl:value-of select="author"/></span>, </td>
<td><xsl:value-of select="pubYear"/></td>
<td width="75%"><xsl:value-of select="articleTitle"/></td>
<td width="25%"><xsl:value-of select="journalTitle"/></td>
<td><xsl:value-of select="vol"/></td>
<td><xsl:value-of select="issue"/></td>
<td><xsl:value-of select="pageFirst"/></td>
<td><xsl:value-of select="pageLast"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
You have tagged the question as XSLT 2.0 and if you really use an XSLT 2.0 processor and use version="2.0" in your stylesheet then <xsl:value-of select="author"/> would output all selected author child elements and you could even use <xsl:value-of select="author" separator=", "/> to have the different authors separated by ,. If you use XSLT 1.0 then use <xsl:appy-templates select="author"/> and <xsl:template match="author"><xsl:if test="position() > 1">, </xsl:if></xsl:value-of select="."/></xsl:template> or use xsl:for-each if you prefer that.
As #Martin suggestion if you really want to use 1.0 then you have to go with for-each author like:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h1>HTML VIEW</h1>
<table border="1" cellpadding="10px">
<tr>
<th>Authors</th>
<th>Year</th>
<th>Article_Title</th>
<th>Journal_Title</th>
<th>Volume</th>
<th>Issue</th>
<th>First_Page</th>
<th>Last_Page</th>
</tr>
<xsl:for-each select="bibliography/bib/citation">
<tr>
<td>
<span style="background-color:skyblue;">
<xsl:for-each select="author">
<xsl:value-of select="."/>
<xsl:if test="following-sibling::author"><xsl:text>, </xsl:text></xsl:if>
</xsl:for-each>
</span>
</td>
<td><xsl:value-of select="pubYear"/></td>
<td width="75%"><xsl:value-of select="articleTitle"/></td>
<td width="25%"><xsl:value-of select="journalTitle"/></td>
<td><xsl:value-of select="vol"/></td>
<td><xsl:value-of select="issue"/></td>
<td><xsl:value-of select="pageFirst"/></td>
<td><xsl:value-of select="pageLast"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Or it will be done very easy while working with 2.0 like:
Need to change the XSLT version from 1.0 to 2.0
Use #seperator with , in value-of author.
HTML VIEW
Authors
Year
Article_Title
Journal_Title
Volume
Issue
First_Page
Last_Page

What am I missing on this XSLT transformation?

I think it might be a silly question, but I read the documentation but it still not working for me.
I have this graphxml (generated my mvn):
<?xml version="1.0" encoding="UTF-8"?> <graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<key for="node" id="d0" yfiles.type="nodegraphics"/>
<key for="edge" id="d1" yfiles.type="edgegraphics"/>
<graph id="dependencies" edgedefault="directed">
<node id="966567431"><data key="d0"><y:ShapeNode><y:NodeLabel>myproject.mulesoft.services:utilitymgmt-services:mule:3.0.0-SNAPSHOT</y:NodeLabel></y:ShapeNode></data></node>
<node id="706960270"><data key="d0"><y:ShapeNode><y:NodeLabel>myproject.mulesoft.context:custom-runtime-context:jar:1.0.0-SNAPSHOT:compile</y:NodeLabel></y:ShapeNode></data></node>
<edge source="966567431" target="706960270"><data key="d1"><y:PolyLineEdge><y:EdgeLabel>compile</y:EdgeLabel></y:PolyLineEdge></data></edge>
<node id="1985178707"><data key="d0"><y:ShapeNode><y:NodeLabel>myproject.mulesoft.library:common-error-library:jar:2.0.0-SNAPSHOT:compile</y:NodeLabel></y:ShapeNode></data></node>
<node id="953191605"><data key="d0"><y:ShapeNode><y:NodeLabel>myproject.mulesoft.notification:utility-common-domains:jar:3.0.0-SNAPSHOT:compile</y:NodeLabel></y:ShapeNode></data></node>
<edge source="1985178707" target="953191605"><data key="d1"><y:PolyLineEdge><y:EdgeLabel>compile</y:EdgeLabel></y:PolyLineEdge></data></edge>
<edge source="966567431" target="1985178707"><data key="d1"><y:PolyLineEdge><y:EdgeLabel>compile</y:EdgeLabel></y:PolyLineEdge></data></edge>
</graph></graphml>
And all I'm trying to do at this point is to generate a HTML that shows a table with the dependencies like:
Dependencies
myproject.mulesoft.services:utilitymgmt-services:mule:3.0.0-SNAPSHOT
myproject.mulesoft.context:custom-runtime-context:jar:1.0.0-SNAPSHOT:compile
compile
myproject.mulesoft.library:common-error-library:jar:2.0.0-SNAPSHOT:compile
myproject.mulesoft.notification:utility-common-domains:jar:3.0.0-SNAPSHOT:compile
compile
compile
So this is the xsl I have:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Dependency</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Items</th>
</tr>
<xsl:for-each select="*">
<tr>
<td><xsl:value-of select="/"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
And I was expecting to have each item of the list into a separate TR TD.
But instead it's all into the same TR TD.
Items
com.quadreal.mulesoft.services:qr-identitymgmt-services:mule:3.0.0-SNAPSHOT com.quadreal.mulesoft.context:quadreal-runtime-context:jar:1.0.0-SNAPSHOT:compile compile com.quadreal.mulesoft.library:qr-common-error-library:jar:2.0.0-SNAPSHOT:compile com.quadreal.mulesoft.notification:quadreal-utility-common-domains:jar:3.0.0-SNAPSHOT:compile compile compile
Also even if I remove the for-each tag and keep only the
It still displaying the whole thing instead displaying only the first element.
Also tried to add a template for graph and for-each the elemtns, but then I don't even get the html. I get only the whole text for the dependencies.
Am I missing something or there is something with the graphml that is not properly generated?
I'm adding here the expected HTML code:
<html>
<body>
<h2>Dependency</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Items</th>
</tr>
<tr>
<td>myproject.mulesoft.services:utilitymgmt-services:mule:3.0.0-SNAPSHOT
</td>
</tr>
<tr>
<td>myproject.mulesoft.context:custom-runtime-context:jar:1.0.0-SNAPSHOT:compile
</td>
</tr>
<tr>
<td>compile</td>
</tr>
<tr>
<td>myproject.mulesoft.library:common-error-library:jar:2.0.0-SNAPSHOT:compile
</td>
</tr>
<tr>
<td>myproject.mulesoft.notification:utility-common-domains:jar:3.0.0-SNAPSHOT:compile
</td>
</tr>
<tr>
<td>compile</td>
</tr>
<tr>
<td>compile</td>
</tr>
</table>
</body>
</html>
You are getting only one table row, because you do:
<xsl:for-each select="*">
from the context of the / root node, established by:
<xsl:template match="/">
The / root node has only one child, and that is the graphml root element.
Perhaps you wanted to do:
<xsl:for-each select="*/*/*">
to create a row for every node and/or edge?
Note also that:
<xsl:value-of select="/"/>
makes no sense. It will return the entire text of the entire document. If you'll change it to:
<xsl:value-of select="."/>
you will get the expected result - at least in the given example.

Parse the XML Elements inside the CData Using XSLT and Print to HTML

Input xml is
<getArtifactContentResponse>
<return>
<![CDATA[
<metadata>
<overview>
<name>scannapp</name>
<developerId>developer702</developerId>
<stateId>2</stateId>
<serverURL>abc.com</serverURL>
<id>cspapp1103</id>
<description>scann doc</description>
<hostingTypeId>1</hostingTypeId>
</overview>
</metadata>
]]>
</return>
</getArtifactContentResponse>
Below is the stylesheet which I have developed. I am able to retrieve the XML inside Cdata but not able to fetch the elements value.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:output method="html" encoding="utf-8" omit-xml-declaration="no" indent="no"/>
<xsl:template match="/">
<html>
<body>
<h1>Company Details</h1>
<table border="1">
<tr>
<th>name</th>
<th>developerId</th>
<th>Id</th>
</tr>table
<xsl:variable name ="data" select="//getArtifactContentResponse/return/node()" />
<tr>
<td>
<xsl:value-of select="$data/metadata/overview/name" disable-output-escaping="yes"/>
</td>
<td>
<xsl:value-of select="$data/metadata/overview/developerId" />
</td>
<td>
<xsl:value-of select="$data/metadata/overview/Id" />
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Output coming as
<html><body><h1>Company Details</h1><table border="1"><tr><th>name</th><th>developerId</th><th>serverURL</th></tr>table
<tr><td></td><td></td><td></td></tr></table></body></html>
Expected output
<html><body><h1>Company Details</h1><table border="1"><tr><th>name</th><th>developerId</th><th>serverURL</th></tr>table
<tr><td>scannapp</td><td>developer702</td><td>cspapp1103</td></tr></table></body></html>
I want to take the value name,developerId,Id and print to HtML. How to do that Please help me. Using XSLT version1.0.
AFAIK, there's no way to parse CDATA as XML.
Using an extension function to parse the section as text would be nice, but not really necessary. Here's an example that extracts the three items you're after:
...
<xsl:variable name ="cdata" select="/getArtifactContentResponse/return" />
<name>
<xsl:value-of select="substring-before(substring-after($cdata, '<name>'), '</name>')"/>
</name>
<developerId>
<xsl:value-of select="substring-before(substring-after($cdata, '<developerId>'), '</developerId>')"/>
</developerId>
<id>
<xsl:value-of select="substring-before(substring-after($cdata, '<id>'), '</id>')"/>
</id>
...

XSL help printing variables from multiple nodes on a single row

Very new to XSL (and XML for that matter), but I need to step though an XML and print the required selections on a single line, for each run in the xml data. The problem I am having is that one selection (time) is in a different node than the other 7. I can't yet figure out what I need to do, to get the desired output. Here is my data and stylesheet if anyone wouldn't mind helping me out:
XSL STYLESHEET
<?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>
<h2>Storage IO</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Time</th>
<th>Reads per Second</th>
<th>Writes per Second</th>
<th>KB Read per Second</th>
<th>KB Written per Second</th>
<th>Read Cache Hit %</th>
<th>Write Cache Hit %</th>
<th>Sequential Read %</th>
<th>Write Pending Tracks</th>
</tr>
<xsl:for-each select="/SymCLI_ML/Statistics/Request_Totals">
<tr>
<td><xsl:value-of select="time"/></td>
<td><xsl:value-of select="r_per_second"/></td>
<td><xsl:value-of select="w_per_second"/></td>
<td><xsl:value-of select="kb_r_per_second"/></td>
<td><xsl:value-of select="kb_w_per_second"/></td>
<td><xsl:value-of select="r_cache_hit_pct"/></td>
<td><xsl:value-of select="w_cache_hit_pct"/></td>
<td><xsl:value-of select="sequential_r_pct"/></td>
<td><xsl:value-of select="wp_tracks"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
XML FILE
<?xml version="1.0" standalone="yes" ?>
<?xml-stylesheet type="text/xsl" href="totals.xsl"?>
<SymCLI_ML>
<Statistics>
<time>Mon Mar 19 2012 15:24:53</time>
</Statistics>
<Statistics>
<time>Mon Mar 19 2012 15:25:04</time>
<Request>
<dev_name>0052</dev_name>
<pd_name>Not Visible</pd_name>
<r_per_second>0</r_per_second>
<w_per_second>0</w_per_second>
<kb_r_per_second>0</kb_r_per_second>
<kb_w_per_second>0</kb_w_per_second>
<r_cache_hit_pct>N/A</r_cache_hit_pct>
<w_cache_hit_pct>N/A</w_cache_hit_pct>
<sequential_r_pct>N/A</sequential_r_pct>
<wp_tracks>0</wp_tracks>
</Request>
<Request>
<dev_name>1AAF</dev_name>
<pd_name>Not Visible</pd_name>
<r_per_second>0</r_per_second>
<w_per_second>0</w_per_second>
<kb_r_per_second>0</kb_r_per_second>
<kb_w_per_second>0</kb_w_per_second>
<r_cache_hit_pct>N/A</r_cache_hit_pct>
<w_cache_hit_pct>N/A</w_cache_hit_pct>
<sequential_r_pct>N/A</sequential_r_pct>
<wp_tracks>0</wp_tracks>
</Request>
<Request>
<dev_name>1B2F</dev_name>
<pd_name>Not Visible</pd_name>
<r_per_second>0</r_per_second>
<w_per_second>0</w_per_second>
<kb_r_per_second>0</kb_r_per_second>
<kb_w_per_second>0</kb_w_per_second>
<r_cache_hit_pct>N/A</r_cache_hit_pct>
<w_cache_hit_pct>N/A</w_cache_hit_pct>
<sequential_r_pct>N/A</sequential_r_pct>
<wp_tracks>0</wp_tracks>
</Request>
<Request_Totals>
<r_per_second>1032</r_per_second>
<w_per_second>1309</w_per_second>
<kb_r_per_second>28003</kb_r_per_second>
<kb_w_per_second>19347</kb_w_per_second>
<r_cache_hit_pct>74</r_cache_hit_pct>
<w_cache_hit_pct>99</w_cache_hit_pct>
<sequential_r_pct>6</sequential_r_pct>
<wp_tracks>9994</wp_tracks>
</Request_Totals>
</Statistics>
</SymCLI_ML>
Try using either:
<td><xsl:value-of select="../time"/></td>
or
<td><xsl:value-of select="/*/Statistics[1]/time"/></td>
depending on which <time> value you're trying to retrieve.

Can a custom XSLT definition handle a SOAP response that returns an Array of Objects when defining an MBO?

I seem to have run into a limitation in SUP regarding its ability to handle a SOAP response containing a list of objects and I am wondering if it would be possible to write a custom XSLT to handle this. I am trying to make a call into Jira via the getProjectsNoSchemes method via SOAP. This method returns an array of RemoteProject objects. Ultimately I would like to be able to treat each node as a row in a table, but unfortunately I don't know enough about XSLT to be able to know if this is possible or not. I also don't know if this is even a viable solution in SUP.
A sample of the SOAP response is below:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:GetProjectsNoSchemesResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://www.webserviceX.NET">
<GetProjectsNoSchemesReturn
soapenc:arrayType="ns2:RemoteProject[2]" xsi:type="soapenc:Array"
xmlns:ns2="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<GetProjectsNoSchemesReturn href="#id0" />
<GetProjectsNoSchemesReturn href="#id1" />
</GetProjectsNoSchemesReturn>
</ns1:GetProjectsNoSchemesResponse>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:RemoteProject" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns3="http://beans.soap.rpc.jira.atlassian.com">
<description xsi:type="xsd:string">Mobile Web Project POC
</description>
<id xsi:type="xsd:string">10034</id>
<issueSecurityScheme xsi:type="ns3:RemoteScheme"
xsi:nil="true" />
<key xsi:type="xsd:string">XLIPOC</key>
<lead xsi:type="xsd:string">benm</lead>
<name xsi:type="xsd:string">Redacted Project</name>
<notificationScheme xsi:type="ns3:RemoteScheme"
xsi:nil="true" />
<permissionScheme xsi:type="ns3:RemotePermissionScheme"
xsi:nil="true" />
<projectUrl xsi:type="xsd:string"></projectUrl>
<url xsi:type="xsd:string">https://redacted.com/browse/REDACTED</url>
</multiRef>
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns4:RemoteProject" xmlns:ns4="http://beans.soap.rpc.jira.atlassian.com"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<description xsi:type="xsd:string"></description>
<id xsi:type="xsd:string">10017</id>
<issueSecurityScheme xsi:type="ns4:RemoteScheme"
xsi:nil="true" />
<key xsi:type="xsd:string">GIC</key>
<lead xsi:type="xsd:string">gregm</lead>
<name xsi:type="xsd:string">REDACTED</name>
<notificationScheme xsi:type="ns4:RemoteScheme"
xsi:nil="true" />
<permissionScheme xsi:type="ns4:RemotePermissionScheme"
xsi:nil="true" />
<projectUrl xsi:type="xsd:string"></projectUrl>
<url xsi:type="xsd:string">https://redacted.com/browse/REDACTED</url>
</multiRef>
</soapenv:Body>
Yes, it's possible, and relatively easy to do so.
Below is an example XSLT that produces an HTML document with a table row for each <multRef> element.
Each child element of <multiRef> is first rendered as a table header using the name of the element for the heading column, and then each <multiRef> is rendered as rows with columns for each of the child elements:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head></head>
<body>
<table border="1">
<xsl:apply-templates select="*/*/multiRef[1]" mode="header"/>
<xsl:apply-templates select="*/*/multiRef" />
</table>
</body>
</html>
</xsl:template>
<xsl:template match="multiRef" mode="header">
<thead>
<tr>
<xsl:apply-templates mode="header"/>
</tr>
</thead>
</xsl:template>
<xsl:template match="multiRef/*" mode="header">
<th>
<xsl:value-of select="local-name()"/>
</th>
</xsl:template>
<xsl:template match="multiRef">
<tr>
<xsl:apply-templates/>
</tr>
</xsl:template>
<xsl:template match="multiRef/*">
<td>
<xsl:apply-templates/>
</td>
</xsl:template>
</xsl:stylesheet>
When applied to the sample XML provided, it produces the following HTML:
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
</head>
<body>
<table border="1">
<thead>
<tr>
<th>description</th>
<th>id</th>
<th>issueSecurityScheme</th>
<th>key</th>
<th>lead</th>
<th>name</th>
<th>notificationScheme</th>
<th>permissionScheme</th>
<th>projectUrl</th>
<th>url</th>
</tr>
</thead>
<tr>
<td>Mobile Web Project POC
</td>
<td>10034</td>
<td></td>
<td>XLIPOC</td>
<td>benm</td>
<td>Redacted Project</td>
<td></td>
<td></td>
<td></td>
<td>https://redacted.com/browse/REDACTED</td>
</tr>
<tr>
<td></td>
<td>10017</td>
<td></td>
<td>GIC</td>
<td>gregm</td>
<td>REDACTED</td>
<td></td>
<td></td>
<td></td>
<td>https://redacted.com/browse/REDACTED</td>
</tr>
</table>
</body>
</html>
SUP expects the XML in a very specific format so I had to traverse through the multi-refs in the response using the for-each construct:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="//ns1:getProjectsNoSchemesResponse">
<data>
<Record>
<Field op_label="id" op_position="1" op_datatype="STRING" op_nullable="true">id</Field>
<Field op_label="name" op_position="2" op_datatype="STRING" op_nullable="true">name</Field>
<Field op_label="description" op_position="3" op_datatype="STRING" op_nullable="true">description</Field>
</Record>
<xsl:for-each select="//ns1:getProjectsNoSchemesResponse/getProjectsNoSchemesReturn/href*">
<Record>
<Field>
<xsl:attribute name="op_label">id</xsl:attribute>
<xsl:attribute name="op_position">1</xsl:attribute>
<xsl:attribute name="op_datatype">STRING</xsl:attribute>
<xsl:attribute name="op_nullable">true</xsl:attribute>
<xsl:value-of select="getProjectNoSchemesReturn/id" />
</Field>
<Field>
<xsl:attribute name="op_label">name</xsl:attribute>
<xsl:attribute name="op_position">2</xsl:attribute>
<xsl:attribute name="op_datatype">STRING</xsl:attribute>
<xsl:attribute name="op_nullable">true</xsl:attribute>
<xsl:value-of select="getProjectNoSchemesReturn/name" />
</Field>
<Field>
<xsl:attribute name="op_label">description</xsl:attribute>
<xsl:attribute name="op_position">3</xsl:attribute>
<xsl:attribute name="op_datatype">STRING</xsl:attribute>
<xsl:attribute name="op_nullable">true</xsl:attribute>
<xsl:value-of select="getProjectNoSchemesReturn/name" />
</Field>
</Record>
</xsl:for-each>
</data>
</xsl:template>
</xsl:stylesheet>