- From: Jonathan Marsh via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 30 Mar 2006 18:11:50 +0000
- To: public-ws-desc-eds@w3.org
Update of /sources/public/2002/ws/desc/test-suite/interchange In directory hutz:/tmp/cvs-serv31126/test-suite/interchange Added Files: compare-wsdlxml.xslt canonicalize-wsdlxml.xslt wsdlxml.xsd Log Message: Initial check-in. --- NEW FILE: compare-wsdlxml.xslt --- <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <!-- Stylesheet to compare two WSDL Component Model serialization format (wsdlxml) documents Created: March 27, 2006, Jonathan Marsh, Microsoft. jmarsh@microsoft.com --> <xsl:param name="aspirant" select="'result-canonical.xml'"/> <xsl:param name="archetype" select="'result-canonical1.xml'"/> <xsl:template match="/"> <comparing aspirant="{$aspirant}" archetype="{$archetype}"> <xsl:call-template name="compare"> <xsl:with-param name="asp" select="document($aspirant)/*"/> <xsl:with-param name="arc" select="document($archetype)/*"/> </xsl:call-template> </comparing> </xsl:template> <xsl:template name="compare"> <xsl:param name="asp"/> <xsl:param name="arc"/> <xsl:if test="count($asp) + count($arc) != 0"> <xsl:if test="local-name($asp) != local-name($arc) or namespace-uri($asp) != namespace-uri($arc)"> <failure> <xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="."/></xsl:attribute> <p>Expected element "<xsl:value-of select="local-name($arc)"/>" in namespace "<xsl:value-of select="namespace-uri($arc)"/>", found element "<xsl:value-of select="local-name($asp)"/>" in namespace "<xsl:value-of select="namespace-uri($asp)"/>".</p> </failure> </xsl:if> <!-- compare attributes --> <xsl:if test="count($asp/@*) != count($arc/@*)"> <failure> <xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="."/></xsl:attribute> <p>Different number of attributes (Expected <xsl:value-of select="count($arc/@*)"/> found <xsl:value-of select="count($asp/@*)"/>).</p> </failure> </xsl:if> <xsl:for-each select="$arc/@*"> <xsl:variable name="asp-att" select="$asp/@*[local-name(.)=local-name(current()) and namespace-uri(.)=namespace-uri(current())]"/> <xsl:if test="not($asp-att)"> <failure> <xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="."/></xsl:attribute> <p>Attribute "<xsl:value-of select="name(.)"/>" not found.</p> </failure> </xsl:if> <xsl:if test=". != $asp-att"> <failure> <xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="."/></xsl:attribute> <p>Attribute "<xsl:value-of select="name(.)"/>" value mismatch (found "<xsl:value-of select="$asp-att"/>", expected "<xsl:value-of select="."/>").</p> </failure> </xsl:if> </xsl:for-each> <!-- compare values --> <xsl:if test="text() and not(*)"> <xsl:if test="$asp/text() != $arc/text()"> <failure> <xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="."/></xsl:attribute> <p>Element "<xsl:value-of select="name(.)"/>" value mismatch (found "<xsl:value-of select="$asp/text()"/>", expected "<xsl:value-of select="$arc/text()"/>").</p> </failure> </xsl:if> </xsl:if> <!-- compare children --> <xsl:if test="count($asp/*) != count($arc/*)"> <failure> <xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="."/></xsl:attribute> <p>Different number of children (Expected <xsl:value-of select="count($arc/*)"/> found <xsl:value-of select="count($asp/*)"/>).</p> </failure> </xsl:if> <xsl:for-each select="$arc/*"> <xsl:variable name="p" select="position()"/> <xsl:call-template name="compare"> <xsl:with-param name="asp" select="$asp/*[position()=$p]"/> <xsl:with-param name="arc" select="."/> </xsl:call-template> </xsl:for-each> </xsl:if> </xsl:template> <xsl:template match="*" mode="xpath"> <xsl:apply-templates select="parent::*" mode="xpath"/>/<xsl:value-of select="name(.)"/> </xsl:template> <xsl:template match="@*" mode="xpath"> <xsl:apply-templates select="parent::*" mode="xpath"/>/@<xsl:value-of select="name(.)"/> </xsl:template> </xsl:stylesheet> --- NEW FILE: wsdlxml.xsd --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/ws/desc/wsdl/component" targetNamespace="http://www.w3.org/2002/ws/desc/wsdl/component" elementFormDefault="qualified"> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/> <xs:complexType name="Component.type" abstract="true"> <xs:sequence> <xs:any namespace="##any" processContents="strict" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute ref="xml:id"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:complexType> <xs:element name="component.description" type="component.description.type"/> <xs:complexType name="component.description.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="interfaces" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.interface" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="bindings" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.binding" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="services" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.service" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="element-declarations" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.element-declaration" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="type-definitions" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.type-definition" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.interface" type="component.interface.type"/> <xs:complexType name="component.interface.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="extended-interfaces" minOccurs="0"> <!-- TBD --> </xs:element> <xs:element name="interface-faults" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.interface-fault" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="interface-operations" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.interface-operation" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.interface-fault" type="component.interface-fault.type"/> <xs:complexType name="component.interface-fault.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="element-declaration" minOccurs="0"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="parent"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.interface-operation" type="component.interface-operation.type"/> <xs:complexType name="component.interface-operation.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="message-exchange-pattern" type="xs:anyURI"/> <xs:element name="interface-message-references" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.interface-message-reference" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="interface-fault-references" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.interface-fault-reference" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="style" minOccurs="0"> <xs:simpleType> <xs:list itemType="xs:anyURI"/> </xs:simpleType> </xs:element> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="parent"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.interface-message-reference" type="component.interface-message-reference.type"/> <xs:complexType name="component.interface-message-reference.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="message-label" type="xs:NCName"/> <xs:element name="direction"> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="in"/> <xs:enumeration value="out"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="message-content-model"> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="#any"/> <xs:enumeration value="#none"/> <xs:enumeration value="#other"/> <xs:enumeration value="#element"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="element-declaration" minOccurs="0"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="parent"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.interface-fault-reference" type="component.interface-fault-reference.type"/> <xs:complexType name="component.interface-fault-reference.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="interface-fault"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="message-label" type="xs:NCName"/> <xs:element name="direction"> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="in"/> <xs:enumeration value="out"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="parent"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.feature" type="component.feature.type"/> <xs:complexType name="component.feature.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="ref" type="xs:anyURI"/> <xs:element name="required" type="xs:boolean"/> <xs:element name="parent"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.property" type="component.property.type"/> <xs:complexType name="component.property.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="ref" type="xs:anyURI"/> <xs:element name="value-constraint" minOccurs="0"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="value" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="parent"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.binding" type="component.binding.type"/> <xs:complexType name="component.binding.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="name" type="xs:string" minOccurs="0"/> <xs:element name="interface" minOccurs="0"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="type" type="xs:anyURI"/> <xs:element name="binding-faults" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.binding-fault" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="binding-operations" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.binding-operation" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.binding-fault" type="component.binding-fault.type"/> <xs:complexType name="component.binding-fault.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="interface-fault"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="parent"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.binding-operation" type="component.binding-operation.type"/> <xs:complexType name="component.binding-operation.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="interface-operation"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="binding-fault-references" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.binding-fault-reference" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="binding-message-references" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.binding-message-reference" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="parent"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.binding-message-reference" type="component.binding-message-reference.type"/> <xs:complexType name="component.binding-message-reference.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="interface-message-reference"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="parent"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.binding-fault-reference" type="component.binding-fault-reference.type"/> <xs:complexType name="component.binding-fault-reference.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="interface-message-reference"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="parent"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.service" type="component.service.type"/> <xs:complexType name="component.service.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="interface"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="endpoints"> <xs:complexType> <xs:sequence> <xs:element ref="component.endpoint" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.endpoint" type="component.endpoint.type"/> <xs:complexType name="component.endpoint.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="binding"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> <xs:element name="address" type="xs:anyURI" minOccurs="0"/> <xs:element name="features" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.feature" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="properties" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element ref="component.property" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="parent"> <xs:complexType> <xs:attribute name="ref" type="xs:IDREF"/> </xs:complexType> </xs:element> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.element-declaration" type="component.element-declaration.type"/> <xs:complexType name="component.element-declaration.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="system" type="xs:anyURI"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="component.type-definition" type="component.type-definition.type"/> <xs:complexType name="component.type-definition.type"> <xs:complexContent> <xs:restriction base="Component.type"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="system" type="xs:anyURI"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:schema> --- NEW FILE: canonicalize-wsdlxml.xslt --- <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <!-- Stylesheet to canonicalize the WSDL Component Model serialization format (wsdlxml) - canonicalizes xml:id and @ref attributes Created: March 27, 2006, Jonathan Marsh, Microsoft. jmarsh@microsoft.com --> <xsl:template match="*"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="@*"> <xsl:copy-of select="."/> </xsl:template> <xsl:template match="comment()"> <xsl:copy-of select="."/> </xsl:template> <xsl:template match="@xml:id"> <xsl:attribute name="xml:id">c<xsl:value-of select="count(ancestor::*[@xml:id] | preceding::*[@xml:id])"/></xsl:attribute> </xsl:template> <xsl:template match="@ref"> <xsl:for-each select="//*/@xml:id[.=current()]"> <xsl:attribute name="ref">c<xsl:value-of select="count(ancestor::*[@xml:id] | preceding::*[@xml:id])"/></xsl:attribute> </xsl:for-each> </xsl:template> </xsl:stylesheet>
Received on Thursday, 30 March 2006 18:11:54 UTC