-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathprocess_xml.xslt
49 lines (42 loc) · 1.86 KB
/
process_xml.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:fn="fn" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="clinical_study">
<xsl:text>NCT ID	Lead Sponsor	Sponsor Class	Recruitment	Interventions	Start Date	Completion Date	Primary Completion Date	Results Date	Phase	Countries </xsl:text>
<xsl:value-of select="id_info/nct_id" /><xsl:text>	</xsl:text>
<xsl:value-of select="sponsors/lead_sponsor/agency" /><xsl:text>	</xsl:text>
<xsl:value-of select="sponsors/lead_sponsor/agency_class" /><xsl:text>	</xsl:text>
<xsl:value-of select="overall_status" /><xsl:text>	</xsl:text>
<xsl:for-each select="intervention">
<xsl:choose>
<xsl:when test="position() = 1">
<xsl:value-of select="intervention_type" /><xsl:text>: </xsl:text>
<xsl:value-of select="intervention_name" />
</xsl:when>
<xsl:otherwise>
<xsl:text>|</xsl:text>
<xsl:value-of select="intervention_type " /><xsl:text>: </xsl:text>
<xsl:value-of select="intervention_name" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text>	</xsl:text>
<xsl:value-of select="./start_date" /><xsl:text>	</xsl:text>
<xsl:value-of select="./completion_date" /><xsl:text>	</xsl:text>
<xsl:value-of select="./primary_completion_date" /><xsl:text>	</xsl:text>
<xsl:if test="firstreceived_results_date">
<xsl:value-of select="firstreceived_results_date" />
</xsl:if>
<xsl:text>	</xsl:text>
<xsl:value-of select="./phase" /><xsl:text>	</xsl:text>
<xsl:for-each select="location_countries/country">
<xsl:choose>
<xsl:when test="position() = 1">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('|', .) "/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>