<?xml version='1.0'?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0"
                xmlns="http://www.w3.org/TR/REC-html40">


<!-- This is version 1.0 of the iptcnewsml stylesheet produced by David Allen, MD IPTC Copyright 2000 IPTC-->
<!-- It requires the September 2000 version of MSXML3.DLL and IE5.5 to be displayed-->
<!-- It requires the NewsMLv1.0 DTD-->

<xsl:output method="html"/>

<xsl:template match="NewsML">
  <!-- root rule -->
  <html>
    <head>
<title>NewsML</title>
</head>
<div style="margin:1em;border-style:solid double;border-width:thick;border-color:#00FF00;padding:0.2em">
    <body>
<span style="font:bold;color:#00FF00">
<xsl:value-of select="name()"/>
</span>
<xsl:apply-templates select="Catalog|TopicSet|NewsEnvelope|NewsItem"/>
</body>
</div>
</html>
</xsl:template>

<xsl:template match="Catalog">
<div style="font:italic;color:#FF8800">
<xsl:value-of select="name()"/>
<xsl:choose>
<xsl:when test="Resource">
<div>
<xsl:for-each select="Resource">
<xsl:text>DefaultVocabularyFor:</xsl:text>
<xsl:value-of select="DefaultVocabularyFor/@Context"/>
<div>
<xsl:text>URN:</xsl:text>
<xsl:value-of select="Urn"/>
</div>
<div>
<a>
<xsl:attribute name="Href">
<xsl:value-of select="Url"/>
</xsl:attribute>
<xsl:text>URL Hyperlink</xsl:text>
</a>
</div>
</xsl:for-each>
</div>
</xsl:when>
<xsl:when test="@Href">
<div>
<a>
<xsl:attribute name="Href">
<xsl:value-of select="@Href"/>
</xsl:attribute>
<xsl:text>External Vocabulary</xsl:text>
</a>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:text>Error-no vocabulary located</xsl:text>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>


<xsl:template match="NewsEnvelope">
<div>
<xsl:text>Envelope Date/Time=</xsl:text>
<xsl:value-of select="./DateAndTime"/>
 </div>
 <!--<xsl:apply-templates/>-->
</xsl:template>


<xsl:template match="NewsManagement">
<div>
<xsl:apply-templates/>
</div>
</xsl:template>

<xsl:template match="NewsComponent">
<div style="margin:1em;border-style:solid double;border-width:thick;border-color:#FF0000;padding:0.2em">
<span style="color:#FF0000">
<xsl:text>NewsComponent</xsl:text>
</span>
<div>
<xsl:if test="@EquivalentsList='yes'">
<xsl:text>Equivalents</xsl:text>
</xsl:if>
<xsl:apply-templates/>
</div>
</div>
</xsl:template>

<xsl:template match="DescriptiveMetadata">
<div>
<xsl:text>Description</xsl:text>
</div>
<xsl:call-template name="showass"/>
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="SubjectCode">
<div>
<xsl:apply-templates/>
</div>
</xsl:template>


<xsl:template match="AdministrativeMetadata">
<div>
<xsl:text>Information</xsl:text>
<xsl:apply-templates/>
</div>
</xsl:template>

<xsl:template match="NewsItem">
<div style="margin:1em;border-style:solid double;border-width:thick;border-color:#0000FF;padding:0.2em">
<div style="font:bold;color:#0000FF">
<xsl:value-of select="name()"/>
</div>
<xsl:text>NewsIdentifier=urn:newsml:</xsl:text>
<xsl:value-of select=".//ProviderId"/>
          <xsl:text>:</xsl:text>
          <xsl:value-of select=".//DateId"/>
          <xsl:text>:</xsl:text>
          <xsl:value-of select=".//NewsItemId"/>
          <xsl:text>:</xsl:text>
          <xsl:value-of select=".//RevisionId"/>
          <xsl:if test=".//RevisionId/@Update!='N'">
          <xsl:value-of select=".//RevisionId/@Update"/>
          </xsl:if>
<xsl:apply-templates/>
</div>
</xsl:template>

<xsl:template match="NewsItemRef">
<div style="margin:1em;border-style:solid double;border-width:thin;border-color:#0000FF;padding:0.2em">
<a>
<xsl:attribute name="Href">
<xsl:value-of select="@NewsItem"/>
</xsl:attribute>
<xsl:value-of select="Comment"/>
</a>
</div>
</xsl:template>


<xsl:template name="findts" match="node()">
<xsl:param name="scema"/>
<xsl:variable name="actval" select="@FormalName"/>
<xsl:value-of select="$actval"/>
<xsl:variable name="tsetn" select="substring(@Vocabulary,2,string-length(@Vocabulary)-1)"/>
<xsl:for-each select="//TopicSet">
<xsl:if test="@Duid=$tsetn">
<xsl:for-each select="Topic">
<xsl:if test="FormalName/@Scheme=$scema">
<xsl:if test="FormalName=$actval">
<xsl:text>(</xsl:text>
<xsl:for-each select="Description">
<xsl:value-of select="."/>
</xsl:for-each>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</xsl:template>

<xsl:template match="node()" name="findvoc2" mode="findvoc2">
<xsl:param name="itemn"/>
<xsl:variable name="vocname">
<xsl:apply-templates mode="isdefault" select="parent::*">
<xsl:with-param name="currentele" select="$itemn"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:if test="$vocname=''">
<xsl:text>There is not a valid Vocabulary</xsl:text>
<xsl:text>referenced for element:</xsl:text>
<xsl:value-of select="name()"/>
</xsl:if>
<xsl:if test="$vocname!=''">
<xsl:value-of select="$vocname"/>
</xsl:if>
</xsl:template>



<xsl:template match="*" mode="isdefault">
<xsl:param name="currentele"/>
<xsl:variable name="real">
<xsl:choose>
<xsl:when test="Catalog/Resource">
<xsl:for-each select="Catalog/Resource">
<xsl:for-each select="DefaultVocabularyFor">
<xsl:if test="@Context=$currentele">
<xsl:value-of select="../Url"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:if test="Catalog/@Href">
<xsl:for-each select="document(Catalog/@Href)">
<xsl:for-each select=".//Resource">
<xsl:for-each select="DefaultVocabularyFor">
<xsl:if test="@Context=$currentele">
<xsl:value-of select="../Url"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$real!=''">
<xsl:value-of select="$real"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="testele" select="$currentele"/>
<xsl:if test="parent::*">
<xsl:apply-templates mode="isdefault" select="parent::*">
<xsl:with-param name="currentele" select="$testele"/>
</xsl:apply-templates>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


<xsl:template name="showass">
<xsl:if test="@Confidence">
<xsl:text>Confidence=</xsl:text>
<xsl:value-of select="@Confidence"/>
<xsl:text>&#x0d;&#x0a;</xsl:text>
</xsl:if>
<xsl:if test="@Importance">
<xsl:text>Importance=</xsl:text>
<xsl:value-of select="@Importance"/>
<xsl:text>&#x0d;&#x0a;</xsl:text>
</xsl:if>
<xsl:if test="@AssignedBy">
<xsl:text>AssignedBy=</xsl:text>
<xsl:value-of select="@AssignedBy"/>
<xsl:text>&#x0d;&#x0a;</xsl:text>
</xsl:if>
<xsl:if test="@HowPresent">
<xsl:text>HowPresent=</xsl:text>
<xsl:value-of select="@HowPresent"/>
<xsl:text>&#x0d;&#x0a;</xsl:text>
</xsl:if>
<xsl:if test="@DateAndTime">
<xsl:text>DateAndTime=</xsl:text>
<xsl:value-of select="@DateAndTime"/>
<xsl:text>&#x0d;&#x0a;</xsl:text>
</xsl:if>
</xsl:template>


<xsl:template match="Role" name="mainrol">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


<xsl:template match="Subject">
<xsl:variable name="lscema" select="@Scheme"/>
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="document($vocurl)/TopicSet/@FormalName"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:value-of select="TopicType/@FormalName"/>
<xsl:if test="Description/@Variant='Name'">
<xsl:text>:</xsl:text>
<xsl:value-of select="(.)"/>
</xsl:if>
</xsl:if>
</xsl:for-each>
<xsl:call-template name="showass"/>
</div>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/>
</xsl:template>


<xsl:template match="SubjectMatter">
<xsl:variable name="lscema" select="@Scheme"/>
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl1">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj1" select="@FormalName"/>
<div>
<xsl:value-of select="document($vocurl1)/TopicSet/@FormalName"/>
<xsl:for-each select="document($vocurl1)/TopicSet/Topic">
<xsl:if test="FormalName=$subj1">
<xsl:for-each select="document($vocurl1)/TopicSet/Topic">
<xsl:if test="FormalName=concat(substring($subj1,1,2),'000000')">
<div>
<xsl:value-of select="TopicType/@FormalName"/>
<xsl:for-each select="Description">
<xsl:if test="@Variant='Name'">
<xsl:text>:</xsl:text>
<xsl:value-of select="(.)"/>
</xsl:if>
</xsl:for-each>
</div>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="TopicType/@FormalName"/>
<xsl:if test="FormalName/@Scheme=$lscema">
<xsl:for-each select="Description">
<xsl:if test="@Variant='Name'">
<xsl:text>:</xsl:text>
<xsl:value-of select="(.)"/>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:if>
</xsl:for-each>
<xsl:call-template name="showass"/>
</div>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="SubjectDetail">
<xsl:variable name="lscema" select="@Scheme"/>
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl2">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj2" select="@FormalName"/>
<div>
<xsl:value-of select="document($vocurl2)/TopicSet/@FormalName"/>
<xsl:for-each select="document($vocurl2)/TopicSet/Topic">
<xsl:if test="FormalName=$subj2">
<xsl:for-each select="document($vocurl2)/TopicSet/Topic">
<xsl:if test="FormalName=concat(substring($subj2,1,2),'000000')">
<div>
<xsl:value-of select="TopicType/@FormalName"/>
<xsl:for-each select="Description">
<xsl:if test="@Variant='Name'">
<xsl:text>:</xsl:text>
<xsl:value-of select="(.)"/>
</xsl:if>
</xsl:for-each>
</div>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="document($vocurl2)/TopicSet/Topic">
<xsl:if test="FormalName/@Scheme=$lscema">
<xsl:if test="FormalName=concat(substring($subj2,1,5),'000')">
<div>
<xsl:value-of select="TopicType/@FormalName"/>
<xsl:for-each select="Description">
<xsl:if test="@Variant='Name'">
<xsl:text>:</xsl:text>
<xsl:value-of select="(.)"/>
</xsl:if>
</xsl:for-each>
</div>
</xsl:if>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="TopicType/@FormalName"/>
<xsl:if test="FormalName/@Scheme=$lscema">
<xsl:for-each select="Description">
<xsl:if test="@Variant='Name'">
<xsl:text>:</xsl:text>
<xsl:value-of select="(.)"/>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:if>
</xsl:for-each>

<xsl:call-template name="showass"/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="SubjectQualifier">
<xsl:variable name="lscema" select="@Scheme"/>
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl3">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj3" select="@FormalName"/>
<div>
<xsl:value-of select="document($vocurl3)/TopicSet/@FormalName"/>
<xsl:for-each select="document($vocurl3)/TopicSet/Topic">
<xsl:if test="FormalName/@Scheme=$lscema">
<xsl:if test="FormalName=$subj3">
<!--<xsl:value-of select="TopicType/@FormalName"/>-->
<xsl:for-each select="Description">
<xsl:if test="@Variant='Name'">
<xsl:text>:</xsl:text>
<xsl:value-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:if>
</xsl:for-each>
<xsl:call-template name="showass"/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>



<xsl:template match="BasisForChoice">
<div>
<xsl:value-of select="name()"/>
<xsl:text> = </xsl:text>
<xsl:value-of select="(.)"/>
</div>
</xsl:template>

<xsl:template match="ContentItem">

<div style="margin:0.5em;border-style:solid double;border-width:thin;border-color:#800800">

<a>
<xsl:attribute name="Href">
<xsl:value-of select="@Href"/>
</xsl:attribute>
<xsl:value-of select="Comment"/>
</a>
<xsl:apply-templates select="Mediatype|Format|Mimetype|Notation|Characteristics|Encoding|DataContent"/>
</div>
</xsl:template>


<xsl:template match="Confidence">
<div>
      <xsl:call-template name="findvoc2">
     <xsl:with-param name="vocab" select="@SchemeRef"/>
      </xsl:call-template>
      <xsl:value-of select="(.)"/>
</div>
     </xsl:template>

<xsl:template match="Encoding">
<div>
      <xsl:value-of select="name()"/>
      <xsl:text> = </xsl:text>
      <xsl:value-of select="(.)"/>
</div>
</xsl:template>

<xsl:template match="FirstCreated">
<div>
 <xsl:value-of select="name()"/>
<xsl:text>=</xsl:text>
 <xsl:value-of select="(.)"/>
 </div>
</xsl:template>

<xsl:template match="ThisRevisionCreated">
<div>
 <xsl:value-of select="name()"/>
<xsl:text>=</xsl:text>
 <xsl:value-of select="(.)"/>
 </div>
</xsl:template>



<xsl:template match="Instruction">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>



<xsl:template match="DataContent">
<div>
      <xsl:copy-of select="(.)"/>
</div>
</xsl:template>

<xsl:template match="Importance">
<div>
        <xsl:call-template name="findvoc2">
     <xsl:with-param name="vocab" select="@SchemeRef"/>
      </xsl:call-template>
      <xsl:value-of select="(.)"/>
</div>
     </xsl:template>

<xsl:template match="Format">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="FutureStatus">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="Genre">
<div>
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="showass"/>
 </div>
</xsl:template>

<xsl:template match="HowPresent">
<div>
      <xsl:call-template name="findvoc2">
     <xsl:with-param name="vocab" select="@SchemeRef"/>
      </xsl:call-template>
      <xsl:value-of select="(.)"/>
</div>
 </xsl:template>

<xsl:template match="LabelType">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


<xsl:template match="Language">
<div>
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="showass"/>
 </div>
</xsl:template>

<xsl:template match="MediaType">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="MetadataType">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="MimeType">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="NewsItemType">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>

</xsl:template>

<xsl:template match="NewsLineType">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="NewsLines">
<div>
<xsl:text>Newlines:</xsl:text>
<div>
<xsl:value-of select="HeadLine"/>
</div>
<div>
<xsl:value-of select="SubHeadLine"/>
</div>
<xsl:value-of select="ByLine"/>
<xsl:value-of select="DateLine"/>
<xsl:value-of select="CopyrightLine"/>
<div>
<xsl:value-of select="CreditLine"/>
</div>
<div>
<xsl:value-of select="Note"/>
</div>
</div>
</xsl:template>

<xsl:template match="NewsProduct">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="NewsService">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="Notation">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="OfIterestTo">
<div>
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="showass"/>
</div>
</xsl:template>

<xsl:template match="Party">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>

</xsl:template>



<xsl:template match="Provider">
<div>
        <xsl:value-of select="name()"/>
<xsl:apply-templates/>
</div>
     </xsl:template>

<xsl:template match="Creator">
<div>
        <xsl:value-of select="name()"/>
<xsl:apply-templates/>
</div>
     </xsl:template>
<xsl:template match="Contributor">
<div>
        <xsl:value-of select="name()"/>
<xsl:apply-templates/>
</div>
     </xsl:template>

<xsl:template match="Copyright">
<xsl:value-of select="name()"/>
<xsl:text>=</xsl:text>
<xsl:value-of select="(.)"/>
<xsl:call-template name="showass"/>
</xsl:template>


<xsl:template match="Priority">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="Relevance">
<div>
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="showass"/>
</div>
</xsl:template>

<xsl:template match="Status">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="TopicType">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


<xsl:template match="Urgency">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="UsageType">
<xsl:choose>
<xsl:when test="@Vocabulary">
<xsl:call-template name="findts">
<xsl:with-param name="scema" select="@Scheme"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vocurl">
<xsl:call-template name="findvoc2">
<xsl:with-param name="itemn" select="name()"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="subj" select="@FormalName"/>
<div>
<xsl:value-of select="$subj"/>
<xsl:for-each select="document($vocurl)/TopicSet/Topic">
<xsl:if test="FormalName=$subj">
<xsl:text>(</xsl:text>
<xsl:value-of select="Description"/>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="TopicSet">
<div style="margin:1em;border-style:solid double;border-width:thick;border-color:#FF8800;padding:0.2em">
<span style="font:bold;color:#FF8800">
<xsl:value-of select="@FormalName"/>
<xsl:apply-templates/>
</span>
</div>
</xsl:template>

<xsl:template match="TopicOccurences">
<xsl:value-of select="name()"/>
<xsl:text>=</xsl:text>
<xsl:value-of select="(.)"/>
<xsl:call-template name="showass"/>
</xsl:template>

<xsl:template match="UsageRights">
<xsl:value-of select="name()"/>
<xsl:text>=</xsl:text>
<xsl:value-of select="(.)"/>
<xsl:call-template name="showass"/>
</xsl:template>


<xsl:template match="Comment">
<div>
<xsl:value-of select="(.)"/>
</div>
</xsl:template>


<xsl:template match="Topic">
<div>
<xsl:apply-templates/>
</div>
</xsl:template>


<xsl:template match="FormalName">
<span style="font:bold;color:#FF0000">
<xsl:text> = </xsl:text>
<xsl:value-of select="(.)"/>
</span>
</xsl:template>


<xsl:template match="Description">
<div style="font:bold;color:#00FF00">
<xsl:choose>
<xsl:when test="@Variant">
<xsl:value-of select="@Variant"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name()"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text> = </xsl:text>
<xsl:value-of select="(.)"/>
</div>
</xsl:template>

<xsl:template match="Property">
<div style="font:bold;color:#00FF00">
<xsl:value-of select="@FormalName"/>
<xsl:text> = </xsl:text>
<xsl:value-of select="@Value"/>
</div>
</xsl:template>


<xsl:template match="Update">
<xsl:value-of select="name()"/>
<div>
<xsl:apply-templates/>
</div>
</xsl:template>

<xsl:template match="Replace">
<div style="font:bold;color:#00FF00">
<xsl:value-of select="name()"/>
<xsl:text>@Duid=</xsl:text>
<xsl:value-of select="@DuidRef"/>
</div>
</xsl:template>

<xsl:template match="Delete">
<div style="font:bold;color:#00FF00">
<xsl:value-of select="name()"/>
<xsl:text>@Duid=</xsl:text>
<xsl:value-of select="@DuidRef"/>
 </div>
</xsl:template>

<xsl:template match="InsertBefore">
<div style="font:bold;color:#00FF00">
<xsl:value-of select="name()"/>
<xsl:text>@Duid=</xsl:text>
<xsl:value-of select="@DuidRef"/>
<xsl:copy-of select="."/>
 </div>
</xsl:template>

<xsl:template match="InsertAfter">
<div style="font:bold;color:#00FF00">
<xsl:value-of select="name()"/>
<xsl:text>@Duid=</xsl:text>
<xsl:value-of select="@DuidRef"/>
<xsl:copy-of select="."/>
 </div>
</xsl:template>

<xsl:template match="*|@*" mode="copyins">
<xsl:copy>
<xsl:apply-templates select="@*" mode="copyins"/>
<xsl:apply-templates mode="copyins"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>


























































