Abstract types

Hi all,

My schema defines over a hundred elements with a varying number of
attributes in each. I want to convert instances of this schema into HTML for
documentation purposes. I can make a conversion similar to the following:

<Element1 att1="34" att2="567"/>

Convering the above to HTML with the following display:

Element1 has attribute att1 = 34 and att2 = 567

Using the XSLT below:

<xsl:template match="Element1">
		<ul type="disc">
			<li>Element1 has attibute 
				<xsl:for-each select="@att1"> att1 =
<xsl:value-of select="."/>
				</xsl:for-each>
				<xsl:for-each select="@att2"> att2 =
<xsl:value-of select="."/>
				</xsl:for-each>
			</li>
		</ul>
</xsl:template>


First, is there a way to print the name of the tag of an element/attribute
so that when I do a match or select I can print the tag name automatically,
i.e, match="Element1" and print it's name, select="@att1" and print it's
name? 

Secondly, I need to do this for all Element1, Element2, ... Element100. This
makes for a lengthy and error prone XSLT file. Is there a way to write a
template that can match any element; output the name; add the text " has
attribute "; select all attributes; output their names; add the text " = ";
and output their values? It may be of worth to mention that all my elements
have substitutionGroup="AbstractElement" which is an abstract element.

Thanks
Mikael

Received on Tuesday, 20 August 2002 10:38:15 UTC