in
Innovasys Logo

Using XML code examples

Last post 08-22-2007 3:55 AM by Richard Sloggett (Innovasys). 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-21-2007 6:09 PM

    • GV
    • Top 50 Contributor
    • Joined on 07-26-2007
    • Posts 11

    Using XML code examples

    Editing /// via Doc X IDE.

    We ran into a problem with including XML code inside ///Summary tags. As a solutino we are moving these to Examples.

    Does the option exist to select XML as the code type in Doc X (editing /// .cs comment tags).

     I know HS3 offers XML in widgets, just wondering.

  • 08-22-2007 3:55 AM In reply to

    Re: Using XML code examples

    In the Document! X IDE when editing a Content File, you can use the Insert\Code and Insert\XML menu items to include source code or XML files directly embedded in content. You can also set the language of an example to "XML". Both those approaches will automatically colorize the example XML.

    In C# source comments this isn't quite so easy, primarily as the C# compiler objects to XML declarations directly within source comments. You can however include a link to an XML file in the same directory as your project. Here's a couple of examples of both setting the lang tag in a source code example comment, and using the example file mechanism:

    /// <example>

    /// <code lang="xml">

    ///<DataTypeMap xmlns="http://tempuri.org/db.config.xsd" Version="1.0">

    /// <DataType Name="adBigInt" Value="20" Map="BigInt" Custom=""/>

    /// <DataType Name="adBinary" Value="128" Map="Binary" Custom=""/>

    /// <DataType Name="adBoolean" Value="11" Map="Boolean" Custom=""/>

    ///</DataTypeMap>

    /// </code>

    /// </example>

    public class Class1

    {

    }

    /// <example>

    /// <code lang="xml" title="Test XML File Example" source="C:\examplefiles\example.xml">

    /// </code>

    /// </example>

    public class Class2

    { }

     

    Richard Sloggett
    Innovasys
    http://www.innovasys.com
    Filed under:
Page 1 of 1 (2 items)