Why has XSLT never seen the popularity of many oth

2019-04-19 12:18发布

The use of XSLT (XML Stylesheet Language Transform) has never seen the same popularity of many of the other languages that came out during the internet boom. While it is in use, and in some cases by large successful companies (i.e. Blizzard Entertainment), it has never seemed to reach mainstream. Why do you think this is?

标签: xml xslt
15条回答
劳资没心,怎么记你
2楼-- · 2019-04-19 12:30

Generally, the times when you will be required to transform XML data into a different form of XML data, but not do any other processing to it are going to be very limited. Usually XML is used as an intermediary between two separate systems, one of which is usually custom made to process the output of the other. As such it's simpler to just write one of the systems to process the XML output of the other without the extra step of having to perform some kind of transform.

查看更多
够拽才男人
3楼-- · 2019-04-19 12:30

xslt is great for xml to xml, when you have data that is already escaped and a clear definition of inputs and outputs. using it for things like xml2html to me just seems like such a headache, and with nearly any dynamic language and css the output is a lot easier to implement with style.

查看更多
戒情不戒烟
4楼-- · 2019-04-19 12:34

Because it is easier to write and maintain code that uses Java, C#, JavaScript, etc. to deserialize an XML stream, transform it, and export the desired output, and XSLT offers no substantial performance advantage.

XSLT makes somethings easy, but it makes other things very, very hard.

查看更多
地球回转人心会变
5楼-- · 2019-04-19 12:38

Well... Maybe because it is a pain to write xslts... I had to write a few xslts a few months ago and I was dreaming of pointy brackets...

<Really> 
    <No>
        <fun/>
    </No>
</Really>         

(I do know, that this is no xslt)

查看更多
趁早两清
6楼-- · 2019-04-19 12:38

XSL is mainstream and widely adopted. What other languages are you referring to? XSL isn't a programming language, just a transformation language, so it is pretty limited in scope.

查看更多
Luminary・发光体
7楼-- · 2019-04-19 12:40

XSLT is very powerful, but requires a different way of thinking about the problem. It also made life hard for itself by not providing useful data functionality in the early versions. Take for example a ToUpper() style method, you typically implement it with something like:

<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>  

<xsl:value-of select="translate($toconvert,$lcletters,$ucletters)"/>

Not the easiest way of coding!

查看更多
登录 后发表回答