Subject: [xsl] Attribute and Element Formatting Issues From: "Mehta, Chirag" <chirag.mehta@xxxxxxxxxxxxxxxxx> Date: Tue, 13 Sep 2005 15:08:57 +0100 |
Hi, I am new to XSL and I have been trawling the web to find out how to accomplish this: <?xml version="1.0" encoding="utf-8"?> <portfolio name="CBOT" version="1"> <trade name="Future" quantity="1"> <instrument instType="Bond"> <dictionary> <dict name="expiry date" type="t"> </dict> <dict name="strike" type="d">0.95</dict> <dict name="option type" type="s">EuropeanCall</dict> </dictionary> </instrument> </trade> </portfolio> TO: <?xml version="1.0" encoding="utf-8"?> <portfolio name="CBOT" version="1"> <trade name="Future" quantity="1"> <instrument instType="Bond"> <expiryDate> </expiryDate> <strike>0.95</strike> <optionType>EurpoeanCall</optionType> </instrument> </trade> </portfolio> I have got this far: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output indent="yes" /> <!--<xsl:strip-space elements="*" /> --> <xsl:template match=""> <xsl:copy> <!--<xsl:if test="@name">--> <xsl:for-each select="dict"> <!--<xsl:element name="{@name}"> --> <xsl:value-of select="." /> <!--</xsl:element> --> </xsl:for-each> <!--</xsl:if> --> </xsl:copy> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> And have reached a standstill. There are issues with the attributes having a space, not changing the element name to the attribute name etc. Can anyone point me in the right direction? Thanks guys, Chigs Notice to recipient: The information in this internet e-mail and any attachments is confidential and may be privileged. It is intended solely for the addressee. If you are not the intended addressee please notify the sender immediately by telephone. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to external clients any opinions or advice contained in this internet e-mail are subject to the terms and conditions expressed in any applicable governing terms of business or client engagement letter issued by the pertinent Bank of America group entity. If this email originates from the U.K. please note that Bank of America, N.A., London Branch, Banc of America Securities Limited and Banc of America Futures Incorporated are authorised and regulated by the Financial Services Authority.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] FO - block and long text, Marco | Thread | Re: [xsl] Attribute and Element For, Joris Gillis |
RE: [xsl] Is it possible to modify , Agnisys Technology \ | Date | [xsl] IXSLProcessor - input in UTF-, Gabriel |
Month |