FRENDS XML processing Tasks compatible with .NET Standard. This version supports .NET Standard which has only XPath and XSLT version 1 support for now because no there is no library or built-in support for v2 and v3.
You can install the task via FRENDS UI Task view, by searching for packages. You can also download the latest NuGet package from https://www.myget.org/feed/frends/package/nuget/Frends.Xml.Standard and import it manually via the Task view.
Clone a copy of the repo
git clone https://github.com/FrendsPlatform/Frends.Xml.Standard.git
Restore dependencies
nuget restore frends.xml.standard
Rebuild the project
Run Tests with nunit3. Tests can be found under
Frends.Xml.Standard\Frends.Xml.Standard.Tests\bin\Release\netcoreapp3.0\Frends.Xml.Standard.Tests.dll
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we can review your changes
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
Query XML with XPath (version 1) and return a list of results.
Property | Type | Description |
---|---|---|
Xml | string | XML to be queried |
XpathQuery | string | XPath query |
Property | Type | Description |
---|---|---|
ThrowErrorOnEmptyResults | bool | Task will throw an exception if no results found |
Property/Method | Type | Description |
---|---|---|
Data | List | List of query results. Object type depends on the query. If selecting a node the type will be string and contain the xml node. |
ToJson() | List | Returns a JSON representation of the xml data. It is possible to access this date by dot notation. #result.ToJson()[0].Foo.Bar |
ToJson(int index) | JToken | Returns a single result as JSON |
Query XML with XPath (version 1) and return a single result.
Property | Type | Description |
---|---|---|
Xml | string | XML to be queried |
XpathQuery | string | XPath query |
Property | Type | Description |
---|---|---|
ThrowErrorOnEmptyResults | bool | Task will throw an exception if no results found |
Property/Method | Type | Description |
---|---|---|
Data | object | Object type depends on the query. If selecting a node the type will be string and contain the xml node. |
ToJson() | JToken | Returns a JSON representation of the xml data. It is possible to access this date by dot notation. #result.ToJson().Foo.Bar |
Create a XSLT transformation.
Property | Type | Description |
---|---|---|
Xml | string | |
Xslt | string | |
XsltParameters | List {string Name, string Value} |
string
This task takes JSON text and deserializes it into an xml text. Because valid XML must have one root element, the JSON passed to the task should have one property in the root JSON object. If the root JSON object has multiple properties, then the XmlRootElementName should be used. A root element with that name will be inserted into the XML text.
Example input json:
{
"?xml": {
"@version": "1.0",
"@standalone": "no"
},
"root": {
"person": [
{
"@id": "1",
"name": "Alan"
},
{
"@id": "2",
"name": "Louis"
}
]
}
}
Example result:
<?xml version="1.0" standalone="no"?>
<root>
<person id="1">
<name>Alan</name>
</person>
<person id="2">
<name>Louis</name>
</person>
</root>
Property | Type | Description |
---|---|---|
Json | string | Json string to be converted to XML |
XmlRootElementName | string | The name for the root XML element |
string
This project is licensed under the MIT License - see the LICENSE file for details