O
occ
Hi,
I have been trying to generate a xml file via typed datasets using the
writexml method. The xml I am after is
<?xml version="1.0" standalone="yes" ?>
- <bw:ABC xmlns:bw="http://tempuri.org/ABC.xsd">
- <bw:Employee>
<bw:EmployeeID>1</EmployeeID>
<bw:EmployeeName>John</EmployeeName>
</bw:Employee>
- <bw:Employee>
<bw:EmployeeID>2</EmployeeID>
<bw:EmployeeName>Peter</EmployeeName>
</bw:Employee>
</bw:ABC>
how ever when I run my code I get the following:
<?xml version="1.0" standalone="yes" ?>
- <bw:ABC xmlns:bw="http://tempuri.org/ABC.xsd">
- <bw:Employee>
<EmployeeID xmlns="http://tempuri.org/ABC.xsd">1</EmployeeID>
<EmployeeName xmlns="http://tempuri.org/ABC.xsd">John</
EmployeeName>
</bw:Employee>
- <bw:Employee>
<EmployeeID xmlns="http://tempuri.org/ABC.xsd">2</EmployeeID>
<EmployeeName xmlns="http://tempuri.org/ABC.xsd">Peter</
EmployeeName>
</bw:Employee>
</bw:ABC>
the csharp code looks like this
ABC bw = new ABC ();
bw.Prefix = "bw";
ABC.EmployeeDataTable employee = (ABC.EmployeeDataTable)bw.Tables
["Employee"];
employee.Prefix = "bw";
ABC.EmployeeRow employeeRow1 = employee.NewEmployeeRow
();
employeeRow1.EmployeeID = 1;
employeeRow1.EmployeeName = "John";
employee.AddEmployeeRow(employeeRow1);
ABC.EmployeeRow employeeRow2 = employee.NewEmployeeRow();
employeeRow2.EmployeeID = 2;
employeeRow2.EmployeeName = "Peter";
employee.AddEmployeeRow(employeeRow2);
bw.WriteXml("c:\\abc.xml");
how can I get rid of the xmlns attribute from the xml file and prefix
with bw.There is no prefix property for DataRow field.
I have been trying to generate a xml file via typed datasets using the
writexml method. The xml I am after is
<?xml version="1.0" standalone="yes" ?>
- <bw:ABC xmlns:bw="http://tempuri.org/ABC.xsd">
- <bw:Employee>
<bw:EmployeeID>1</EmployeeID>
<bw:EmployeeName>John</EmployeeName>
</bw:Employee>
- <bw:Employee>
<bw:EmployeeID>2</EmployeeID>
<bw:EmployeeName>Peter</EmployeeName>
</bw:Employee>
</bw:ABC>
how ever when I run my code I get the following:
<?xml version="1.0" standalone="yes" ?>
- <bw:ABC xmlns:bw="http://tempuri.org/ABC.xsd">
- <bw:Employee>
<EmployeeID xmlns="http://tempuri.org/ABC.xsd">1</EmployeeID>
<EmployeeName xmlns="http://tempuri.org/ABC.xsd">John</
EmployeeName>
</bw:Employee>
- <bw:Employee>
<EmployeeID xmlns="http://tempuri.org/ABC.xsd">2</EmployeeID>
<EmployeeName xmlns="http://tempuri.org/ABC.xsd">Peter</
EmployeeName>
</bw:Employee>
</bw:ABC>
the csharp code looks like this
ABC bw = new ABC ();
bw.Prefix = "bw";
ABC.EmployeeDataTable employee = (ABC.EmployeeDataTable)bw.Tables
["Employee"];
employee.Prefix = "bw";
ABC.EmployeeRow employeeRow1 = employee.NewEmployeeRow
();
employeeRow1.EmployeeID = 1;
employeeRow1.EmployeeName = "John";
employee.AddEmployeeRow(employeeRow1);
ABC.EmployeeRow employeeRow2 = employee.NewEmployeeRow();
employeeRow2.EmployeeID = 2;
employeeRow2.EmployeeName = "Peter";
employee.AddEmployeeRow(employeeRow2);
bw.WriteXml("c:\\abc.xml");
how can I get rid of the xmlns attribute from the xml file and prefix
with bw.There is no prefix property for DataRow field.