Subject: [xsl] Matching elements based on element type: From: "David B" <daavidb@xxxxxxxxx> Date: Mon, 17 Jul 2006 16:57:08 +0100 |
<top> <a>123</a> <b>456</b> <c>789</c> </top>
And has a schema as follows: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="top"> <xs:complexType> <xs:sequence> <xs:element name="a" type="my_type"/> <xs:element name="b" type="my_type"/> <xs:element name="c" type="my_type"/> </xs:sequence> </xs:complexType> </xs:element> <xs:simpleType name="my_type"> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:schema>
That is, the elements a,b,c all have the type my_type but have different element names.
I want an xslt stylesheet that has a single template for all elements of type my_type. Something like: <xsl:template match="top"> <xsl:apply-templates/> </xsl:template>
<xsl:template match="*[type()=my_type]"> <xsl:value-of select="."/> </xsl:template>
Best Regards, David Belius
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Templates.newTransformer , Mohsen Saboorian | Thread | RE: [xsl] Matching elements based o, Michael Kay |
Re: [xsl] textarea xml/html ptoblem, Wendell Piez | Date | Re: [xsl] Fwd: Combing two differen, Florent Georges |
Month |