Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8010925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:52:53+00:00 2026-06-04T18:52:53+00:00

I am creating a XML document in c#. Its all coming together now but

  • 0

I am creating a XML document in c#.

Its all coming together now but for some reason i keep getting tis error.

Here is my code:

  FileStream Slide2XmlStream = new FileStream(slide2Xml, FileMode.Create, FileAccess.Write);
        XmlWriter slide2XmlWriter = null;

        try
        {
            XmlWriterSettings contentTypesSettings = new XmlWriterSettings();
            contentTypesSettings.Indent = true;
            slide2XmlWriter = XmlWriter.Create(Slide2XmlStream, contentTypesSettings);

            slide2XmlWriter.WriteStartDocument(true);
            slide2XmlWriter.WriteStartElement( "p", "sld","http://schemas.openxmlformats.org/presentationml/2006/main" );
            slide2XmlWriter.WriteAttributeString("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            slide2XmlWriter.WriteAttributeString( "a","http://schemas.openxmlformats.org/drawingml/2006/main");

            slide2XmlWriter.WriteStartElement( "p", "cSld", null);

            slide2XmlWriter.WriteStartElement( "p", "spTree", null );
            slide2XmlWriter.WriteStartElement( "p", "nvGrpSpPr", null );
            slide2XmlWriter.WriteStartElement( "p", "cNvpr", null );
            slide2XmlWriter.WriteAttributeString("name", "");
            slide2XmlWriter.WriteAttributeString("id", "1");
            slide2XmlWriter.WriteEndElement();

            slide2XmlWriter.WriteStartElement( "p", "cNvGrpSpPr", null );
            slide2XmlWriter.WriteEndElement();

            slide2XmlWriter.WriteStartElement( "p", "nvPr", null );
            slide2XmlWriter.WriteEndElement();
            slide2XmlWriter.WriteEndElement();

            slide2XmlWriter.WriteStartElement( "p", "grpSpPr", null );
            slide2XmlWriter.WriteStartElement( "a", "xfrm", null );
            slide2XmlWriter.WriteStartElement( "a", "off", null );
            slide2XmlWriter.WriteAttributeString("y", "0");
            slide2XmlWriter.WriteAttributeString("x", "0");
            slide2XmlWriter.WriteEndElement();

The error keeps appearing on the “a” prefix on the start of the method.
Any help will really be appreaciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:52:54+00:00Added an answer on June 4, 2026 at 6:52 pm

    I have fixed it. I needed to allow the xmlns prefix and allow the string value to be null:

    slide2XmlWriter.WriteAttributeString("xmlns","a",null,"http://schemas.openxmlformats.org/drawingml/2006/main");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running through an XML document, selecting all the elements, and creating links based
I'm creating an XML document. I got it to indent using TransformerFactory.setAttribute(indent-number, new Integer(2));
I am creating an XML document on the fly. and I need to know
I am having trouble creating an XML document that contains a default namespace and
I have an XML document generated from an external application, but that application does
I would like a portable solution to creating a multiply nested XML document using
I have an xml document that I am creating using the loop below and
I'm creating an XML document and I want to store URLs inside the a
I'm creating an XML document from an array of NSDictionarys as follows: for (NSDictionary
we have a requirement of dynamically creating a XML document from the USer entered

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.