Page 1 of 1

Including DTD for XML Validation

Posted: Mon Jun 04, 2012 12:40 pm
by rameshrr3
Can I copy paste a DTD anywhere in the XML input stage to validate the XML being processed ? Or does the DTD have to be part of the XML document or a file in the same directory as the XML source? I may need to enforce XML validation in certain jobs at the "Default" level.

Posted: Mon Jun 04, 2012 1:00 pm
by eostic
for xmlInput stage, it has to be part of the current incoming document, fully qualified within the NoNamespaceSchemaLocation or SchemaLocation attribute in the header.

In the xml Stage, it is "the" formal xsd "library" that you import during design time.

Ernie

Posted: Tue Jun 05, 2012 9:51 am
by rameshrr3
Thanks .

Yes you are right , I always use an XSD to create xml table definitions. The xml itself can be used , but is only for a quick and dirty way of creating a table def.

Posted: Tue Jun 05, 2012 10:00 am
by eostic
Yes...but a separate topic. The xsd can help generate the tabledef(s), but is critical if you want to perform formal xml "validation". With xmlInput Stage, you can generate the metadata for the output link any way you want, even hand type it, and still do validation by the "run time" value of the xsd that is inside of the incoming content.

I've had situations where I have "zapped" the schemaLocation attribute on my own to dynamically insert the name of an xsd when validation was desired. It's easy to do if the document isn't too large and you have access to it (either from a folder stage, or an MQ stage, or perhaps a database or file based stage).

Ernie