Rename to XN, restructure repository #3

Merged
dominic merged 1 commits from rename into master 2026-04-25 19:17:03 +00:00
25 changed files with 14 additions and 8 deletions

View File

@ -3,7 +3,7 @@
## Original Author ## Original Author
**Dominic Hoegliner** **Dominic Hoegliner**
Author and maintainer of XNeedle. Author and maintainer of XN.
All intellectual property rights retained by the original author. All intellectual property rights retained by the original author.
--- ---

View File

@ -1,4 +1,4 @@
Copyright 2026 DOMINIC HOEGLINER Copyright 2026 Dominic Hoeglinger
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

View File

@ -1,14 +1,15 @@
# XNeedle # XN
A simple tool for injecting faults into XML documents. XML Needle (XN) is a simple tool for injecting faults into XML documents.
## Description ## Description
The purpose of the tool is to hide a metaphorical "needle in a haystack" The purpose of the tool is to hide a metaphorical "needle in a haystack"
in large XML files, such as an EtherCAT SubDevice Information or ESI file. in large XML files, such as an EtherCAT SubDevice Information or ESI file.
Therefore it is a FIT (fault injection test) tool, but can be used off-label. Therefore it is a FIT (fault injection test) tool,
but can be used for general purpose manipulation.
To live up to its name, XPath is utilized to specify precise locations XPath is utilized to specify precise locations
combined with a good enough set of instructions to do CRUD operations. combined with a good enough set of instructions to do CRUD operations.
As the main application lies with injecting faults into ESI files, As the main application lies with injecting faults into ESI files,
@ -28,7 +29,7 @@ and values.
This example prepends the existing inner text of a given node with "Faulty '", This example prepends the existing inner text of a given node with "Faulty '",
and appends the evaluated string "': 2+2=10". and appends the evaluated string "': 2+2=10".
``` ```
text("Faulty '" .. text() .. "': " .. string(1+1^2) .. "+2=10"); text("Faulty '" .. text() .. "': " .. string(1+1**2) .. "+2=10");
``` ```
2. Rules 2. Rules
@ -50,7 +51,7 @@ $("//Device/Type[@ProductCode='#x0B583052' and @RevisionNo='#x00110000']/..")
3. Bangs 3. Bangs
Bangs are special function calls which take either a string or XPath as parameters, Bangs are special function calls which take either a string or XPath as parameters,
and make structural changes to the document. and make addition changes to the document.
They are prefixed with, as the name implies, an exclamation mark. They are prefixed with, as the name implies, an exclamation mark.
This example adds, removes and swaps nodes. This example adds, removes and swaps nodes.

5
xn.slnx Normal file
View File

@ -0,0 +1,5 @@
<Solution>
<Folder Name="/src/">
<Project Path="src/xn.csproj" />
</Folder>
</Solution>