public static void WriteSyntaxSection(this MamlWriter writer, Context context, XmlSchemaObject obj) { if (!context.Configuration.DocumentSyntax) { return; } string sourceCodeAbridged = context.SourceCodeManager.GetSourceCodeAbridged(obj); StringBuilder builder = new StringBuilder(sourceCodeAbridged); builder.Replace("xmlns=\"http://www.w3.org/2001/XMLSchema\"", String.Empty); builder.Replace("xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"", String.Empty); builder.Replace("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"", String.Empty); writer.StartSection("Syntax", "syntax"); writer.WriteCode(builder.ToString(), "xml"); writer.StartParagraph(); if (context.MoveToTopLink) { // Create a link to the introduction, it is the top... writer.WriteLink("#introduction", "Top"); } writer.EndParagraph(); writer.EndSection(); }
public static void WriteSyntaxSection(this MamlWriter writer, Context context, XmlSchemaObject obj) { if (!context.Configuration.DocumentSyntax) { return; } var sourceCodeAbridged = context.SourceCodeManager.GetSourceCodeAbridged(obj); writer.StartSection("Syntax", "syntax"); writer.WriteCode(sourceCodeAbridged, "xml"); writer.EndSection(); }