ile tek niteliği Alter Ne aklınıza gelebilecek en basit XSLT, sadece bu durumda, birinci değerini dönüştürmek için /configuration/system.web/compilation/@debug
niteliğini true
den false
var ki?
XSLT
cevap
Bu dönüşüm: ilk compilation
çocuğun debug
niteliğini değiştirir:
<configuration>
<system.web>
<compilation debug="true" defaultLanguage="C#">
<!-- this is a comment -->
</compilation>
<compilation debug="true" defaultLanguage="C#">
<!-- this is another comment -->
</compilation>
</system.web>
</configuration>
aranan, doğru sonucu üretir: bu XML belge üzerinde uygulanan
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*" name="identity">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="system.web/compilation[1]/@debug">
<xsl:attribute name="debug">false</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
Herhangi bir system.web
öğesinin (ancak var olduğunu biliyoruz Bir yapılandırma dosyasında bir adet system.web
öğesi. Görüldüğü gibi gerektiği gibi
<configuration>
<system.web>
<compilation debug="false" defaultLanguage="C#">
<!-- this is a comment -->
</compilation>
<compilation debug="true" defaultLanguage="C#">
<!-- this is another comment -->
</compilation>
</system.web>
</configuration>
sadece ilk debug
vasıf, false
için modifird edilir.
Bu XSLT için kimlik deseni dönüşümü denir ve @Dimitre Novatchev işaret ettiği gibi, son derece güçlü. – lavinio
'xsl: attribute' öğesinin, xsl: template 'dizgesinin eşleştiğini, XPath'da zaten verildiğinde, değiştirilecek öznitelik adından söz etmek zorunda olduğu bir utançtır. "Bu özniteliği, ne denirse çağırsın" demenin bir yolu var mı? –
@TomAnderson: AVT gösterimini kullanabilirsiniz: '
<xsl:attribute name="debug">false</xsl:attribute>
<compilation>
içinde? Yoksa sorumu yanlış anladım mı?
- 1. XSLT
- 2. , xslt
- 3. XSLT
- 4. XSLT,
- 5. XSLT
- 6. XSLT (,)
- 7. xslt
- 8. xslt
- 9. XSLT
- 10. XSLT
- 11. XSLT
- 12. xslt
- 13. XSLT
- 14. XSLT
- 15. XSLT
- 16. C# XSLT Sorunun dönüşümü XSLT sahip çıkış
- 17. Java/XSLT:
- 18. Sadece xslt
- 19. XSLT: Birleştirme yinelenen senaryo
- 20. Ampersand, XSLT ve LaTeX
- 21. XSLT: Döngü her seferinde
- 22. xslt - özüt yaprağı düğümleri
- 23. xslt alanına boşluk ekleme
- 24. TransforMiiX (XML/XSLT)
- 25. İki listenin xslt
- 26. XSLT ile XML Oluşturma
- 27. XSLT Değiştir işlevi bulunamadı
- 28. XSLT: Belirli niteliğini değiştirme
- 29. Bazı XML öğelerini XSLT
- 30. Önceki düğümlerin XSLT
İyi soru (+1). Kısa, basit ve doğru bir çözüm için cevabımı görün. Lucero'nun şu anki cevabı gayet yanlış - cevabına yorumumu iletin. –