https://github.com/devlooped/mvp.xml
https://github.com/devlooped/mvp.xml
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/devlooped/mvp.xml
- Owner: devlooped
- License: mit
- Created: 2017-03-31T19:36:00.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2025-03-29T00:17:21.000Z (about 1 year ago)
- Last Synced: 2025-04-09T02:36:22.431Z (about 1 year ago)
- Language: C#
- Size: 2.89 MB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: license.txt
Awesome Lists containing this project
README

============
[](https://www.nuget.org/packages/Mvp.Xml)
[](https://www.nuget.org/packages/Mvp.Xml)
[](https://github.com//devlooped/Mvp.Xml/blob/main/license.txt)
[](https://github.com/devlooped/Mvp.Xml/actions)
The original Mvp.Xml project, developed by Microsoft MVP's in XML technologies and XML Web Services worldwide.
It is aimed at supplementing .NET XML processing. All the project's classes contain extensive tests to ensure
its quality, as well as the peer review among this highly focused group of XML lovers.
Mvp.Xml project currently provides .NET implementations of [EXSLT](http://www.exslt.org/), [XML Base](http://www.w3.org/TR/xmlbase/),
[XInclude](http://www.w3.org/TR/xinclude/), [XPointer](http://www.w3.org/TR/xptr-framework/) as well as a unique set of utility classes
and tools making XML programming in .NET platform easier, more productive and effective.
## EXSLT
Example usage of [EXSLT](http://www.exslt.org/):
```csharp
var xslt = new MvpXslTransform();
xslt.Load("foo.xsl");
// Optionally enforce the output to be XHTML
xslt.EnforceXHTMLOutput = true;
xslt.Transform(new XmlInput("foo.xml"), new XmlOutput("result.html"));
```
Usage in XPath-only context:
```csharp
XPathExpression expr = nav.Compile("set:distinct(//author)");
expr.SetContext(new ExsltContext(doc.NameTable));
XPathNodeIterator authors = nav.Select(expr);
while (authors.MoveNext())
Console.WriteLine(authors.Current.Value);
```
## XInclude
Example usage of [XInclude](http://www.w3.org/TR/xinclude/):
```csharp
var reader = new XIncludingReader(XmlReader.Create(uri));
var document = XDocument.Load(reader);
```
## Miscelaneous
Some other helper classes include:
```csharp
public XPathNodeIterator GetExpensiveBooks(IXPathNavigable doc, int minPrice)
{
string expr = "//mvp:titles[mvp:price > $price]";
// XPathCache optimally caches the compiled XPath expression and parameterizes it
return XPathCache.Select(expr, doc.CreateNavigator(), mgr, new XPathVariable("price", minPrice));
}
```
```csharp
var xslt = new XslTransform();
xslt.Load("print_root.xsl");
var doc = new XPathDocument("library.xml");
var books = doc.CreateNavigator().Select("/library/book");
while (books.MoveNext())
{
// Transform subtree for current node
xslt.Transform(new SubtreeeXPathNavigator(books.Current), null, Console.Out, null);
}
```
# Sponsors
[](https://github.com/clarius)
[](https://github.com/KirillOsenkov)
[](https://github.com/MFB-Technologies-Inc)
[](https://github.com/decriptor)
[](https://github.com/torutek-gh)
[](https://github.com/drivenet)
[](https://github.com/dgnaegi)
[](https://github.com/AshleyMedway)
[](https://github.com/Keflon)
[](https://github.com/tbolon)
[](https://github.com/kfrancis)
[](https://github.com/SeanKilleen)
[](https://github.com/twenzel)
[](https://github.com/Giorgi)
[](https://github.com/MikeCodesDotNET)
[](https://github.com/dansiegel)
[](https://github.com/rbnswartz)
[](https://github.com/jfoshee)
[](https://github.com/Mrxx99)
[](https://github.com/eajhnsn1)
[](https://github.com/mackayn)
[](https://github.com/certifytheweb)
[](https://github.com/IxTechnologies)
[](https://github.com/davidjenni)
[](https://github.com/Jonathan-Hickey)
[](https://github.com/okyrylchuk)
[](https://github.com/akunzai)
[](https://github.com/jakobt)
[](https://github.com/seanalexander)
[](https://github.com/tinohager)
[](https://github.com/ploeh)
[](https://github.com/angelobelchior)
[](https://github.com/KenBonny)
[](https://github.com/SimonCropp)
[](https://github.com/agileworks-eu)
[](https://github.com/sorahex)
[](https://github.com/arsdragonfly)
[](https://github.com/vezel-dev)
[](https://github.com/sponsors/devlooped)
[Learn more about GitHub Sponsors](https://github.com/sponsors)