Document more attributes.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 7 Aug 2015 08:37:19 +0000 (01:37 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 7 Aug 2015 08:37:19 +0000 (01:37 -0700)
parse-all-xml
parse-xml.c
spv-file-format.texi

index dbd71d596b234473a0bc1acd6efd6fea019aa692..3d91d23006bbf25ed7373895b1b34884ab184e04 100755 (executable)
@@ -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'
index ad1b41833d2908b4b4714cdfc8bd8342a058b782..eac05228f1448d8ad2478f4ef8907e3c3f63ff31 100644 (file)
@@ -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);
     }
index 987a06dcf8200fb702dd4bf618780da4ecea472f..eac26048d9bab842283f70096fc31f645186a2c4 100644 (file)
@@ -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