XCST — eXtensible C-Sharp Templates
XCST is a language optimized for the production of XML and other formats. It's a more general-purpose version of XSLT.
See the project home for more information.
Package | Description | Targets |
---|---|---|
Xcst.Compiler | Compilation API. Use this package to translate your XCST programs into C# or Visual Basic code. | .NET 4.6, .NET Core 2.0 |
Xcst.Runtime | Runtime and evaluation API. | .NET 4.6, .NET Core 2.0, .NET Standard 2.0 |
The documentation can be found at the project home.
v2 is the main branch for major version 2. See v1 for version 1 (no longer maintained).
The compiler was rewritten in XCST itself, ported from the v1 compiler written in XSLT 2. Consequently, compiler extensions such as extension instructions and extension attributes must now be implemented in XCST.
The compiler can generate code for runtime v1 or v2 (the default). The runtime is not backwards compatible, programs compiled against v1 must be recompiled to run on v2.
The XCST language is still version 1.0
and continues to be refined. Breaking changes are rare and have low impact (e.g. renaming an attribute or element). One of the big new features in v2 are c:mode
declarations. New language features that require special runtime support are not supported when targeting the v1 runtime.
Tests now run on .NET Core and compatibility with this framework is the priority. Support for .NET Framework and .NET Standard remains for the time being.
- renamed c:metadata to c:meta and 'name' attribute to 'type'
- removed 'html-version' since xhtml output is not supported
- renamed 'display-text-member' to 'text-member'
- renamed 'null-display-text' to 'null-text'
- removed implicit unnamed mode
- changed default built-in template rule to fail
- don't assign local variable without value
- resolve 'validation-resource-type' from c:validation against package namespace, or treat as fully-qualified
- not using 'data-type' for validation
- deprecated System.Delegate fallback on invoke-delegate as it hides programming errors
The compiler produces code that is compatible with C# 6 and Visual Basic 14, although template rules are not useful unless you use C# 7 or higher.
The XCST schema is written in Relax NG and converted to XSD using Trang, which requires Java.