[dmarc-discuss] Using XMLLINT to uncover errors with feedback & XSD files
bcorrigan at majorleaguegaming.com
Thu Jun 14 22:04:32 PDT 2012
Hey Trent & Team -
I'm finding a few more errors as I work with the XSD file itself as
well as the feedback files being sent over. I'm uncovering these
errors using XMLLINT.
My test is:
xmllint --noout --schema rua.xsd ../doc/report_sample_yahoo.xml
I'm working through each error as it comes up. The ones I've found
are listed below:
** XSD File Namespace
The root element needs to define file the default namespace or else
the XSD parser can't reference the file itself for custom defined
types. Since its also defining a namespace, it needs to be equal to
the target namespace.
This fixes it:
** Feedback File Namespace
None of the reports I'm seeing are defining a namespace so one can't
apply the XSD file. There's two options, first we could define a root
element and reference the namespace there (probably not a good idea).
As an example:
The other option is to require the namespace attribute be defined on
the feedback attribute. I prefer this approach.
** XSD File Regex
The regex isn't working because it spans multiple lines (Happens to me
all the time when I forget to turn off auto-fill mode in emacs!). It
needs to be:
** Namespace (Not technically broken)
Finally, the namespace itself. It would be cleaner if we could
declare it as something like "urn:dmarc" instead of
"http://dmarc.org/dmarc-xml/0.1". . If so, we'd have:
I realize the ship may have sailed at this point, but I wanted to at
least get a thread going with issues.
More information about the dmarc-discuss