[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: XML transformation using XSL - Urgent, Please HELP!! Thanks
- From: Jeff Rafter <firstname.lastname@example.org>
- To: Thushara Perera <email@example.com>
- Date: Sat, 28 Apr 2001 00:52:23 -0700
It looks as though your "for-each" is set up incorrectly-- you should
probably do a for-each "PRODUCT" instead and then work your way down for the
PRODUCTID lines. Other than that you would need to access the parent node
of the context (PRODUCTID) because PRODUCTQUALIFIER is not a child of
PRODUCTID (as is implied by the value-of). Because no child node is found
the value-of has no result-- hence your attribute is blank.
Hopefully that makes sense-- it is pretty late here. By the way I saw that
you also sent this mail to the XSL list. In cases like this it is better to
send it to one list or the other-- by now this could already be answered on
the XSL list and I wouldn't know it. Out of the two lists the XSL list is
the better choice. I think you will end up with better results from a list
devoted primarily to XSL.
----- Original Message -----
From: "Thushara Perera" <firstname.lastname@example.org>
To: "XML-DEV (E-mail)" <email@example.com>; "XSL News Group (E-mail)"
Sent: Friday, April 27, 2001 8:00 PM
Subject: XML transformation using XSL - Urgent, Please HELP!! Thanks
> I have an XML file like this:
> <PRODUCT xml:lang="en">
> <MANUFACTURERCOMPANYNAME>Manufactorer name</MANUFACTURERCOMPANYNAME>
> <PRODUCTQUALIFIER>MK</PRODUCTQUALIFIER> <!-- Must be in the ASCII
> 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:value-of select="."/>
> 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.