1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" xmlns:
moby=
"http://www.biomoby.org/moby" version=
"1.0">
3 <xsl:output method=
"xml" encoding=
"iso-8859-1" indent=
"no" disable-output-escaping=
"no"/>
5 <xsl:template match=
"/">
6 <xsl:text>#XSL_LIPM_MOBYPARSER_MESSAGE#
</xsl:text>
9 <xsl:apply-templates select=
"/moby:MOBY/moby:mobyContent/moby:serviceNotes"/>
10 <xsl:apply-templates select=
"/moby:MOBY/moby:mobyContent/moby:mobyData"/>
13 <xsl:template match=
"moby:serviceNotes">
14 <xsl:text>#XSL_LIPM_MOBYPARSER_SERVICENOTES#
</xsl:text>
15 <xsl:value-of select=
"normalize-space(.)"/>
16 <xsl:text>#XSL_LIPM_MOBYPARSER_SERVICENOTES#
</xsl:text>
21 <xsl:template match=
"moby:mobyData">
23 <xsl:text>#XSL_LIPM_MOBYPARSER_DATA_START#
</xsl:text>
27 <!-- Retrieve QueryId -->
29 <xsl:value-of select=
"normalize-space(./@moby:queryID)"/>
30 <xsl:variable name=
"queryID1" select=
"normalize-space(./@moby:queryID)"/>
31 <xsl:variable name=
"queryID2" select=
"normalize-space(./@queryID)"/>
32 <xsl:text>#XSL_LIPM_MOBYPARSER_QUERYID#
</xsl:text>
33 <xsl:if test=
"$queryID1 != ''">
34 <xsl:value-of select=
"$queryID1"/>
36 <xsl:if test=
"$queryID2 != ''">
37 <xsl:value-of select=
"$queryID2"/>
39 <xsl:text>#XSL_LIPM_MOBYPARSER_QUERYID#
</xsl:text>
45 <xsl:for-each select=
"child::*">
46 <xsl:text>#XSL_LIPM_MOBYPARSER_ARTICLE_START#
</xsl:text>
49 <xsl:variable name=
"articleName" select=
"normalize-space(./@moby:articleName)"/>
51 <xsl:when test=
"$articleName = ''">
52 <xsl:text>#XSL_LIPM_MOBYPARSER_ARTICLENAME#
</xsl:text>
53 <xsl:value-of select=
"normalize-space(./@articleName)"/>
54 <xsl:text>#XSL_LIPM_MOBYPARSER_ARTICLENAME#
</xsl:text>
57 <xsl:text>#XSL_LIPM_MOBYPARSER_ARTICLENAME#
</xsl:text>
58 <xsl:value-of select=
"$articleName"/>
59 <xsl:text>#XSL_LIPM_MOBYPARSER_ARTICLENAME#
</xsl:text>
65 <xsl:variable name=
"articleType" select=
"normalize-space(name(.))"/>
66 <xsl:text>#XSL_LIPM_MOBYPARSER_ARTICLETYPE#
</xsl:text>
67 <xsl:value-of select=
"$articleType"/>
68 <xsl:text>#XSL_LIPM_MOBYPARSER_ARTICLETYPE#
</xsl:text>
74 <xsl:when test=
"$articleType = 'moby:Collection'">
75 <xsl:apply-templates select=
"."/>
77 <xsl:when test=
"$articleType = 'moby:Simple'">
78 <xsl:apply-templates select=
"."/>
81 <xsl:apply-templates select=
"."/>
94 <xsl:template match=
"moby:Collection">
95 <xsl:text>#XSL_LIPM_MOBYPARSER_COLLECTION_START#
</xsl:text>
98 <xsl:for-each select=
"child::*">
100 <xsl:variable name=
"articleType" select=
"normalize-space(name(.))"/>
101 <xsl:if test=
"$articleType = 'moby:Simple'">
102 <xsl:apply-templates select=
"."/>
106 <xsl:text>#XSL_LIPM_MOBYPARSER_COLLECTION_END#
</xsl:text>
116 <xsl:template match=
"moby:Parameter">
118 <xsl:variable name=
"paramname1" select=
"normalize-space(./@moby:articleName)"/>
119 <xsl:variable name=
"paramname2" select=
"normalize-space(./@articleName)"/>
121 <xsl:text>#XSL_LIPM_MOBYPARSER_SECONDARY_START#
</xsl:text>
122 <xsl:if test=
"$paramname1 != ''">
123 <xsl:value-of select=
"$paramname1"/>
125 <xsl:if test=
"$paramname2 != ''">
126 <xsl:value-of select=
"$paramname2"/>
128 <!--<xsl:value-of select="normalize-space(./@moby:articleName)"/>-->
129 <xsl:text>#XSL_LIPM_MOBYPARSER_SECONDARY_SEP#
</xsl:text>
130 <xsl:value-of select=
"normalize-space(./child::*)"/>
131 <xsl:text>#XSL_LIPM_MOBYPARSER_SECONDARY_END#
</xsl:text>
140 <xsl:template match=
"moby:Simple">
141 <xsl:text>#XSL_LIPM_MOBYPARSER_SIMPLE_START#
</xsl:text>
145 <xsl:for-each select=
"child::*">
146 <xsl:call-template name=
"objectClass"/>
162 <xsl:template name=
"objectClass">
164 <!-- Retrieve Object Type -->
166 <xsl:variable name=
"objectType" select=
"normalize-space(name(.))"/>
167 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTTYPE#
</xsl:text>
168 <xsl:value-of select=
"$objectType"/>
169 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTTYPE#
</xsl:text>
175 <!-- Retrieve Object Namespace-->
177 <xsl:variable name=
"objectNamespace1" select=
"normalize-space(./@moby:namespace)"/>
178 <xsl:variable name=
"objectNamespace2" select=
"normalize-space(./@namespace)"/>
179 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTNAMESPACE#
</xsl:text>
180 <xsl:if test=
"$objectNamespace1 != ''">
181 <xsl:value-of select=
"$objectNamespace1"/>
183 <xsl:if test=
"$objectNamespace2 != ''">
184 <xsl:value-of select=
"$objectNamespace2"/>
186 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTNAMESPACE#
</xsl:text>
190 <!-- Retrieve Object Id -->
192 <xsl:variable name=
"objectId1" select=
"normalize-space(./@moby:id)"/>
193 <xsl:variable name=
"objectId2" select=
"normalize-space(./@id)"/>
194 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTID#
</xsl:text>
195 <xsl:if test=
"$objectId1 != ''">
196 <xsl:value-of select=
"$objectId1"/>
198 <xsl:if test=
"$objectId2 != ''">
199 <xsl:value-of select=
"$objectId2"/>
201 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTID#
</xsl:text>
205 <!-- Retrieve Object articleName -->
207 <xsl:variable name=
"objectName1" select=
"normalize-space(./@moby:articleName)"/>
208 <xsl:variable name=
"objectName2" select=
"normalize-space(./@articleName)"/>
209 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTNAME#
</xsl:text>
210 <xsl:if test=
"$objectName1 != ''">
211 <xsl:value-of select=
"$objectName1"/>
213 <xsl:if test=
"$objectName2 != ''">
214 <xsl:value-of select=
"$objectName2"/>
216 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTNAME#
</xsl:text>
221 <!-- Retrieve Object Content -->
223 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTCONTENT#
</xsl:text>
224 <xsl:value-of select=
"."/>
225 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTCONTENT#
</xsl:text>
229 <xsl:for-each select=
"./child::*">
231 <xsl:when test=
"contains(name(.),'CrossReference')">
232 <xsl:call-template name=
"crossReference"/>
234 <xsl:when test=
"contains(name(.),'Xref')">
235 <xsl:call-template name=
"crossReference"/>
238 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTHASA_START#
</xsl:text>
241 <xsl:call-template name=
"objectClass"/>
242 <xsl:text>#XSL_LIPM_MOBYPARSER_OBJECTHASA_END#
</xsl:text>
259 <xsl:template name=
"crossReference">
260 <xsl:for-each select=
"./child::*">
261 <xsl:variable name=
"crossrefObjectType" select=
"normalize-space(name(.))"/>
262 <xsl:variable name=
"crossrefObjectId1" select=
"normalize-space(./@moby:id)"/>
263 <xsl:variable name=
"crossrefObjectId2" select=
"normalize-space(./@id)"/>
264 <xsl:variable name=
"crossrefObjectNamespace1" select=
"normalize-space(./@moby:namespace)"/>
265 <xsl:variable name=
"crossrefObjectNamespace2" select=
"normalize-space(./@namespace)"/>
267 <xsl:text>#XSL_LIPM_MOBYPARSER_CROSSREF_START#
</xsl:text>
268 <xsl:value-of select=
"$crossrefObjectType"/>
269 <xsl:text>#XSL_LIPM_MOBYPARSER_CROSSREF_SEP#
</xsl:text>
270 <xsl:if test=
"$crossrefObjectId1 != ''"><xsl:value-of select=
"$crossrefObjectId1"/></xsl:if>
271 <xsl:if test=
"$crossrefObjectId2 != ''"><xsl:value-of select=
"$crossrefObjectId2"/></xsl:if>
272 <xsl:text>#XSL_LIPM_MOBYPARSER_CROSSREF_SEP#
</xsl:text>
273 <xsl:if test=
"$crossrefObjectNamespace1 != ''"><xsl:value-of select=
"$crossrefObjectNamespace1"/></xsl:if>
274 <xsl:if test=
"$crossrefObjectNamespace2 != ''"><xsl:value-of select=
"$crossrefObjectNamespace2"/></xsl:if>
275 <xsl:text>#XSL_LIPM_MOBYPARSER_CROSSREF_END#
</xsl:text>