A
Ayende Rahien
I'm having trouble convincing IE to display my XML when I'm using it in my
application.
I'm creating XML using XmlTextWriter, and then Load() it to IE. The problem
is that in the way, a space is inserted after every character (Like this < ?
x m l v e r s i o n = " 1 . 0 " ? >) Which isn't valid XML, of course.
Here is my code:
private void ShowHtml(Item item)
{
ShowHtml(RoarApp.CurrentApp.ItemToXml(item));//Generate VALID XML
}
private void ShowHtml(string Html)
{
IPersistStreamInit Persist;
Persist = RoarBrowser.Document as IPersistStreamInit;
Persist.InitNew();
Persist.Load(Interop.GetStream(Html));
}
//This is the Interop.GetStream method
public static UCOMIStream GetStream(string Data)
{
IntPtr ptr = Marshal.StringToHGlobalAuto(Data);
UCOMIStream retVal=null;
CreateStreamOnHGlobal(ptr,true,ref retVal);
return retVal;
}
application.
I'm creating XML using XmlTextWriter, and then Load() it to IE. The problem
is that in the way, a space is inserted after every character (Like this < ?
x m l v e r s i o n = " 1 . 0 " ? >) Which isn't valid XML, of course.
Here is my code:
private void ShowHtml(Item item)
{
ShowHtml(RoarApp.CurrentApp.ItemToXml(item));//Generate VALID XML
}
private void ShowHtml(string Html)
{
IPersistStreamInit Persist;
Persist = RoarBrowser.Document as IPersistStreamInit;
Persist.InitNew();
Persist.Load(Interop.GetStream(Html));
}
//This is the Interop.GetStream method
public static UCOMIStream GetStream(string Data)
{
IntPtr ptr = Marshal.StringToHGlobalAuto(Data);
UCOMIStream retVal=null;
CreateStreamOnHGlobal(ptr,true,ref retVal);
return retVal;
}