Я пытаюсь поменять местами два значения в моем XML ниже. В моем файле xml ShipFromLocationRef есть значение RO91, а ShipToLocationRef имеет значение 6449706. Мое требование - поменять местами R091 на ShipToLocationRef и 6449706 на ShipFromLocationRef.
Прошу вас, пожалуйста, помочь здесь. Ниже мой XML, что я хочу преобразовать
<otm:Release xmlns:otm="http://xmlns.oracle.com/apps/otm/transmission/v6.4" xmlns:gtm="http://xmlns.oracle.com/apps/gtm/transmission/v6.4">
<otm:ReleaseGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>OR_DEL_REJ_8</otm:Xid>
</otm:Gid>
</otm:ReleaseGid>
<otm:TransactionCode>IU</otm:TransactionCode>
<otm:ReleaseHeader>
<otm:ReleaseMethodGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>MEU_OC_LINE</otm:Xid>
</otm:Gid>
</otm:ReleaseMethodGid>
<otm:FlexFieldStrings>
<otm:Attribute1>SO</otm:Attribute1>
<otm:Attribute4>10</otm:Attribute4>
<otm:Attribute5/>
<otm:Attribute6/>
<otm:Attribute7/>
<otm:Attribute8/>
<otm:Attribute10/>
<otm:Attribute11/>
<otm:Attribute13/>
<otm:Attribute14/>
<otm:Attribute15/>
<otm:Attribute16>07</otm:Attribute16>
</otm:FlexFieldStrings>
<otm:FlexFieldNumbers>
<otm:AttributeNumber1>6</otm:AttributeNumber1>
<otm:AttributeNumber2>6</otm:AttributeNumber2>
</otm:FlexFieldNumbers>
<otm:FlexFieldDates>
<otm:AttributeDate1>
<otm:GLogDate>20190904080000</otm:GLogDate>
<otm:TZId/>
<otm:TZOffset/>
</otm:AttributeDate1>
</otm:FlexFieldDates>
</otm:ReleaseHeader>
<otm:ShipFromLocationRef>
<otm:LocationRef>
<otm:LocationGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>6521926</otm:Xid>
</otm:Gid>
</otm:LocationGid>
</otm:LocationRef>
</otm:ShipFromLocationRef>
<otm:ShipToLocationRef>
<otm:LocationRef>
<otm:LocationGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>LT91</otm:Xid>
</otm:Gid>
</otm:LocationGid>
</otm:LocationRef>
</otm:ShipToLocationRef>
<otm:TimeWindow>
<otm:EarlyPickupDt>
<otm:GLogDate>20190904080000</otm:GLogDate>
</otm:EarlyPickupDt>
</otm:TimeWindow>
<otm:ReleaseLine>
<otm:ReleaseLineGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
</otm:Gid>
</otm:ReleaseLineGid>
<otm:PackagedItemRef>
<otm:PackagedItem>
<otm:Packaging>
<otm:PackagedItemGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>4041392</otm:Xid>
</otm:Gid>
</otm:PackagedItemGid>
</otm:Packaging>
<otm:Item>
<otm:TransactionCode>IU</otm:TransactionCode>
<otm:ItemGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>4041392</otm:Xid>
</otm:Gid>
</otm:ItemGid>
</otm:Item>
</otm:PackagedItem>
</otm:PackagedItemRef>
<otm:ItemQuantity>
<otm:ItemTag1/>
<otm:ItemTag2/>
<otm:WeightVolume>
<otm:Weight>
<otm:WeightValue>2312.35</otm:WeightValue>
<otm:WeightUOMGid>
<otm:Gid>
<otm:Xid>KG</otm:Xid>
</otm:Gid>
</otm:WeightUOMGid>
</otm:Weight>
<otm:Volume>
<otm:VolumeValue>3.74</otm:VolumeValue>
<otm:VolumeUOMGid>
<otm:Gid>
<otm:Xid>CUMTR</otm:Xid>
</otm:Gid>
</otm:VolumeUOMGid>
</otm:Volume>
</otm:WeightVolume>
<otm:PackagedItemCount>7</otm:PackagedItemCount>
</otm:ItemQuantity>
</otm:ReleaseLine>
<otm:ReleaseRefnum>
<otm:ReleaseRefnumQualifierGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>DELIVERY_NOTE_NUMBER</otm:Xid>
</otm:Gid>
</otm:ReleaseRefnumQualifierGid>
<otm:ReleaseRefnumValue>M02.3708030153</otm:ReleaseRefnumValue>
</otm:ReleaseRefnum>
<otm:ReleaseRefnum>
<otm:ReleaseRefnumQualifierGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>ENTRY_MODE</otm:Xid>
</otm:Gid>
</otm:ReleaseRefnumQualifierGid>
<otm:ReleaseRefnumValue>FLATTO</otm:ReleaseRefnumValue>
</otm:ReleaseRefnum>
<otm:Remark>
<otm:RemarkQualifierGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>LOGGED_USER</otm:Xid>
</otm:Gid>
</otm:RemarkQualifierGid>
<otm:RemarkText>M02.FLATTO</otm:RemarkText>
</otm:Remark>
<otm:InvolvedParty>
<otm:TransactionCode>IU</otm:TransactionCode>
<otm:InvolvedPartyQualifierGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>PRINCIPAL_PAYER</otm:Xid>
</otm:Gid>
</otm:InvolvedPartyQualifierGid>
<otm:InvolvedPartyLocationRef>
<otm:LocationRef>
<otm:LocationGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>LT21</otm:Xid>
</otm:Gid>
</otm:LocationGid>
</otm:LocationRef>
</otm:InvolvedPartyLocationRef>
<otm:ContactRef>
<otm:Contact>
<otm:ContactGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>LT21</otm:Xid>
</otm:Gid>
</otm:ContactGid>
<otm:TransactionCode>IU</otm:TransactionCode>
<otm:LocationGid>
<otm:Gid>
<otm:DomainName>M02</otm:DomainName>
<otm:Xid>LT21</otm:Xid>
</otm:Gid>
</otm:LocationGid>
</otm:Contact>
</otm:ContactRef>
<otm:ComMethodGid>
<otm:Gid>
<otm:Xid>EMAIL</otm:Xid>
</otm:Gid>
</otm:ComMethodGid>
</otm:InvolvedParty>
</otm:Release>
Ниже мой XSL-код:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:Transmission="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Transmission:ShipFromLocationRef/LocationRef/LocationGid/Gid/Xid">
<xsl:copy>
<xsl:apply-templates select="@*|../Transmission:ShipToLocationRef/LocationRef/LocationGid/Gid/Xid/text()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Transmission:ShipToLocationRef/LocationRef/LocationGid/Gid/Xid">
<xsl:copy>
<xsl:apply-templates select="@*|../Transmission:ShipFromLocationRef/LocationRef/LocationGid/Gid/Xid/text()"/>
</xsl:copy>
</xsl:template>