aboutsummaryrefslogtreecommitdiff
path: root/vo/lib/specCone.xsl
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /vo/lib/specCone.xsl
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'vo/lib/specCone.xsl')
-rw-r--r--vo/lib/specCone.xsl46
1 files changed, 46 insertions, 0 deletions
diff --git a/vo/lib/specCone.xsl b/vo/lib/specCone.xsl
new file mode 100644
index 00000000..ce43790a
--- /dev/null
+++ b/vo/lib/specCone.xsl
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:spec="http://voservices.net/spectrum"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="text" />
+
+
+<xsl:template match="/*">
+<xsl:text>#Name,Ra,Dec,Redshift,Class,SpecClass,Id
+</xsl:text>
+ <xsl:apply-templates select="spec:Sed" />
+</xsl:template>
+
+<xsl:template match="spec:Target/spec:Name">
+ <xsl:value-of select="@value" /><xsl:text>,</xsl:text>
+</xsl:template>
+<xsl:template match="spec:Target/spec:Pos">
+ <xsl:value-of select="translate(@value,' ',',')" /><xsl:text>,</xsl:text>
+</xsl:template>
+<xsl:template match="spec:Target/spec:Redshift/spec:Value">
+ <xsl:value-of select="@value" /><xsl:text>,</xsl:text>
+</xsl:template>
+<xsl:template match="spec:Target/spec:Class">
+ <xsl:value-of select="@value" /><xsl:text>,</xsl:text>
+</xsl:template>
+<xsl:template match="spec:Target/spec:SpectralClass">
+ <xsl:value-of select="@value" /><xsl:text>,</xsl:text>
+</xsl:template>
+
+<xsl:template match="spec:Sed">
+ <xsl:apply-templates select="spec:Target/spec:Name" />
+ <xsl:apply-templates select="spec:Target/spec:Pos" />
+ <xsl:apply-templates select="spec:Target/spec:Redshift/spec:Value" />
+ <xsl:apply-templates select="spec:Target/spec:Class" />
+ <xsl:apply-templates select="spec:Target/spec:SpectralClass" />
+
+ <xsl:for-each select="spec:Segments">
+ <xsl:for-each select="spec:Segment/spec:DataId/spec:DatasetId">
+ <xsl:value-of select="@value" /><xsl:text>
+</xsl:text>
+ </xsl:for-each>
+ </xsl:for-each>
+</xsl:template>
+
+</xsl:stylesheet>