cancel
Showing results for 
Search instead for 
Did you mean: 

PB Classic 12.5.2 DW XML and empty strings

Former Member
0 Kudos

I want to send an XML representation of the data in a datastore to a web service. I get the XML with dw1.Object.DataWindow.Data.XML.

However it doesn't differentiate between empty string data and data that is null, something that is quite important since I am saving it to a database. It marks any columns with empty string and null the same, with a nill="true".

Does anyone know of any way for it not to do this? I'd like empty string to be represented as an empty XML element and nulls with a nill="true".

Thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Aron;

1) Set the "empty string is null" property in the DWO's column(s) edit mask as appropriate.

2) In the "Data Export" tab of the DWO, set the "Meta Data Type" to XMLSchema!

3) Set the "save Meta Data" default to MetaDataInternal!  (default).

That should (hopefully) have the DWO's include the nillable="true" and nil="true" you are looking for in its XML data stream. 

HTH

regards ... Chris

Former Member
0 Kudos

Thanks (again ) Chris, but it's the other way round, I'm getting the nill="true" bit, but I get it on the data that is empty string as well. What I want is to NOT get it on empty string values.

I tried your suggestion anyway, but it didn't change the XML that was exported.

Former Member
0 Kudos

<my bad> ... sorry for getting that in backwards!

So ... just reverse my advise:

1) Uncheck the "empty string is null" property in the DWO's column(s) edit mask as appropriate.

2) In the "Data Export" tab of the DWO, set the "Format to configure" to XML

3) In the "Data Export" tab of the DWO, set the "Meta Data Type" to XMLNone!

   That should make the DWO's suppress the nillable="true" and nil="true" and return null columns to "empty". 

Former Member
0 Kudos

Thank Chris, didn't get a chance to try it today, what with re-writing all my updates to retrieves But hopefully will give it a go tomorrow. I'll report my results for posterity and mark your answer as correct then.