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 611645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:48:24+00:00 2026-05-13T17:48:24+00:00

I am starting to write an application that will output an OpenOffice document. The

  • 0

I am starting to write an application that will output an OpenOffice document. The content.xml file in an empty ODT document begins:

<?xml version="1.0" encoding="UTF-8"?>
<office:document-content
    xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
    xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
    xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
    xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
    xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
    xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
    xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
    xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
    xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
    xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
    xmlns:math="http://www.w3.org/1998/Math/MathML"
    xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
    xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
    xmlns:ooo="http://openoffice.org/2004/office"
    xmlns:ooow="http://openoffice.org/2004/writer"
    xmlns:oooc="http://openoffice.org/2004/calc"
    xmlns:dom="http://www.w3.org/2001/xml-events"
    xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:rpt="http://openoffice.org/2005/report"
    xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
    xmlns:rdfa="http://docs.oasis-open.org/opendocument/meta/rdfa#"
    xmlns:
        field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
    office:version="1.2">

I haven’t seen colons in XML before. I understand that they signify namespaces. How do I go about recreating this in .NET?

  • 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-05-13T17:48:24+00:00Added an answer on May 13, 2026 at 5:48 pm

    The following code will load up all of the proper namespaces into a namespace manager and create a sample document. .NET will only output the namespaces that are actually used in the document though, not all of them. I’m not sure if there is a way to force output of the unused ones, but unused ones really shouldn’t be needed.

    public static void Test()
    {
        var nt = new NameTable();
        var ns = new XmlNamespaceManager(nt);
        var doc = new XmlDocument(nt);
    
        ns.AddNamespace("office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0");
        ns.AddNamespace("style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0");
        ns.AddNamespace("text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0");
        ns.AddNamespace("table", "urn:oasis:names:tc:opendocument:xmlns:table:1.0");
        ns.AddNamespace("draw", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0");
        ns.AddNamespace("fo", "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0");
        ns.AddNamespace("xlink", "http://www.w3.org/1999/xlink");
        ns.AddNamespace("dc", "http://purl.org/dc/elements/1.1/");
        ns.AddNamespace("meta", "urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
        ns.AddNamespace("number", "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0");
        ns.AddNamespace("svg", "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
        ns.AddNamespace("chart", "urn:oasis:names:tc:opendocument:xmlns:chart:1.0");
        ns.AddNamespace("dr3d", "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0");
        ns.AddNamespace("math", "http://www.w3.org/1998/Math/MathML");
        ns.AddNamespace("form", "urn:oasis:names:tc:opendocument:xmlns:form:1.0");
        ns.AddNamespace("script", "urn:oasis:names:tc:opendocument:xmlns:script:1.0");
        ns.AddNamespace("ooo", "http://openoffice.org/2004/office");
        ns.AddNamespace("ooow", "http://openoffice.org/2004/writer");
        ns.AddNamespace("oooc", "http://openoffice.org/2004/calc");
        ns.AddNamespace("dom", "http://www.w3.org/2001/xml-events");
        ns.AddNamespace("xforms", "http://www.w3.org/2002/xforms");
        ns.AddNamespace("xsd", "http://www.w3.org/2001/XMLSchema");
        ns.AddNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        ns.AddNamespace("rpt", "http://openoffice.org/2005/report");
        ns.AddNamespace("of", "urn:oasis:names:tc:opendocument:xmlns:of:1.2");
        ns.AddNamespace("rdfa", "http://docs.oasis-open.org/opendocument/meta/rdfa#");
        ns.AddNamespace("field", "urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0");
    
        var root = doc.CreateElement("office", "document-content");
        var attr = doc.CreateAttribute("office", "version", ns.LookupNamespace("office"));
        attr.Value = "1.2";
        root.Attributes.Append(attr);
        doc.AppendChild(root);
    
        using (var xw = new XmlTextWriter(Console.Out))
        {
            xw.Formatting = Formatting.Indented;
            xw.Indentation = 2;
            xw.IndentChar = ' ';
    
            doc.WriteTo(xw);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I´m thinking about to write an application will have to store a small amount
Need to launch two application on system startup. A desktop file is created starting
I have been starting to write some reasonably large and or confusing MySQL queries
I'm just starting out writing trying to write a simple program in C and
I am looking for recommendations for a starting website to learn how to write
Question: Where is a good starting point for learning to write server applications? Info:
Starting with 2005, VS started this behavior of when starting debugging session it spawns
Starting from ASP.NET MVC Preview 3, HTML.Button ( and other related HTML controls) are
Starting a new project and would like to use one of the MVC framworks.
Starting with the error: Error 81 The OutputPath property is not set for this

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.