views:

108

answers:

5

What are all the programming languages that support XML literals natively or via extension? I know of VB.NET, Scala, and Factor. Any others?

+3  A: 

XSLT comes to mind. And yes, it is a programming language.

larsmans
+1, fair enough! :)
missingfaktor
+4  A: 

ECMAscript.

Ken
+2  A: 

Facebook published a PHP Extension that allows XML document fragments to be embedded in PHP code.

From the documentation page linked to above:

XHP is a PHP extension which augments the syntax of the language such that XML document fragments become valid PHP expressions. This allows you to use PHP as a stricter templating engine and offers much more straightforward implementation of reusable components.

Dominic Barnes
+4  A: 

Racket provides support for XML literals via XML Boxes. It also provides a very convenient S-expression based syntax for literal XML called X-expressions.

Sam TH
This doesn't look like XML _literals_.
missingfaktor
You can directly write XML, using XML syntax. Here's a screenshot: http://www.ccs.neu.edu/home/samth/tmp/xmlbox.png
Sam TH
@Sam: Nice. +1 :)
missingfaktor
+2  A: 

Perl? I've never used it, but XML::Literal looks like a way to do XML literals in Perl.

Ken