Click here to Skip to main content
15,845,912 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
   <xsl:template match="/">
      <Order>
         <xsl:copy-of select="Order/@*"/>
         <xsl:copy-of select="Order/Extn"/>
         <OrderLines>
            <xsl:for-each select="Order/OrderLines/OrderLine">
               <OrderLine>
                  <xsl:copy-of select="@*"/>
                  
                  <Extn IsNew="Y">
                  	 <xsl:for-each select = "DeliveryMethod!='SHP'">
                  	 	
                  	 <xsl:variable name="varColor">
                        <xsl:value-of select="'Purple'"/>
                     </xsl:variable>
                    <xsl:attribute name="Color">
                        <xsl:value-of select="$varColor"/>
                     </xsl:attribute>
                	</xsl:for-each>
                  </Extn>


What I have tried:

XML code:
<?xml-stylesheet type="text/xsl" href="order.xsl"?>
<Order DocumentType="0001" EnterpriseCode="Test" OrderNo="pv14852258797">
   <OrderLines>
      <OrderLine CarrierServiceCode="FEDEX" DeliveryMethod="SHP" GiftFlag="N" OrderedQty="1" PrimeLineNo="1" SCAC="92" SubLineNo="1">
      </OrderLine>
      <OrderLine CarrierServiceCode="USPS" DeliveryMethod="PICK" GiftFlag="N" OrderedQty="1" PrimeLineNo="2" SCAC="92" SubLineNo="2">
      </OrderLine>
      </OrderLines>
</Order>
Posted
Comments
OriginalGriff 7-Apr-23 0:54am    
And?
What does it do that you didn't expect, or not do that you did?
What have you tried to do to find out why?
Are there any error messages, and if so, where and when? What did you do to make them happen?

This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Use the "Improve question" widget to edit your question and provide better information.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900