Programming Languages that support XML literals
Asked Answered
S

5

9

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

Screw answered 12/10, 2010 at 14:35 Comment(3)
It seems a little odd to count languages where somebody had to write an extension to the compiler in C++, but not count languages which were flexible enough that someone could write an extension to the language in itself.Tadich
@Ken: +1, good point. Added Factor to the list. Thanks.Screw
I don't know of a library that does it, but Common Lisp supports reader macros, which enables you to define your own syntax.Tadich
T
2

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

Tadich answered 13/10, 2010 at 5:50 Comment(0)
T
7

ECMAscript.

Tadich answered 12/10, 2010 at 15:17 Comment(0)
E
5

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

Edacity answered 12/10, 2010 at 14:40 Comment(0)
T
5

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.

Toluidine answered 13/10, 2010 at 4:13 Comment(2)
This doesn't look like XML literals.Screw
You can directly write XML, using XML syntax. Here's a screenshot: ccs.neu.edu/home/samth/tmp/xmlbox.pngToluidine
A
4

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.

Ardelia answered 12/10, 2010 at 15:22 Comment(0)
T
2

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

Tadich answered 13/10, 2010 at 5:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.