I have the same question/problem: The description for "advanced custom sensors" leaves very much unclear.
To me it seems having a DTD shows that there was some design behind the structure.
See also http://usingxml.com/Basics/XmlValidation
With "just XML" you can build arbitrary trees of data, but that does not help much.
I used XSLT to transform my intermediate XML to that probably needed or "digestable" by PRTG, but I have no idea whether it is correct or not. Of course I have a DTD for my own data, and I can verify the XML conforms to the DTD.
Even more: the docs on advanced sensors suggest both:
There is one result element with multiple channels, or there are multiple result elements with one channel each.
With a DTD it would be clear whether one, the other, or both are correct.
With a background from Nagios monitoring plugins I must say that the documentation available for those is not only much better, but it's also much easier to implement.
Let me also make a comparison:
Back in the early 80-ies (when SGML already existed) the syntax of BASIC (that was nor very regular, BTW) was described with text and examples. In contrast Pascal has "syntax diagrams" (somehow equivalent to a DTD); it was much easier to decide, what is invalid and what is allowed than with the description for basic.
You can put punch card data in an XML envelope, but it's still old punch card data. To me it seems the power of XML is not being used at all; XML at that level is just equivalent to using nested balanced parentheses.
so instead of `<a>x<b>y</b></a>` you could write `(a "x" (b` "y"))` without loosing any information. "Welcome back to LIPS!" I'm tempted to say.
Long story short: Try to be professional: Provide a DTD for your expected XML input, or if it turns out to be impossible with the current structure, fix the XML structure!
Add comment