xml serialization - adding name space to element that is not root

masaad

New Member
I am working in C#, I'm trying to do xml serialization I get \[code\]xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\[/code\] and \[code\]xmlns:xsd="http://www.w3.org/2001/XMLSchema"\[/code\] on the root element, I need that also on another element.The reason that I need it, is because I get the xml as a string and I need to do xml serialization only on the \[code\]<Header>\[/code\] element.\[code\]<?xml version="1.0" encoding="utf-8"?><Movie xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Header xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">.... </Header <Title>Starship Troopers</Title> <Rating>6.9</Rating> <ReleaseDate>1997-11-07T00:00:00</ReleaseDate></Movie>\[/code\]
 
Top