[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Self-replicating XML
Hi Folks, [Definition] A quine is a computer program which takes no input and produces a copy of its own source code as its only output. The standard terms for these programs in the computability theory and computer science literature are self-replicating programs, self-reproducing programs, and self-copying programs. [1] Below is an XSLT program that is quine. I wonder if it is possible to implement a quine in vanilla XML, perhaps using some clever tricks with entities and/or XInclude? That is, after parsing, the XML document contains a copy of itself, embedded in itself. /Roger ----------------------------------------------------------------- quine.xsl ----------------------------------------------------------------- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" /> <xsl:template match="/"> <xsl:sequence select="document('')" /> </xsl:template> </xsl:stylesheet> [1] http://en.wikipedia.org/wiki/Quine_%28computing%29
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|