Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSetToXml() and trimming fields
Message
From
07/04/2008 03:37:47
 
 
To
06/04/2008 16:32:16
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01308460
Message ID:
01308651
Views:
10
>>I assume you're referring only to DataColumns of type string? AFAIK you would need to either .Trim() the values or replace with String.Empty at some point before calling WriteXML.
>
>Well, even if I replace in the table or in the dataset, because each character field is defined for a specific length, this will not change anything if I trim the value. Basically, it would be after DataSetToXml() would be done that I would have to parse the entire XML and trim where appropriate. But, this is a very difficult task. This is why I was hoping to have something at the WriteXML() level so it would be smart enough to avoid keeping spaces that are not needed.

Can't test right now but I don't think that you will be prevented from trimming - there's no minimum length for a DataColumn AFAIR. Did you try it?
I also thought of suggesting making the change after translation to XML and it shouldn't be that hard using XSLT (or maybe regular expressions) but doing it before it still simplest.
Regards,
Viv
Previous
Reply
Map
View

Click here to load this message in the networking platform