Page 1 of 1

How to generate XML empty element for a numeric field

Posted: Mon Feb 27, 2006 10:43 am
by LisaM
Hello Tx friends,

I am trying to generate a XML empty element(with tags) for a numeric field. However, I've got the element omitted when I assigned the value "NONE" in my map rule. Can some one tell me the trick?

Thank you in advance,

Lisa

Posted: Thu Mar 02, 2006 7:09 am
by janhess
I think you need to specify it as a mandatory field. which version are you using?

Posted: Thu Mar 02, 2006 3:31 pm
by LisaM
It's version 8.0. Do you know where exactly should I specify it as a mandatory field? Where in Type Tree or XSD?

Thanks,

Lisa

Posted: Thu Mar 02, 2006 3:31 pm
by LisaM
It's version 8.0. Do you know where exactly should I specify it as a mandatory field? Where in Type Tree or XSD?

Thanks,

Lisa

Posted: Fri Mar 03, 2006 3:31 am
by janhess
In the type tree specify the range of the item as 1:1

Posted: Fri Mar 03, 2006 3:33 am
by janhess
If your xsd specifies the field as optional then you shouldn't be generating empty tags.

Posted: Tue Mar 07, 2006 10:34 am
by LisaM
Thanks for the posting...

I have tried to specify the range, it didn't work. (1:1 is default)

In terms of the XSD, it is an element in a sequence. I tried to specify minoccurs = 1 , still not working.

Any idea about what I should do with the XSD to generate the empty tag ?

BTW, if the field is string, I can just simply assign " " and get the empty tag output pefectly. But for numeric, I have nothing but "NONE" to work with...

:(

Posted: Tue Mar 07, 2006 10:40 am
by janhess
Your output should be charater not number. XML is all text.

Posted: Wed Mar 08, 2006 2:54 am
by Kirtikumar
janhess wrote:Your output should be charater not number. XML is all text.
I have not worked in TX. But faced similar prob in XML stage and work aorund was - write null to numeric column and then set the XML property -covert Null to empty as true.

It worked.

Posted: Wed Mar 08, 2006 3:04 am
by janhess
Where are you specifying NONE in the rule? If it is at the top level of the element then it is probably omitted. If you do it at the item level for the element you should get your tags but the resulting XML wil be invalid based on your schema which requires a value.