How should ampersands be encoded in xml to be parsed properly by .net?

azarulez

New Member
The following minimal test case throws an error in powershell:\[code\][reflection.assembly]::LoadWithPartialName('system.xml.linq')[system.xml.linq.xdocument]::parse('<node>&</node>')\[/code\]and frankly, in any .net library. This is a real problem when storing urls - for examaple if the content of \[code\]<node>\[/code\] was \[code\]http://test.com/?one=a&two=b\[/code\].How should it be properly encoded?
 
Back
Top