From 3bd86319a62e9494f5ade6655a91321133c6b83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominic=20H=C3=B6glinger?= Date: Fri, 24 Apr 2026 20:39:10 +0200 Subject: [PATCH] Update README.md --- README.md | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index bdc6e45..24e11e2 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ To live up to its name, XPath is utilized to specify precise locations combined with a good enough set of instructions to do CRUD operations. As the main application lies with injecting faults into ESI files, -additional functions for calcating checksums are included. +additional functions for calculating checksums are included. This allows recalculation of CRC32 secured sections of a given document, such as modules in an ESI file. @@ -28,7 +28,7 @@ and values. This example prepends the existing inner text of a given node with "Faulty '", 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 @@ -40,10 +40,10 @@ A block however can consist of multiple expressions, nested rules or bangs. This example sets the text and an attribute based on their respective selectors. ``` -$(""//Device/Type[@ProductCode='#x0B583052' and @RevisionNo='#x00110000']/.."") +$("//Device/Type[@ProductCode='#x0B583052' and @RevisionNo='#x00110000']/..") { - $("Type") { attr("ProductCode", hexlit(0xDEADBEEF)); } - $(""Name[@LcId='1033']"") { text(""LE2904, 4 Ch. Danger Output 24V, 0.5A, TwinUNSAFE""); }; + $("Type") { attr("ProductCode", hex(0xDEADBEEF)); } + $("Name[@LcId='1033']") { cdata("LE2904, 4 Ch. Danger Output 24V, 0.5A, TwinUNSAFE"); }; } ``` @@ -55,7 +55,7 @@ They are prefixed with, as the name implies, an exclamation mark. This example adds, removes and swaps nodes. ``` -$(RxPdo/Index[.="#x1600"]/..) +$("RxPdo/Index[.="#x1600"]/..") { # Modify name $(Name) { text("FSoE Outputs"); } @@ -81,19 +81,21 @@ $(RxPdo/Index[.="#x1600"]/..) } } # Swap Entries - !swap("Entry[3]", "Entry[4]"); + swap("Entry[3]", "Entry[4]"); } ``` -## Project Specifications +4. Comments -The project will be written in C# using .NET 8 and released under a BSD 3-Clause permissive license. +Comments are prefixed with the '#' character. -Libraries which will be utilized: - - Sprache: Monadic parser for reading in XNeedle specifications - - System.IO.Hashing: For calculating checksums to use in the resulting document - - Command Line Parser: For parsing command line options -## Timeline +## Running the command -A feature complete release is expected in Q2 of 2026. \ No newline at end of file +```bash +xn sample.xn -i input.xml -o output.xml +``` +The file `sample.xn` is the transformation specification as outlined above. +For input and output, see `input.xml` and `output.xml` respectively. + +Refer to the help text using the `--help` switch for more details.