0

Can anyone help me on writing this line on xml file?

<userfield id="sociedad" datatype="string">SS</userfield>    

I've tried something like this:

Debtor.Attributes['datatype'] := 'string';
Debtor.Attributes['userfield id'] := 'sociedad';

But when I execute the program I have an error on attribute 'userfield id'.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
user1984193
  • 41
  • 1
  • 1
  • 4
  • Please don't write "I have an error". Please reproduce the error verbatim. Also, please do try to supply an SSCCE. You should be able to supply a 20 line SSCCE for this problem. If you do that you are certain to get excellent answers that solve your problem. – David Heffernan Jan 24 '14 at 16:19

2 Answers2

2

You did it properly in the first line, without using userfield (which is the tag name):

Debtor.Attributes['datatype'] := 'string';

You should do it the same in the second - set the id attribute:

Debtor.Attributes['id'] := 'sociedad';
Ken White
  • 123,280
  • 14
  • 225
  • 444
0

userfield is the tag. The attribute is id. So, your code should read:

Debtor.Attributes['id'] := 'sociedad';
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490