?

Log in

XSLT - Alexander Dolgin
February 7th, 2008
10:33 pm

[Link]

Previous Entry Share Next Entry
XSLT
Возвращаясь к вопросу про XSLT.

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:template match="BarDataFacilityList/BarDataFacility[@name='Cost Analysis Bar Data Facility']|CostAnalysisComponent">
		 <xsl:call-template name="comment"/>
	</xsl:template>

	<xsl:template match="ReportsToLoadOnStartupList/ReportReference[@resourceName='/ElTrader/TMS/Common/Reports/Instrument Positions.reportspec']">
		 <xsl:call-template name="comment"/>
	</xsl:template>

	<xsl:template match="RiskProviderComponent">
		 <xsl:call-template name="comment"/>
	</xsl:template>

	
    <xsl:template match="TransactionDomain[@transactionType='Portfolio']/@maintainPositions">
		<xsl:attribute name="maintainPositions">false</xsl:attribute> 
    </xsl:template>

    <xsl:template match="TransactionDomain[@transactionType='Portfolio']/ClientCommissions/@maintainCommissions">
		<xsl:attribute name="maintainCommissions">false</xsl:attribute> 
    </xsl:template>
    <xsl:template match="TransactionDomain[@transactionType='Portfolio']/MarketCommissions/@maintainCommissions">
		<xsl:attribute name="maintainCommissions">false</xsl:attribute> 
    </xsl:template>

	<xsl:template match="BarDataFacilityList/BarDataFacility[@name='Instrument Market Bar Data Facility']/@externalDataFacilityName">
		<xsl:attribute name="_externalDataFacilityName"><xsl:value-of select="."/></xsl:attribute> 
	</xsl:template>

	<xsl:template match="@*|node()" >
		<xsl:copy>
			<xsl:apply-templates select="@*|node()" />
		</xsl:copy>
	</xsl:template>

	<xsl:template name="comment">
		<xsl:text disable-output-escaping = "yes">&lt;!--#AUTO_COMMENTED#</xsl:text>
     		<xsl:copy>
     			<xsl:apply-templates select="@*|node()" />
     		</xsl:copy>
		<xsl:text disable-output-escaping = "yes">#AUTO_COMMENTED#--&gt;</xsl:text>
	</xsl:template>

</xsl:stylesheet>


Зовется это все из XSLT Ant task.
Довольно удобно получилось.

Tags:

(3 comments | Leave a comment)

Comments
 
From:dolsi
Date:February 7th, 2008 11:52 pm (UTC)
(Link)
Я чет не поняла, это все тоже XSLT же.
[User Picture]
From:upstartn
Date:February 8th, 2008 08:45 am (UTC)
(Link)
Да, именно :)
[User Picture]
From:upstartn
Date:February 8th, 2008 08:45 am (UTC)
(Link)
Спасибо за помощь, ксати :)
Powered by LiveJournal.com