This project has moved. For the latest updates, please go here.

Diagram

Topics: Questions
May 10, 2013 at 1:11 PM
Is there any way to generate diagrams for the XML schema (like WMHelp XMLPad does for it's XML documentation generator)?
Coordinator
May 11, 2013 at 5:50 PM
XM Schema Documenter doesn't have built-in support for that. However, since you can use the full MAML markup in XML schema topics, you can integrate pre-generated pictures.
May 12, 2013 at 3:36 PM
I realize that it doesn't currently have built-in support for that. I'm suggesting that it would be a GREAT feature to add.


Aug 7, 2013 at 2:04 PM
I've been struggling to add an image to HTML output... Here is the .xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.benengr.com/benmsg" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sd="http://schemas.xsddoc.codeplex.com/schemaDoc/2009/3" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org./1999/xlink" targetNamespace="http://www.benengr.com/benmsg" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="ElementWithPicture">
        <xs:annotation>
            <xs:documentation>Comment describing 
                <mediaLinkInline>
                    <image xlink:href="44dbb4b3-5b07-4741-9ba4-08bec8515856"/>
                </mediaLinkInline>your root element
            </xs:documentation>
        </xs:annotation>
    </xs:element>
</xs:schema>
And the MediaContent.xml from the working directory of the output of the Sandcastle Help File Builder:
<?xml version="1.0" encoding="utf-8"?>
<stockSharedContentDefinitions>
  <item id="44dbb4b3-5b07-4741-9ba4-08bec8515856">
    <image file="echo_cmd.png">
      <altText>echo cmd</altText>
    </image>
  </item>
  <item id="06faa053-6739-411a-98be-aa6139cd452e">
    <image file="XsdAllIcon.png">
      <altText>All</altText>
    </image>
  </item>
  <item id="d6eb221a-85e6-49f8-b652-676f28f964d9">
    <image file="XsdAnyAttributeIcon.png">
      <altText>Any Attribute</altText>
    </image>
  </item>
  <item id="65681e84-c7ff-4507-915b-caabdeaf6db9">
    <image file="XsdAnyElementIcon.png">
      <altText>Any Element</altText>
    </image>
  </item>
  <item id="d73fb973-e3c0-4eeb-904a-c083066fde0e">
    <image file="XsdAttributeIcon.png">
      <altText>Attribute</altText>
    </image>
  </item>
  <item id="ab0c13cc-f452-46b5-8207-f0d6f05c4532">
    <image file="XsdAttributeGroupIcon.png">
      <altText>Attribute Group</altText>
    </image>
  </item>
  <item id="563e71d0-f2c9-407d-a4bc-6f06dab63121">
    <image file="XsdAttributeRefIcon.png">
      <altText>Attribute Reference</altText>
    </image>
  </item>
  <item id="8a940784-9c48-4ded-93ec-b57ff9881a65">
    <image file="XsdChoiceIcon.png">
      <altText>Choice</altText>
    </image>
  </item>
  <item id="9193b822-8db2-488e-88de-919e0f845655">
    <image file="XsdComplexTypeIcon.png">
      <altText>Complex Type</altText>
    </image>
  </item>
  <item id="f32fbe7a-d21d-4d6c-925d-3578da0ad709">
    <image file="XsdElementIcon.png">
      <altText>Element</altText>
    </image>
  </item>
  <item id="de7773ee-1d2c-4ad4-bd99-155467e03315">
    <image file="XsdElementRefIcon.png">
      <altText>Element Reference</altText>
    </image>
  </item>
  <item id="82b464ce-1a12-4980-91b3-f1687d59839d">
    <image file="XsdExtensionIcon.png">
      <altText>Extension</altText>
    </image>
  </item>
  <item id="9d0fc6b1-d6e8-45fa-adad-fe3d5a481210">
    <image file="XsdFacetIcon.png">
      <altText>Facet</altText>
    </image>
  </item>
  <item id="0d8c7186-3b0c-41be-89dd-4e77cbd7f127">
    <image file="XsdGroupIcon.png">
      <altText>Group</altText>
    </image>
  </item>
  <item id="5a1b2b9a-e86d-4a2b-8fec-290d25a5dbc9">
    <image file="XsdKeyIcon.png">
      <altText>Key Constraint</altText>
    </image>
  </item>
  <item id="035d29e6-1bc2-4fd3-a328-2a611d80fc24">
    <image file="XsdKeyRefIcon.png">
      <altText>Keyref Constraint</altText>
    </image>
  </item>
  <item id="0c24674e-a394-4f7e-a4b3-55ee63bd6dde">
    <image file="XsdListIcon.png">
      <altText>List</altText>
    </image>
  </item>
  <item id="2d7c0638-b9b1-4fc5-b296-853465d7d487">
    <image file="XsdNamespaceIcon.png">
      <altText>Namespace</altText>
    </image>
  </item>
  <item id="78dbb981-8116-4d75-b8cd-eef4d20fe5ce">
    <image file="XsdRestrictionIcon.png">
      <altText>Restriction</altText>
    </image>
  </item>
  <item id="45956914-1d6e-4e93-99a7-cc26f63d43a8">
    <image file="XsdSchemaIcon.png">
      <altText>Schema</altText>
    </image>
  </item>
  <item id="64f503f1-7b43-400c-b524-242215e6343f">
    <image file="XsdSequenceIcon.png">
      <altText>Sequence</altText>
    </image>
  </item>
  <item id="9a1e7872-98a2-4751-aa25-0ae2c64d481d">
    <image file="XsdSimpleTypeIcon.png">
      <altText>Simple Type</altText>
    </image>
  </item>
  <item id="58dd1301-95dc-4170-8c0d-baaefb7e47b3">
    <image file="XsdUnionIcon.png">
      <altText>Union</altText>
    </image>
  </item>
  <item id="b2e63cca-7fd7-46bc-bb59-da0a9dd3a4c9">
    <image file="XsdUniqueIcon.png">
      <altText>Unique Constraint</altText>
    </image>
  </item>
</stockSharedContentDefinitions>
It's the echo_cmd.png that I am trying to reference, but I have not been able to get it to output to the help file or to the HTML output. Any ideas on what I'm doing wrong would be appreciated.

Thanks!
Coordinator
Aug 31, 2013 at 7:53 PM
Edited Aug 31, 2013 at 7:53 PM
Looks to me like you missed including the namespace, i.e. you need to prefix image and mediaLinkInline with ddue:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.benengr.com/benmsg" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sd="http://schemas.xsddoc.codeplex.com/schemaDoc/2009/3" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org./1999/xlink" targetNamespace="http://www.benengr.com/benmsg" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="ElementWithPicture">
    <xs:annotation>
      <xs:documentation>Comment describing 
        <ddue:mediaLinkInline>
          <ddue:image xlink:href="44dbb4b3-5b07-4741-9ba4-08bec8515856"/>
        </ddue:mediaLinkInline>your root element
      </xs:documentation>
    </xs:annotation>
  </xs:element>
</xs:schema>
Sep 9, 2013 at 6:57 PM
Thanks for the reply. I did indeed forget including the namespace. However, it appears that this still does not work. Here is the .xsd I am using:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema 
    xmlns="http://www.benengr.com/benmsg" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns:sd="http://schemas.xsddoc.codeplex.com/schemaDoc/2009/3" 
    xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" 
    xmlns:xlink="http://www.w3.org./1999/xlink" 
    targetNamespace="http://www.benengr.com/benmsg" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="ElementWithPicture">
    <xs:annotation>
        <xs:appinfo>
            <sd:schemaDoc>
                <ddue:summary>
                    <ddue:para>
                        This is a comment describing
                        <ddue:mediaLinkInline>
                            <ddue:image xlink:href="44dbb4b3-5b07-4741-9ba4-08bec8515856"/>
                        </ddue:mediaLinkInline>
                        the root element.
                    </ddue:para>
                </ddue:summary>
            </sd:schemaDoc>
        </xs:appinfo>
    </xs:annotation>
  </xs:element>
</xs:schema>
And the output for the "ElementWithPicture" topic:
<?xml version="1.0" encoding="utf-8"?>
<topic id="1148f0ef-044f-1593-c289-b706c9b5894c" revisionNumber="1">
    <developerConceptualDocument xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
        <introduction>
            <ddue:para xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5">
                        This is a comment describing
                        <ddue:mediaLinkInline><ddue:image xlink:href="44dbb4b3-5b07-4741-9ba4-08bec8515856" xmlns:xlink="http://www.w3.org./1999/xlink" /></ddue:mediaLinkInline>
                        the root element.
                    </ddue:para>
            <para>
                <markup><b>Namespace:</b> <a href="ecfce7ea-47f1-1936-43c0-168f7a6fe3d1.htm">http://www.benengr.com/benmsg</a><br/><b>Schema:</b> <a href="ba06c4d2-fc67-48af-5e3b-9a2f39bbc4b8.htm">TestSchema.xsd</a><br/></markup>
            </para>
        </introduction>
        <section address="type">
            <title>Type</title>
            <content />
        </section>
        <section address="contentType">
            <title>Content Type</title>
            <content>Any</content>
        </section>
        <section address="parents">
            <title>Parents</title>
            <content />
        </section>
        <section address="children">
            <title>Children</title>
            <content />
        </section>
        <section address="attributes">
            <title>Attributes</title>
            <content />
        </section>
        <section address="constraints">
            <title>Constraints</title>
            <content />
        </section>
        <section address="syntax">
            <title>Syntax</title>
            <content>
                <code language="xml" xml:space="preserve">&lt;xs:element name="ElementWithPicture" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;&lt;/xs:element&gt;</code>
            </content>
        </section>
        <relatedTopics>
            <link xlink:href="ecfce7ea-47f1-1936-43c0-168f7a6fe3d1" topicType_id="3272D745-2FFC-48C4-9E9D-CF2B2B784D5F">http://www.benengr.com/benmsg</link>
        </relatedTopics>
    </developerConceptualDocument>
</topic>
I've discovered, that this issue lies with namespaces, but I'm not sure how to resolve. If I modify the introduction section to:
        <introduction>
            <ddue:para >
                This is a comment describing
                <mediaLinkInline>
                    <image xlink:href="44dbb4b3-5b07-4741-9ba4-08bec8515856" />
                </mediaLinkInline>
                the root element.
            </para>
            <para>
                <markup><b>Namespace:</b> <a href="ecfce7ea-47f1-1936-43c0-168f7a6fe3d1.htm">http://www.benengr.com/benmsg</a><br/><b>Schema:</b> <a href="ba06c4d2-fc67-48af-5e3b-9a2f39bbc4b8.htm">TestSchema.xsd</a><br/></markup>
            </para>
        </introduction>
The image does show up. Debugging the source, I have found that this XML is produced from the line:
var schemaDocElement = doc.SelectSingleNode("xsd:schemaDoc", namespaceManager);
(line 119 of DocumentationManager.cs). Unfortunately, I do not know much about the XmlDocument or XmlNode classes.
Sep 10, 2013 at 6:51 PM
I found my issue!

I had the following declared in the schema:
xmlns:xlink="http://www.w3.org./1999/xlink" 
Removing the period after the org resolves the issue:
xmlns:xlink="http://www.w3.org/1999/xlink" 
Thanks for looking into this!
Coordinator
Sep 11, 2013 at 4:24 AM
Edited Sep 11, 2013 at 4:26 AM
Thanks for confirming that it works for you!
Marked as answer by terrajobst on 2/15/2014 at 6:13 PM