[dmarc-discuss] Using XMLLINT to uncover errors with feedback & XSD files

Brian Corrigan bcorrigan at majorleaguegaming.com
Fri Jun 15 08:13:40 PDT 2012


Anytime!  Hope its helping; I'm really excited about all the work you
guys are doing.  This is the first spec draft I've ever had time to
contribute to; its been fun (even though its a small contribution!)

On Fri, Jun 15, 2012 at 10:51 AM, J. Trent Adams <jtrentadams at gmail.com> wrote:
>
> Brian -
>
> Many thanks for going through this exercise of proofing the XSD, it's
> been one of those things on our to-do list (but keeps slipping). Much
> appreciated.
>
> Other comments inline:
>
> On 6/14/12 11:04 PM, Brian Corrigan wrote:
>> 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:
>> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>   targetNamespace="http://dmarc.org/dmarc-xml/0.1"
>>   xmlns="http://dmarc.org/dmarc-xml/0.1">
>
> Good catch... annoying oversight that I'll correct.
>
>>
>> ** 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:
>>
>> <root xmlns="http://dmarc.org/dmarc-xml/0.1">
>> <feedback></feedback>
>> </root>
>>
>> The other option is to require the namespace attribute be defined on
>> the feedback attribute.  I prefer this approach.
>>
>> <provider:feedback xmlns:provider="http://dmarc.org/dmarc-xml/0.1">
>> </provider:feedback>
>
> I'm not surprised that the reports aren't defining the namespace. The
> early report generators in production (eg. Yahoo's and Gmail's) predate
> the XSD (and in some cases the spec itself)... so we're playing a bit of
> catch-up here.
>
> Let's noodle this suggestion a bit more (as there may be similar items
> that shake out at the Interop that fall into the same category).
>
>>
>> ** 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:
>>
>> <xs:pattern value="((1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]).){3}(1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])|([A-Fa-f0-9]{1,4}:){7}[A-Fa-f0-9]{1,4}"/>
>
> Thanks, that's another annoying oversight that I'll correct. Line breaks
> are the bane of my existence.
>
>>
>> ** 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:
>> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>   targetNamespace="urn:dmarc"
>>   xmlns="urn:dmarc">
>> ...
>> <provider:feedback xmlns="urn:dmarc">
>
> That's probably a reasonable idea, especially if we find we're extending
> it to include additional elements (eg. provider:feedback). That should
> be an easy tweak to improve extensibility, but we should chat amongst
> the crew to shake loose comments.
>
> Thanks (again) for the review and suggestions.
>
> - Trent
>
>>
>> Etc.
>>
>>
>>
>> I realize the ship may have sailed at this point, but I wanted to at
>> least get a thread going with issues.
>>
>> Thanks guys!
>> B
>> _______________________________________________
>> dmarc-discuss mailing list
>> dmarc-discuss at dmarc.org
>> http://www.dmarc.org/mailman/listinfo/dmarc-discuss
>> NOTE: Participating in this list means you agree to the DMARC Note Well terms (http://www.dmarc.org/note_well.html)
>
> --
> J. Trent Adams
> =jtrentadams
>
> Profile: http://www.mediaslate.org/jtrentadams/
> LinkedIN: http://www.linkedin.com/in/jtrentadams
> Twitter: http://twitter.com/jtrentadams
>
> _______________________________________________
> dmarc-discuss mailing list
> dmarc-discuss at dmarc.org
> http://www.dmarc.org/mailman/listinfo/dmarc-discuss
> NOTE: Participating in this list means you agree to the DMARC Note Well terms (http://www.dmarc.org/note_well.html)



More information about the dmarc-discuss mailing list