OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XML transformation using XSL - Urgent, Please HELP!! Thanks



Hi
 
I have an XML file like this:
 
<PRODUCTS>
<PRODUCT xml:lang="en">
    <PRODUCTID>1234</PRODUCTID>
    <MANUFACTURERCOMPANYID>1m1</MANUFACTURERCOMPANYID>
    <MANUFACTURERCOMPANYNAME>Manufactorer name</MANUFACTURERCOMPANYNAME>
    <PRODUCTQUALIFIER>MK</PRODUCTQUALIFIER>  <!-- Must be in the ASCII File -->
    <MANUFACTURERCOMPANYNAME2>Manufactorer name2</MANUFACTURERCOMPANYNAME2>
....
...
..
..
</PRODUCT>
</PRODUCTS>
 
 
In my output XML file, I need to get something like this:
 
<PRODUCTID QUALIFIER="MK">1234</PRODUCTID>
 
and I have an XSL file which transforms the XML file into another XML file and a part of the XSL is like below:
 
...
...
  <xsl:for-each select="PRODUCTID">
      <xsl:element name="PRODUCTID">
          <xsl:attribute name="PRODUCTQUALIFIER">
              <xsl:value-of select="PRODUCTQUALIFIER"/>
          </xsl:attribute>
          <xsl:value-of select="."/>
     </xsl:element>
  </xsl:for-each>
...
...
...
 
BUT this doesn't work. It gives a blank value ("") to my QUALIFIER. Could someone please tell me how to get it done ?
 
Thanks a lot and I really appreciate your help.
 
Thushara