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
<n
roperty xmlns:n="http://www.aaa.org">
<j
ropertyDescriptionText
xmlns:j="http://www.bbb.com">Hello</j
ropertyDescriptionText>
<n
ropertyUNCode>1234</n
ropertyUNCode>
<j
ropertyStatus xmlns:j="http://www.bbb.com">
<j:StatusText>FOUND</j:StatusText>
</j
ropertyStatus>
Instead i want the output to be
<n
roperty xmlns:n="http://www.aaa.com" xmlns:j="http://www.bbb.com">
<j
ropertyDescriptionText>Hello</j
ropertyDescriptionText>
<n
ropertyUNCode>1234</n
ropertyUNCode>
<j
ropertyStatus>
<j:StatusText>FOUND</j:StatusText>
</j
ropertyStatus>
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
<n

<j

xmlns:j="http://www.bbb.com">Hello</j

<n


<j

<j:StatusText>FOUND</j:StatusText>
</j

Instead i want the output to be
<n

<j


<n


<j

<j:StatusText>FOUND</j:StatusText>
</j

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"