From c5de9e3e53800a63a035b511dad9c577925867a0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 7 Aug 2015 01:37:19 -0700 Subject: [PATCH] Document more attributes. --- parse-all-xml | 10 +++++----- parse-xml.c | 4 ++-- spv-file-format.texi | 34 ++++++++++++++++++++++++++++++---- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/parse-all-xml b/parse-all-xml index dbd71d596b..3d91d23006 100755 --- a/parse-all-xml +++ b/parse-all-xml @@ -6,14 +6,14 @@ # format. lightTables=`ls -1 unzipped/*/*.xml |grep -vE 'notes|table|warning|chart|model' \ | xargs grep -EL '<([a-z]*:)?(model|graph|pageSetup|borderProperties)'` -printf 'Structure:\n' -for d in $lightTables; do - ./parse-xml $d containment -done | sort | uniq -c | sort -rn +#printf 'Structure:\n' +#for d in $lightTables; do +# ./parse-xml $d containment +#done | sort | uniq -c | sort -rn printf '\nAttributes:\n' for d in $lightTables; do - ./parse-xml $d attr:lockReader + ./parse-xml $d attr:type done | sort | uniq -c | sort -rn #printf '\nLabels:\n' diff --git a/parse-xml.c b/parse-xml.c index ad1b41833d..eac05228f1 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -67,7 +67,7 @@ print_attributes (xmlNode * a_node) { for (xmlNode *node = a_node; node; node = node->next) { - if (node->properties && node->parent->type != XML_DOCUMENT_NODE) + if (node->type == XML_ELEMENT_NODE) { printf ("%s", node->name); for (xmlAttr *attr = node->properties; attr; attr = attr->next) @@ -86,7 +86,7 @@ print_attribute (xmlNode *node, const char *attr) { const char *s = (char *) xmlGetProp (node, (xmlChar *) attr); if (s) - puts (s); + printf ("%s %s\n", node->name, s); print_attribute (node->children, attr); } diff --git a/spv-file-format.texi b/spv-file-format.texi index 987a06dcf8..eac26048d9 100644 --- a/spv-file-format.texi +++ b/spv-file-format.texi @@ -143,13 +143,11 @@ The following attributes have been observed only on nested @table @asis @item Required attribute: @code{commandName} The locale-invariant name of the command that produced the output, -e.g.@: @code{Frequencies} or @code{T-Test}. For output not specific -to a command, this is simply @code{log}. +e.g.@: @code{Frequencies}, @code{T-Test}, @code{Non Par Corr}. @item Optional attribute: @code{visibility} To what degree the output represented by the element is visible. The -possible values are @code{visible}, @code{hidden}, and -@code{collapsed}. +only observed value is @code{collapsed}. @item Optional attribute: @code{locale} The locale used for output, in Windows format, which is similar to the @@ -185,10 +183,38 @@ Contents: @code{label} [@code{table} | @code{text}] A @code{container} serves to label a @code{table} or a @code{text} item. +@table @asis +@item Required attribute: @code{visibility} +Either @code{visible} or @code{hidden}, this indicates whether the +container's content is displayed. + +@item Optional attribute: @code{text-align} +Presumably indicates the alignment of text within the container. The +only observed value is @code{left}. Observed with nested @code{table} +and @code{text} elements. + +@item Optional attribute: @code{width} +The width of the container in the form @code{@var{n}px}, e.g.@: +@code{1097px}. +@end table + @item text Parent: @code{container} @* Contents: @code{html} +@table @asis +@item Required attribute: @code{type} +One of @code{title}, @code{log}, or @code{text}. + +@item Optional attribute: @code{commandName} +As on the @code{heading} element. For output not specific to a +command, this is simply @code{log}. The corpus contains one example +of where @code{commandName} is present but set to the empty string. + +@item Optional attribute: @code{creator-version} +As on the @code{heading} element. +@end table + @item html Parent: @code{text} @* Contents: cdata -- 2.30.2