Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/sgbj/xsalty
- Owner: sgbj
- Created: 2013-11-20T00:00:23.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-30T16:27:45.000Z (almost 11 years ago)
- Last Synced: 2023-08-03T07:23:28.060Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 520 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```