Hello,
I want to generate this xml header:
="1.0"="UTF-8"
<ru:myobject XML_DATA="2.1.0"
xmlns:ru="http://www.aaa.com" xmlns:t="http://www.bbb.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.aaa.com aaa.xsd
http://www.bbb.com bbb.xsd
http://www.ccc.com ddd.xsd">
The problem is the namespace in xsi:schemaLocation atribute.
here is my code:
XNamespace mynamespace = "http://www.aaa.com/test/";
XNamespace xsi = "http://www.aaa.com/test/ aaa.xsd http://www.bbb.com bbb.xsd http://www.ccc.com ccc.xsd";
XElement myobject = new XElement(mynamespace + "myobject", new XAttribute("XML_DATA", "2.1.0"));
myobject.Add(new XAttribute(XNamespace.Xmlns + "ru", "http://www.aaa.com"));
myobject.Add(new XAttribute(XNamespace.Xmlns + "t", "http://www.bbb.com"));
myobject.Add(new XAttribute(XNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance"));
myobject.Add(new XAttribute(xsi+"schemaLocation", xsi.ToString()));
It generates this header and I don't know why.
="1.0"="UTF-8"
<ru:myobject XML_DATA="2.1.0"
xmlns:ru="http://www.aaa.com" xmlns:t="http://www.bbb.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
p3:schemaLocation=" http://www.aaa.com aaa.xsd http://www.bbb.com bbb.xsd http://www.ccc.com ddd.xsd"
xmlns:p3="http://www.aaa.com aaa.xsd http://www.bbb.com bbb.xsd http://www.ccc.com ddd.xsd">
Can anyone help? I'm newbie in xml