Exporting as XML

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
dfkettle
Participant
Posts: 27
Joined: Tue Jun 13, 2006 6:56 am

Exporting as XML

Post by dfkettle »

Has anyone tried exporting DataStage jobs in XML format and generating DTD information at the same time? Whenever I try to do this and read the results into an XML parser (for example, Altova XMLSpy), I get an "invalid XML" error.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not sure what you mean by generating DTD information 'at the same time'. There's no export option for that. Are you using XML Spy to generate the DTD? Can't say that I've ever actually tried that.

You do know there is a DSExportSchema.xsd file in the DataStage directory on your pc, yes? No DTD generation required. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
dfkettle
Participant
Posts: 27
Joined: Tue Jun 13, 2006 6:56 am

Post by dfkettle »

Yes, there is an option for that. In the Export dialog box, on the "XML"
panel, there's a check box labelled "Include DTD in document". Look
again.

And no, I'm not using XML Spy to generate the DTD, I'm using DataStage
Manager.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ok, my mistake... I generally don't bother with exporting anything as XML as it's typically a huge waste of time on the import side. Curious why you would be doing this but that's probably a question for another day.

A couple of other points on my ranked as 'oh so unhelpful' post. First off, why bother with a DTD when you've got an xsd nowadays? :? Secondly, I'd say you've got an XMLSpy issue rather than a DataStage one - are you sure it can handle a DTD that is, as the Help puts it, is 'embedded in its preamble'? I know it can handle separate DTDs but can't say I've ever tried (or seen for that matter) an 'embedded' one before this, have you?

You might want to post that question on an XMLSpy support forum. Unless you've done this before and you know the issue is a DataStage issue, that is.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dfkettle
Participant
Posts: 27
Joined: Tue Jun 13, 2006 6:56 am

Post by dfkettle »

No, it's not an XML Spy issue. I've had the same problem trying to read exported DataStage jobs with other XML parsers, and I have been able to read other XML documents with imbedded DTD's in XML Spy. Given your admission that you've never even tried to export DS jobs with DTD's, why would you assume that it's a problem in XML Spy? Have you ever used XML Spy?

As for why I want to do this, I want to be able search the exported XML files, edit them and generate documentation, which is very easy to do in XML Spy (and probably many other XML tools as well). So I don't think it's a "huge waste of time" (I have no need to re-import the XML into DS). I could use the supplied Schema, as you suggested earlier, but I just wanted to know if anyone else has experienced the same problem with DTD's. Maybe, just maybe, if there is a problem with the generated DTD's, IBM might get around to fixing it.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:roll: The 'huge waste of time' comment was strictly for exporting as XML and then re-importing, as the first thing it needs to do is convert the XML back to DSX format before it can do the actual import. Hence the comment.

Yes, I've used XMLSpy. There was no assumption of an issue there, but more of a speculation and was just trying to get that possibility off the table. Thanks for clearing that up in such a tactful way.
dfkettle wrote:Maybe, just maybe, if there is a problem with the generated DTD's, IBM might get around to fixing it.
Maybe, just maybe, you should ask IBM or at least make support aware of the issue.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dfkettle
Participant
Posts: 27
Joined: Tue Jun 13, 2006 6:56 am

Re: Exporting as XML

Post by dfkettle »

For anyone genuinely interested in this topic, I tried using the Schema
definition installed with the DataStage client, rather than the DTD generated when you export a job in Manager. I had a few problems with it as well, there are some attributes missing from the definition (as supplied with DS 7.5.1.A, server edition).

The following attributes have to be added to the "Header" element:

<xs:attribute name="ServerVersion" type="xs:string"/>
<xs:attribute name="ClientInstallPath" type="xs:string"/>

And the following attribute has to be added to the "Record" element:

<xs:attribute name="IsStage" type="xs:boolean"/>

There may be others missing as well, but they didn't occur in the data I was testing with. (I noticed that the Schema definition hasn't been updated since April 2003, according to the comments.)

If any IBM'ers are listening, please pass this on, maybe they can add this to the next release, if they haven't already done so.
Post Reply