none
Noob questions. Getting started with OpenXML SDK. RRS feed

  • Question

  • I have many questions about OpenXML. For instance what is the meaning of <w:r> exactly. Also where can I find more information about

    <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">? When I put the URL into FireFox nothing comes up.

    Thanks.

     

    Monday, November 29, 2010 1:00 AM

Answers

  • I wish I could answer properly! The web is full of information about xml (and OpenXML) and yet I often feel like I don't understand anything at all. You just have to keep reading, and practising!
     
    <w:r> means whatever "r" is defined as in the "w" namespace. Here "r" means a 'run' - loosely, a consecutive fragment of a document. The "w" is an alias for a namespace, defined at the start of the xml (see below).
     
    xmlns="http://etc... or xmlns:w="http://etc... define 'namespaces' used in the document (in this case, a default, and one with an alias of "w"). Again loosely, a namespace is a collection of allowable tags, the names of which must be unique within the namespace. The actual namespace names (http://whatever) are somewhat arbitrary, but they must be valid, non-empty, URIs (see http://www.rfc-editor.org/rfc/rfc3986.txt). IMHO they shouldn't really be named http at all, and they rarely, if ever, resolve, and they have no meaning outside the XML in which  they appear.
     
    The [Content Types] are a reference within a package, to help any consumer of the package know what types of data are held within the individual components - think of it like the way Windows knows that a .docx file is a Word document, except at a more granular level. The types are MIME types, although not all of them are registered, and all that matters is that the package consumer understands them. I don't know the SDK, but I presume it knows all the types that the various Office applications use.
     
    Possibly not much help, but it helps me to try to write this kind of stuff down!!
     

    Enjoy,
    Tony
    www.WordArticles.com
    • Marked as answer by S.e.p.y Monday, November 29, 2010 7:14 PM
    Monday, November 29, 2010 10:47 AM

All replies

  • I wish I could answer properly! The web is full of information about xml (and OpenXML) and yet I often feel like I don't understand anything at all. You just have to keep reading, and practising!
     
    <w:r> means whatever "r" is defined as in the "w" namespace. Here "r" means a 'run' - loosely, a consecutive fragment of a document. The "w" is an alias for a namespace, defined at the start of the xml (see below).
     
    xmlns="http://etc... or xmlns:w="http://etc... define 'namespaces' used in the document (in this case, a default, and one with an alias of "w"). Again loosely, a namespace is a collection of allowable tags, the names of which must be unique within the namespace. The actual namespace names (http://whatever) are somewhat arbitrary, but they must be valid, non-empty, URIs (see http://www.rfc-editor.org/rfc/rfc3986.txt). IMHO they shouldn't really be named http at all, and they rarely, if ever, resolve, and they have no meaning outside the XML in which  they appear.
     
    The [Content Types] are a reference within a package, to help any consumer of the package know what types of data are held within the individual components - think of it like the way Windows knows that a .docx file is a Word document, except at a more granular level. The types are MIME types, although not all of them are registered, and all that matters is that the package consumer understands them. I don't know the SDK, but I presume it knows all the types that the various Office applications use.
     
    Possibly not much help, but it helps me to try to write this kind of stuff down!!
     

    Enjoy,
    Tony
    www.WordArticles.com
    • Marked as answer by S.e.p.y Monday, November 29, 2010 7:14 PM
    Monday, November 29, 2010 10:47 AM
  • Thanks so much. OK r stands for a run and w is the Namespace. I will keep on in my quest. You have been most helpfull.
    Monday, November 29, 2010 7:14 PM
  • You can use "Open XML SDK 2.0 Productivity Tool" which is available with Open XML SDK 2.0 Download (http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c6e744e5-36e9-45f5-8d8c-331df206e0d0&DisplayLang=en). This tool contain documentation for OpenXML elements. You can also view the code to generate a document using Open XML SDK and corresponding XML which will be packaged.

    thanks.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, November 29, 2010 9:07 PM