IE and XML problem.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ayende Rahien

    IE and XML problem.

    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(RoarAp p.CurrentApp.It emToXml(item));//Generate VALID XML

    }



    private void ShowHtml(string Html)

    {

    IPersistStreamI nit Persist;

    Persist = RoarBrowser.Doc ument as IPersistStreamI nit;

    Persist.InitNew ();

    Persist.Load(In terop.GetStream (Html));

    }

    //This is the Interop.GetStre am method

    public static UCOMIStream GetStream(strin g Data)

    {

    IntPtr ptr = Marshal.StringT oHGlobalAuto(Da ta);

    UCOMIStream retVal=null;

    CreateStreamOnH Global(ptr,true ,ref retVal);

    return retVal;

    }


  • Oleg Tkachenko

    #2
    Re: IE and XML problem.

    Ayende Rahien wrote:
    [color=blue]
    > 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.[/color]

    Looks like it's UTF-16 encoded document, which doesn't declare itself as
    UTF-16 (by default it's UTF-8). So most likely it's encoding issue.
    How do you create XML?
    --
    Oleg Tkachenko
    XML Insider


    Comment

    Working...