Hi XSL-Experts!

I'm having a very simple structured part of a bigger XML Document:

<tag1>
<pbobjects>
<pbobject>
<attributes>
<attribute name="version">JFIF 1.02</attribute>
<attribute name="id">36200</attribute>
<attribute name="bylinetitle"></attribute>
<attribute name="specialinstructions"></attribute>
<attribute name="comment"></attribute>
<attribute name="credit"></attribute>
<attribute name="byline"></attribute>
<attribute name="provincestate"></attribute>
<attribute name="objectname"></attribute>
<attribute name="supplementalcategory"></attribute>
<attribute name="xresolution">72</attribute>
<attribute name="imageprocess">Baseline</attribute>
<attribute name="ysize">1024</attribute>
<attribute name="imagecolors">3</attribute>
<attribute name="application">Photoshop 3.0</attribute>
<attribute name="keywords"></attribute>
<attribute name="mode"></attribute>
<attribute name="unit">1</attribute>
... about 100 attributes
</attributes>
</pbobject>
<pbobject>
<attributes>
...
</attributes>
</pbobject>
...
</pbobjects>
</tag1>

Now I want to print out and convert only a few of that attributes (using
special formatting for some)
and came to the following:

<xsl:template match="attribute">
 <xsl:choose>
   <xsl:when test="@name='objectname'">
<xsl:text disable-output-escaping="yes"> &lt;Kurztitel>
</xsl:text><xsl:value-of select="."/><xsl:text>
</xsl:text>
   </xsl:when>
   <xsl:when test="@name='thema'">
<xsl:text disable-output-escaping="yes"> &lt;Thema>
</xsl:text><xsl:value-of select="."/><xsl:text>
</xsl:text>
   </xsl:when>
   <xsl:when test="@name='supplementalcategory'">
<xsl:text disable-output-escaping="yes"> &lt;ThemaBildnachw>
</xsl:text><xsl:value-of select="."/><xsl:text>
</xsl:text>
   </xsl:when>
... (for all attributes I want)
</xsl:choose>
</xsl:template>

I guess there is a much simpler and faster alternative than that.
Can anyone help?

Thanks in advance!

Carsten Heyl

--
  Carsten Heyl                          [EMAIL PROTECTED]
  Pixelboxx GmbH                        http://www.pixelboxx.de/
  Ostenhellweg 56-58                    Tel.:   +49 231 53 46 30
D-44135 Dortmund                        Mobile: +49 174 31 83 608


Reply via email to