mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-06 13:45:00 +00:00
Add command-line arg "-N" to xmlwf to add notations to test output
...and use it in xmltest.sh
This commit is contained in:
parent
688ecaa7ab
commit
0da3d1b5bf
3 changed files with 28 additions and 6 deletions
|
@ -58,6 +58,7 @@
|
|||
|
||||
<arg><option>-r</option></arg>
|
||||
<arg><option>-t</option></arg>
|
||||
<arg><option>-N</option></arg>
|
||||
|
||||
<arg><option>-v</option></arg>
|
||||
|
||||
|
@ -159,8 +160,8 @@ supports both.
|
|||
representations of the input files.
|
||||
By default, <option>-d</option> outputs a canonical representation
|
||||
(described below).
|
||||
You can select different output formats using <option>-c</option>
|
||||
and <option>-m</option>.
|
||||
You can select different output formats using <option>-c</option>,
|
||||
<option>-m</option> and <option>-N</option>.
|
||||
</para>
|
||||
<para>
|
||||
The output filenames will
|
||||
|
@ -219,6 +220,17 @@ supports both.
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-N</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Adds a doctype and notation declarations to canonical XML output.
|
||||
This matches the example output used by the formal XML test cases.
|
||||
Requires <option>-d</option> to specify an output file.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-p</option></term>
|
||||
<listitem>
|
||||
|
|
|
@ -53,7 +53,7 @@ RunXmlwfNotWF() {
|
|||
RunXmlwfWF() {
|
||||
file="$1"
|
||||
reldir="$2"
|
||||
$XMLWF -p -d "$OUTPUT$reldir" "$file" > outfile || return $?
|
||||
$XMLWF -p -N -d "$OUTPUT$reldir" "$file" > outfile || return $?
|
||||
read outdata < outfile
|
||||
if test "$outdata" = "" ; then
|
||||
if [ -f "out/$file" ] ; then
|
||||
|
|
|
@ -454,6 +454,9 @@ notationDecl(void *UNUSED_P(userData),
|
|||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
entry->publicId = NULL;
|
||||
}
|
||||
|
||||
entry->next = notationListHead;
|
||||
notationListHead = entry;
|
||||
|
@ -848,7 +851,7 @@ static void
|
|||
usage(const XML_Char *prog, int rc)
|
||||
{
|
||||
ftprintf(stderr,
|
||||
T("usage: %s [-s] [-n] [-p] [-x] [-e encoding] [-w] [-d output-dir] [-c] [-m] [-r] [-t] [file ...]\n"), prog);
|
||||
T("usage: %s [-s] [-n] [-p] [-x] [-e encoding] [-w] [-d output-dir] [-c] [-m] [-r] [-t] [-N] [file ...]\n"), prog);
|
||||
exit(rc);
|
||||
}
|
||||
|
||||
|
@ -863,6 +866,7 @@ tmain(int argc, XML_Char **argv)
|
|||
int outputType = 0;
|
||||
int useNamespaces = 0;
|
||||
int requireStandalone = 0;
|
||||
int requiresNotations = 0;
|
||||
enum XML_ParamEntityParsing paramEntityParsing =
|
||||
XML_PARAM_ENTITY_PARSING_NEVER;
|
||||
int useStdin = 0;
|
||||
|
@ -920,6 +924,10 @@ tmain(int argc, XML_Char **argv)
|
|||
outputType = 't';
|
||||
j++;
|
||||
break;
|
||||
case T('N'):
|
||||
requiresNotations = 1;
|
||||
j++;
|
||||
break;
|
||||
case T('d'):
|
||||
if (argv[i][j + 1] == T('\0')) {
|
||||
if (++i == argc)
|
||||
|
@ -1057,8 +1065,10 @@ tmain(int argc, XML_Char **argv)
|
|||
XML_SetCharacterDataHandler(parser, characterData);
|
||||
#ifndef W3C14N
|
||||
XML_SetProcessingInstructionHandler(parser, processingInstruction);
|
||||
XML_SetDoctypeDeclHandler(parser, startDoctypeDecl, endDoctypeDecl);
|
||||
XML_SetNotationDeclHandler(parser, notationDecl);
|
||||
if (requiresNotations) {
|
||||
XML_SetDoctypeDeclHandler(parser, startDoctypeDecl, endDoctypeDecl);
|
||||
XML_SetNotationDeclHandler(parser, notationDecl);
|
||||
}
|
||||
#endif /* not W3C14N */
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue