Remark : namespace 를 최상단에 한번만 추가 하면 된다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<xsl:template match="//*[local-name()='PricingInfo']"> <xsl:variable name="Key" select="@Key" /> <xsl:element name="air:PricingInfoRef" xmlns:air="http://www.port.com/schema/air_v52_0" xmlns:com="http://www.port.com/schema/common_v52_0"> <xsl:attribute name="Key"> <xsl:value-of select="$Key"/> </xsl:attribute> <xsl:for-each select="./*[local-name()='PassengerType']"> <xsl:element name="air:BookingTravelerRef"> <xsl:attribute name="Key"> <xsl:value-of select="@BookingTravelerRef"/> </xsl:attribute> <com:PaymentRef Key="1" /> <com:PaymentRef Key="2" /> </xsl:element> </xsl:for-each> </xsl:element> </xsl:template> |
Remark : node 아래 값 가져오기
local-name() : namespace 접두사 생략해서 가져오기 가능
1 2 3 |
<xsl:value-of select="./*[local-name()='FareDisplayRule']/*[local-name()='RuleLengthOfStay']/*[local-name()='MaximumStay']/@Length"/> |