XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

Error Writing SpriteFont XML Files

Last post 5/9/2007 11:43 PM by Nick Gravelyn. 4 replies.
  • 5/9/2007 4:54 PM

    Error Writing SpriteFont XML Files

    I'm making a real basic editor for spritefont files that will just read and write the XML representations so that it's a little easier to choose fonts and see what they look like before compiling. Everything's going smoothly, except when trying to write this line:

        <XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">

    I tried using this code:
       
         writer.WriteStartElement("XnaContent");
         writer.WriteAttributeString("xmlns:Graphics", "Microsoft.Xna.Framework.Content.Pipeline.Graphics");

    but I got an exception about the : in the name:

        Invalid name character in 'xmlns:Graphics'. The ':' character, hexadecimal value 0x3A, cannot be included in a name.

    Any ideas how to write out that line some other way perhaps?
  • 5/9/2007 4:59 PM In reply to

    Re: Error Writing SpriteFont XML Files

    Here's an msdn example:

    writer.WriteAttributeString("ISBN", "urn:book", "1-800-925")

  • 5/9/2007 5:09 PM In reply to

    Re: Error Writing SpriteFont XML Files

    Thanks. I found it:

                    writer.WriteAttributeString(
                        "xmlns", "Graphics", null, "Microsoft.Xna.Framework.Content.Pipeline.Graphics");
  • 5/9/2007 6:12 PM In reply to

    Re: Error Writing SpriteFont XML Files

    Now I'm having trouble the the region area, specifically writing out the ampersand. It's trying to convert it from &#32; to &amp;#32; which is obviously not what I want. I thought using the @ was the way to have it not convert, but that doesn't work. What is the method for having it not automatically change that ampersand?
  • 5/9/2007 11:43 PM In reply to

    Re: Error Writing SpriteFont XML Files

    For anyone waiting for the solution too, I found that simply putting in the characters in place of the code works as well so I simply put a space for the first one and ~ for the second and it works just like normal.
Page 1 of 1 (5 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG