template to copy namespaces
Could someone suggest a template that I could use to maybe copy all namespaces and schema locations from the original "<bb3:Reservations" and then place after "<bb3:CustomerVisits "
It seems that there is probably a better way then hard coding them.
From this:
<bb3:Reservations xmlns:bb3="http://www.ourbedandbreakfast.com/sample1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ourbedandbreakfast.com/reserve_schema.xsd">
To This:
<bb3:CustomerVisits xmlns:bb3="http://www.ourbedandbreakfast.com/sample1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ourbedandbreakfast.com/reserve_schema.xsd">
Current XSL:
<xsl:template match="bb3:Reservations">
<bb3:CustomerVisits xmlns:bb3="http://www.ourbedandbreakfast.com/sample1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ourbedandbreakfast.com/reserve_schema.xsd">
<xsl:for-each-group select="bb3:Reservation/bb3:Customer" group-by="concat(@FirstName, '~', @LastName)">
<bb3:Booking>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="copy"/>
</xsl:copy>
<xsl:for-each select="current-group()">
<InvoiceNum><xsl:value-of select="../@InvoiceNum"/></InvoiceNum>
</xsl:for-each>
</bb3:Booking>
</xsl:for-each-group>
</bb3:CustomerVisits>
</xsl:template>
|