fxsl

Random Items in XSLT

◇◆丶佛笑我妖孽 提交于 2019-12-29 06:45:10
问题 I'm customizing a Google Search appliance, which uses XSLT to present results to the user. Our design calls for one of several images to be included randomly on the results page. Is there a way to use randomness in XSLT? (Pseudo-randomness is just fine for this application.) Calling random templates would be fine, as would just being able to generate a random number and branch based on that. 回答1: Depending on your platform XSL allows inject of user code like C#. I don't recommend this. Better

Looking for a library of XSLT to create SVG charts [closed]

删除回忆录丶 提交于 2019-12-10 10:44:48
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm looking for a library of XSLT to create SVG charts. I need pie charts, bar charts, line charts, all the usual suspects. I would hope for a reasonably simple DTD or Schema for the input files. Edit : I have the raw data for the charts and a mechanism to convert it into what ever XML is necessary for the XSLT

Steps and involvement of implementing a parser (in .Net - and in this case XPath 2.0)

雨燕双飞 提交于 2019-12-09 18:10:41
问题 In the lack of any good free XPath 2.0 implementations for .Net build upon Linq to XML I have thought about implementing my own (also for the experience). But just to be clear (and not building something that exists) these are the XPath 2.0 implementations I have found: Saxon .Net Query Machine - I had problems with this - exceptions with the examples XQSharp - may be good, but is commercial (single developer ~300 $) Now, I want some thoughts on how difficult it is to implementing some

Steps and involvement of implementing a parser (in .Net - and in this case XPath 2.0)

五迷三道 提交于 2019-12-04 05:51:54
In the lack of any good free XPath 2.0 implementations for .Net build upon Linq to XML I have thought about implementing my own (also for the experience). But just to be clear (and not building something that exists) these are the XPath 2.0 implementations I have found: Saxon .Net Query Machine - I had problems with this - exceptions with the examples XQSharp - may be good, but is commercial (single developer ~300 $) Now, I want some thoughts on how difficult it is to implementing some language such as XPath 2.0 expressions. I have found this link which have a EBNF for XPath 2.0 expression:

Prime factor of 300 000 000 000?

我们两清 提交于 2019-11-30 15:55:25
I need to find out the prime factors of over 300 billion. I have a function that is adding to the list of them...very slowly! It has been running for about an hour now and i think its got a fair distance to go still. Am i doing it completly wrong or is this expected? Edit: Im trying to find the largest prime factor of the number 600851475143. Edit: Result: { List<Int64> ListOfPrimeFactors = new List<Int64>(); Int64 Number = 600851475143; Int64 DividingNumber = 2; while (DividingNumber < Number / DividingNumber) { if (Number % DividingNumber == 0) { ListOfPrimeFactors.Add(DividingNumber);

Prime factor of 300 000 000 000?

做~自己de王妃 提交于 2019-11-29 22:54:36
问题 I need to find out the prime factors of over 300 billion. I have a function that is adding to the list of them...very slowly! It has been running for about an hour now and i think its got a fair distance to go still. Am i doing it completly wrong or is this expected? Edit: Im trying to find the largest prime factor of the number 600851475143. Edit: Result: { List<Int64> ListOfPrimeFactors = new List<Int64>(); Int64 Number = 600851475143; Int64 DividingNumber = 2; while (DividingNumber <

How to call named templates based on a variable?

ぃ、小莉子 提交于 2019-11-29 01:31:06
I don't know if it's possible, but I'm wondering how to do it... Let's say we have the following XSL: <xsl:template name="foo"> Bla bla bla </xsl:template> ... <xsl:template name="bar"> Bla bla bla </xsl:template> ... <xsl:template match="/"> <xsl:if test="$templateName='foo'"> <xsl:call-template name="foo"/> </xsl:if> <xsl:if test="$templateName='bar'"> <xsl:call-template name="bar"/> </xsl:if> </xsl:template> Is it possible to change the XSL to read something like... <xsl:template match="/"> <xsl:call-template name="$templateName"/> </xsl:template> No, this is not possible not directly

Is XSLT a functional programming language?

邮差的信 提交于 2019-11-28 21:15:36
Several questions about functional programming languages have got me thinking about whether XSLT is a functional programming language. If not, what features are missing? Has XSLT 2.0 shortened or closed the gap? XSLT is declarative as opposed to stateful. Although XSLT is based on functional programming ideas, it is not a full functional programming language, it lacks the ability to treat functions as a first class data type. It has elements like lazy evaluation to reduce unneeded evaluation and also the absence of explicit loops. Like a functional language though, I would think that it can be

How to call named templates based on a variable?

南笙酒味 提交于 2019-11-27 21:41:08
问题 I don't know if it's possible, but I'm wondering how to do it... Let's say we have the following XSL: <xsl:template name="foo"> Bla bla bla </xsl:template> ... <xsl:template name="bar"> Bla bla bla </xsl:template> ... <xsl:template match="/"> <xsl:if test="$templateName='foo'"> <xsl:call-template name="foo"/> </xsl:if> <xsl:if test="$templateName='bar'"> <xsl:call-template name="bar"/> </xsl:if> </xsl:template> Is it possible to change the XSL to read something like... <xsl:template match="/"

Is XSLT a functional programming language?

人走茶凉 提交于 2019-11-27 20:42:47
问题 Several questions about functional programming languages have got me thinking about whether XSLT is a functional programming language. If not, what features are missing? Has XSLT 2.0 shortened or closed the gap? 回答1: XSLT is declarative as opposed to stateful. Although XSLT is based on functional programming ideas, it is not a full functional programming language, it lacks the ability to treat functions as a first class data type. It has elements like lazy evaluation to reduce unneeded