[xsl] To avoid converting html entities

Subject: [xsl] To avoid converting html entities
From: Ahsan Ali <doubleletter@xxxxxxxxx>
Date: Wed, 8 Jun 2005 18:40:25 +0400
Hi,

In my xml data source, I have the following element:

-------------
<PostData>EK,,,,,75,,,,,DXB,,,,,CDG,,,,,20050901,,,,,1500,,,,,20050901,,,,,20
10,,,,,B,,,,,0,430,EK,,,,,74,,,,,CDG,,,,,DXB,,,,,20051001,,,,,1530,,,,,200510
02,,,,,10,,,,,B,,,,,0,400,300000,355000,0,0,0,0,AED,86270166,0,0,0,2,0,0,0,,&
lt;RulesInfo&gt;&lt;UniqueKey&gt;1&lt;/UniqueKey&gt;&lt;QuoteNum&gt;1&lt;/Quo
teNum&gt;&lt;FareNum&gt;1&lt;/FareNum&gt;&lt;FareRuleInfo&gt;Y&lt;/FareRuleIn
fo&gt;&lt;PermittedDisc&gt;N&lt;/PermittedDisc&gt;&lt;DiscAdultFare&gt;N&lt;/
DiscAdultFare&gt;&lt;Spare1&gt;NNNYN&lt;/Spare1&gt;&lt;StartPt&gt;DXB&lt;/Sta
rtPt&gt;&lt;EndPt&gt;CDG&lt;/EndPt&gt;&lt;FirstTravDt&gt;20050901&lt;/FirstTr
avDt&gt;&lt;AirV&gt;EK&lt;/AirV&gt;&lt;FIC&gt;BLE3MAE1&lt;/FIC&gt;&lt;TotFare
Component&gt;40840&lt;/TotFareComponent&gt;&lt;Currency&gt;NUC&lt;/Currency&g
t;&lt;DecPos&gt;2&lt;/DecPos&gt;&lt;FareAmt&gt;40840&lt;/FareAmt&gt;&lt;RuleS
upplierID&gt;0&lt;/RuleSupplierID&gt;&lt;RuleNumOrdinal&gt;00C1C5&lt;/RuleNum
Ordinal&gt;&lt;FareTariffNum&gt;0016&lt;/FareTariffNum&gt;&lt;RuleTextOrdinal
Num&gt;F2C2&lt;/RuleTextOrdinalNum&gt;&lt;RulesApply&gt;Y&lt;/RulesApply&gt;&
lt;RtesApply&gt;Y&lt;/RtesApply&gt;&lt;NoRulesExist&gt;N&lt;/NoRulesExist&gt;
&lt;Spare2&gt;NNNNN&lt;/Spare2&gt;&lt;DBInd&gt;N&lt;/DBInd&gt;&lt;HostUseOnly
91&gt;N&lt;/HostUseOnly91&gt;&lt;PFQuoted&gt;N&lt;/PFQuoted&gt;&lt;Spare3&gt;
YNNNN&lt;/Spare3&gt;&lt;DBID
/&gt;&lt;FareRuleInfoYQual&gt;&lt;GlobDirOrdinal&gt;EH&lt;/GlobDirOrdinal&gt;
&lt;HIFCity1
/&gt;&lt;HIFCity2
/&gt;&lt;MileSurchargeRtgInd&gt;7&lt;/MileSurchargeRtgInd&gt;&lt;FlownMileCom
ponent&gt;0&lt;/FlownMileComponent&gt;&lt;MPMComponent&gt;0&lt;/MPMComponent&
gt;&lt;DifBetween&gt;0&lt;/DifBetween&gt;&lt;ExtraMileCity1
/&gt;&lt;ExtraMileCity2 /&gt;&lt;ExtraMileCity3
/&gt;&lt;OTWTransportingAirV&gt;EK&lt;/OTWTransportingAirV&gt;&lt;ComponentAi
rV1
/&gt;&lt;ComponentAirV2
/&gt;&lt;/FareRuleInfoYQual&gt;&lt;/RulesInfo&gt;</PostData>
-------------
I want to select (and output) the above data, without converting the
html entities above to < & >, etc.

The xsl (snippet) is as follows:

<input type="hidden">
<xsl:attribute name="value">
<xsl:value-of select="PostData" disable-output-escaping="yes"/>
</xsl:attribute>
</input>

The output method is set to html... & I'm using MSXSL (i.e xslt 1.0)

Another quick question.. Is it possible to write the above xsl code in
such a way that the input tag is output as <input />, and _not_
<input></input>

Any help is appreciated

Thanks,

Ahsan

Current Thread