{
for (xmlNode *node = a_node; node; node = node->next)
{
- if (node->properties)
+ if (node->properties && node->parent->type != XML_DOCUMENT_NODE)
{
printf ("%s", node->name);
for (xmlAttr *attr = node->properties; attr; attr = attr->next)
}
}
+static void
+print_attribute (xmlNode *node, const char *attr)
+{
+ for (; node; node = node->next)
+ {
+ const char *s = (char *) xmlGetProp (node, (xmlChar *) attr);
+ if (s)
+ puts (s);
+
+ print_attribute (node->children, attr);
+ }
+}
+
static void
usage (void)
{
print_containment (root);
else if (!strcmp(argv[2], "attributes"))
print_attributes (root);
+ else if (!strncmp(argv[2], "attr:", 5))
+ print_attribute (root, argv[2] + 5);
else if (!strcmp(argv[2], "labels"))
print_labels (root);
else
ordinarily followed by a container for content and possibly further
nested (sub)-sections of output.
+The following attributes have been observed on both document root and
+nested @code{heading} elements:
+
+@table @asis
+@item Optional attribute: @code{creator-version}
+The version of the software that created this SPV file. A string of
+the form @code{xxyyzzww} represents software version xx.yy.zz.ww,
+e.g.@: @code{21000001} is version 21.0.0.1. Trailing pairs of zeros
+are sometimes omitted, so that @code{21}, @code{210000}, and
+@code{21000000} are all version 21.0.0.0 (and the corpus contains all
+three of those forms).
+@end table
+
+The following attributes have been observed on document root
+@code{heading} elements only:
+
+@table @asis
+@item Optional attribute: @code{creator}
+The directory of the software that created this SPV file,
+e.g. @file{C:\PROGRA~1\IBM\SPSS\STATIS~1\22} or
+@file{/Applications/IBM/SPSS/Statistics/22/SPSSStatistics.app/Contents/Resources/Java/../../bin}.
+
+@item Optional attribute: @code{creation-date-time}
+The date and time at which the SPV file was written, in a
+locale-specific format, e.g. @code{Friday, May 16, 2014 6:47:37 PM
+PDT} or @code{lunedì 17 marzo 2014 3.15.48 CET} or even @code{Friday,
+December 5, 2014 5:00:19 o'clock PM EST}.
+
+@item Optional attribute: @code{lockReader}
+Whether a reader should be allowed to edit the output. The possible
+values are @code{true} and @code{false}, but the corpus only contains
+@code{false}.
+
+@item Optional attribute: @code{schemaLocation}
+This is actually an XML Namespace attribute. A reader may ignore it.
+@end table
+
+The following attributes have been observed only on nested
+@code{heading} elements:
+
+@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}.
+
+@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}.
+
+@item Optional attribute: @code{locale}
+The locale used for output, in Windows format, which is similar to the
+format used in Unix with the underscore replaced by a hyphen, e.g.@:
+@code{en-US}, @code{en-GB}, @code{el-GR}, @code{sr-Cryl-RS}.
+
+@item Optional attribute: @code{olang}
+The output language, e.g.@: @code{en}, @code{it}, @code{es},
+@code{de}, @code{pt-BR}.
+@end table
+
@item label
Parent: @code{heading} or @code{container} @*
Contents: text
Parent: @code{heading} @*
Contents: @code{label} [@code{table} | @code{text}]
-A @code{container} is the immediate parent of a
+A @code{container} serves to label a @code{table} or a @code{text}
+item.
+
+@item text
+Parent: @code{container} @*
+Contents: @code{html}
+
+@item html
+Parent: @code{text} @*
+Contents: cdata
+
+@item table
+Parent: @code{container} @*
+Contents: @code{tableStructure}
+
+@item tableStructure
+Parent: @code{table}
+Contents: @code{dataPath}
+
+@item dataPath
+Parent: @code{tableStructure}
+Contents: text
@end table