[xsl] How to replace a reference to a tag by the tag itself?

Subject: [xsl] How to replace a reference to a tag by the tag itself?
From: "Ben Stover" <bxstover@xxxxxxxxxxx>
Date: Thu, 06 Aug 2009 14:41:47 +0200
As you may know XML Schema files allow the following declaration inside a XML Schema file:

<xsd:sequence>
<xsd:group ref="foobar"/>
</xsd:sequence>
....
<xsd:group name="foobar">
....stuff of foobar
</xsd:group>

I would like to write now a XSLT script which replaces the reference by the tag itself or - alternatively - by a Type declaration.

So after application of this XSLT script the resulting XML Schema file should look like either

<xsd:sequence>
....stuff of foobar
</xsd:sequence>

or

<xsd:sequence>
<xsd:element name="foobar" type="foobarType"/>
</xsd:sequence>
....
<xsd:ComplexType name="foobarType">
....stuff of foobar
</xsd:ComplexType>


How would such a XSLT script look like?

Thank you
Ben

Current Thread