Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sgbj/xsalty

A lightweight API for performing XSLT transformations with Razor syntax.
https://github.com/sgbj/xsalty

Last synced: 8 days ago
JSON representation

A lightweight API for performing XSLT transformations with Razor syntax.

Awesome Lists containing this project

README

        

XSalty
======
XSalty is a lightweight API for performing XSLT transformations with Razor syntax.

Example
-------
Using XSalty is easy:
```csharp
var doc =
new XDocument(
new XElement("customers",
new XElement("person",
new XElement("name", "John Doe"),
new XElement("age", 37)),
new XElement("person",
new XElement("name", "Jane Doe"),
new XElement("age", 35))));
var template =
@"


Customers




Name
Age

@foreach (var person in Eval(""customers/person""))
{

@Eval(""string(name)"", person)
@Eval(""number(age)"", person)

}


";
var output = doc.XSalty(template);
Console.WriteLine(output);
```

Output:
```html


Customers




Name
Age


John Doe
37


Jane Doe
35


```