W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2002

Abstract types

From: Mikael Joukakelian <mikaelj@cae.com>
Date: Tue, 20 Aug 2002 10:33:40 -0400
Message-ID: <719A38AB7279D511B91900D0B7444A9E026116A0@caemsx03.cae.ca>
To: www-xsl-fo@w3.org, xmlschema-dev@w3.org

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:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT