XML Import and DTD

Hi,

I am trying XML for the first time for DI. I manage to extract data from a source table into an XML template.

However, I would like to use the XML produced as a source in another dataflow. Where should I import this source to? In the DTDs or XML Schemas? But does that mean I need to create DTD or XSD for the source output in order to configure this?

Please advise?

Thanks and Best Regards,
Mark


mark.tan :singapore: (BOB member since 2006-10-10)

Hi All,

I manage to generate the DTD at the query transform → Generate DTD. :smiley:

And I manage to create the DTDs for it. :mrgreen:

However, when I construct the new dataflow with this DTD and the output XML file created, I have a “XML parser failed” error? :cry:

What could be the the cause?

Best Regards,
Mark


mark.tan :singapore: (BOB member since 2006-10-10)

Mixed up the root elements?


Werner Daehn :de: (BOB member since 2004-12-17)

Hi Wender,

This is my DTD file generated using DI.

This is my xml file generated by DI as well.

<?xml version="1.0" encoding="UTF-8"?> N No Y Yes

I have specify that the root element to be “YesNo”. What could be wrong here?

Best Regards,
Mark


mark.tan :singapore: (BOB member since 2006-10-10)

The elements occur multiple times in your XML!

Werner

PS: It’s “Werner” not Wender :cuss:
:mrgreen:


Werner Daehn :de: (BOB member since 2004-12-17)

Hi Werner, :oops:

Apologise as I am no XML expert. hehehe…

Anyway I see your point, but what I don’t quite get it is that the XML and DTD are generated by DI. Hence, shouldn’t it be able to read what it generate just as easily?

Do you mean that in order for the XML source to be readoff, we have to amend the content of the file? And how can DI archieve that?

Best Regards,
Mark


mark.tan :singapore: (BOB member since 2006-10-10)

You cannot generate a DTD out of an XML. You can guess it, but nor generate. Even worse, DI does not generate the DTD from the XML source data, it is using the schema information only. And hence we do not know the keys, the mandatory columns, attributes vs. elements, allowed values, what are repetitive elements,… all that can be included in a XML.

Just compare it with SQL: Out of an insert statement
“insert into tab1 (colA, colB) values 1, ‘XY’)”
you can guess the table structure but quite some information is missing.

So think about the DTD generation in DI as a way to shorten the time to build the DTD, but you still have to edit it.


Werner Daehn :de: (BOB member since 2004-12-17)