G
Guest
I've the following code:
writer.WriteStartDocument();
writer.WriteStartElement("n", "Property", "http://www.aaa.com");
writer.WriteAttributeString("xmlns", "j", null, "http://www.bbb.com");
writer.WriteAttributeString("xmlns", "n", null, "http://www.aaa.com");
writer.WriteElementString("PropertyDescriptionText", "http://www.bbb.com",
"hello");
string prefix = writer.LookupPrefix("http://www.aaa.com");
string prefix2 = writer.LookupPrefix("http://www.bbb.com");
writer.WriteElementString("PropertyUNCode", "http://www.aaa.com", "1234");
writer.WriteStartElement(prefix2, "PropertyStatus", "http://www.bbb.com");
writer.WriteElementString("StatusText", "http://www.bbb.com", "FOUND");
writer.WriteEndElement();
....
I got the following output
<nroperty xmlns:n="http://www.aaa.org">
<jropertyDescriptionText
xmlns:j="http://www.bbb.com">Hello</jropertyDescriptionText>
<nropertyUNCode>1234</nropertyUNCode>
<jropertyStatus xmlns:j="http://www.bbb.com">
<j:StatusText>FOUND</j:StatusText>
</jropertyStatus>
Instead i want the output to be
<nroperty xmlns:n="http://www.aaa.com" xmlns:j="http://www.bbb.com">
<jropertyDescriptionText>Hello</jropertyDescriptionText>
<nropertyUNCode>1234</nropertyUNCode>
<jropertyStatus>
<j:StatusText>FOUND</j:StatusText>
</jropertyStatus>
where xmlns:j is the attribute of the root node and get rid of subsequence
display of the namespace in element that refering to "http:www.bbb.com"
writer.WriteStartDocument();
writer.WriteStartElement("n", "Property", "http://www.aaa.com");
writer.WriteAttributeString("xmlns", "j", null, "http://www.bbb.com");
writer.WriteAttributeString("xmlns", "n", null, "http://www.aaa.com");
writer.WriteElementString("PropertyDescriptionText", "http://www.bbb.com",
"hello");
string prefix = writer.LookupPrefix("http://www.aaa.com");
string prefix2 = writer.LookupPrefix("http://www.bbb.com");
writer.WriteElementString("PropertyUNCode", "http://www.aaa.com", "1234");
writer.WriteStartElement(prefix2, "PropertyStatus", "http://www.bbb.com");
writer.WriteElementString("StatusText", "http://www.bbb.com", "FOUND");
writer.WriteEndElement();
....
I got the following output
<nroperty xmlns:n="http://www.aaa.org">
<jropertyDescriptionText
xmlns:j="http://www.bbb.com">Hello</jropertyDescriptionText>
<nropertyUNCode>1234</nropertyUNCode>
<jropertyStatus xmlns:j="http://www.bbb.com">
<j:StatusText>FOUND</j:StatusText>
</jropertyStatus>
Instead i want the output to be
<nroperty xmlns:n="http://www.aaa.com" xmlns:j="http://www.bbb.com">
<jropertyDescriptionText>Hello</jropertyDescriptionText>
<nropertyUNCode>1234</nropertyUNCode>
<jropertyStatus>
<j:StatusText>FOUND</j:StatusText>
</jropertyStatus>
where xmlns:j is the attribute of the root node and get rid of subsequence
display of the namespace in element that refering to "http:www.bbb.com"