XML validation: Difference between revisions
m
→{{header|Wren}}: Minor tidy
m (→{{header|Wren}}: Minor tidy) |
|||
Line 1,106:
{{trans|Nim}}
{{libheader|libxml2}}
Although Wren has
embedded program so we can ask the C host to communicate with Libxml2 for us.
<syntaxhighlight lang="
class Args {
Line 1,158:
<br>
We now embed this in the following C program, compile and run it.
<syntaxhighlight lang="c">/* built with: gcc
#include <stdio.h>
Line 1,300:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
Line 1,319:
{{out}}
Using command <code>./
<pre>'shiporder.xml' validates.</pre>
Using a modified file “shiporder1.xml” where tag “orderperson” has been replaced by “orderperson1”:
|