XML File read follow up

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
wjfitzgerald
Participant
Posts: 72
Joined: Tue Feb 05, 2008 4:38 am

XML File read follow up

Post by wjfitzgerald »

Good morning,

I am working on transforming an xml file to a flat file, and have it working for a basic file. i am now trying to move on to the more complex file structure that is actually going to be used and, of course i am getting an error!

can any one tell me what the following means, please?
[i]xmlreadsepa..XML_Input_0: The name '{0}' is not a valid NCName.
expression = '/:SCTIcfBlkCredTrf' Remaining tokens are: ('/')[/i]

as an aside could anyone explain the concept of repitition element required to me please? i have read the XML pdf and the duke notes, but fear i am missing the point somehow.

As always, thanks in advance.

Regards[color=black][/color]
John Fitz
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First question, in my mind, would be to confirm how your XPath Expressions were generated. Automatically from an xsd?
-craig

"You can never have too many knives" -- Logan Nine Fingers
wjfitzgerald
Participant
Posts: 72
Joined: Tue Feb 05, 2008 4:38 am

Post by wjfitzgerald »

Hi,

I had a sample file and used the import an xml file definiton option. Is this what you mean by automatically from aN XSD?

(I am a cobol mainframe programmer and so am out of the comfirt zone slightly and don't have all the lingo, i'm afraid.)

thanks again
John Fitz
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No. While reading the sample file directly can be "ok" you really need to get your hands on an ".xsd" which is the "schema definition" file. Any chance of requsting that from whomever is creating the file?
-craig

"You can never have too many knives" -- Logan Nine Fingers
wjfitzgerald
Participant
Posts: 72
Joined: Tue Feb 05, 2008 4:38 am

Post by wjfitzgerald »

I'll go chase that down and see if that solves my problems.

Thanks again.
John Fitz
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

The symptom above with the {0} in the message looks like one of the 8.0 anomalies that there is a patch for. You will want to contact support for the 8.0 patches to XML.

One of the issues was namespaces.....if that's your current issue, you can get around it temporarily to test your Job's logic by manually editing out the namespaces in the document (all the xmlns:xyz="http://x.y.z" and the prefixes where xyz: is then used below in the document).

As for repetition element, I generally refer to it as "an element at the lowest level node in the document that I am interested in." It's the node that you expect will "repeat" for "n" rows. An xml document for employees in a company might go deep thru a hierarchy of division, department, team, and then have employee as the lowest interesting node. EmployeeName might then be the repeating element (give it key=yes --- it has nothing do to with "keys").

As suggested above, an xsd is a good idea, but you can import from the document --- just be careful about elements that are not in the document that you imported from, and also give careful consideration to you datatypes.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
wjfitzgerald
Participant
Posts: 72
Joined: Tue Feb 05, 2008 4:38 am

thanks

Post by wjfitzgerald »

thanks ernie, i will chase up the patch this morning.

these things always make sense once you understand them!

regards

john fitz
John Fitz
Post Reply