GoDigram for .NET Framework and .NET Core
Northwoods.Go.Xml Namespace / GoXmlTransformer Class / GenerateAttributes Method
the object being generated
In This Topic
    GenerateAttributes Method (GoXmlTransformer)
    In This Topic
    Generate attributes for the current element, helping to render an object.
    Syntax
    public virtual void GenerateAttributes( 
       object obj
    )

    Parameters

    obj
    the object being generated
    Remarks

    You will typically override this method to call methods such as WriteAttrVal(String,String) or WriteAttrVal(String,Single) to read property values and set them on the object obj being initialized. The set of attributes usually matches those consumed in an override of ConsumeAttributes.

    This is called by GoXmlWriter.GenerateObject. If IdAttributeUsedForSharedObjects is true, this method also sees if GoXmlWriter.GoXmlWriter.FindShared has an identifier associated with the given obj. If so, this writes out an "id" attribute with that identifier string. This method then calls GenerateAttributes on the InheritsFromTransformer, to allow another specific transformer to implement this behavior, or else calls GoXmlWriter.GoXmlWriter.InvokeGenerateAttributes, to allow this TransformerType's base Type to provide a default behavior.

    You should not try to define any "xmlns" namespaces. Instead, you can define the default namespace for the root element by setting GoXmlWriter.DefaultNamespace, and you can define namespaces and their prefixes by calling GoXmlWriter.SetNamespaceUri before XML generation.

    See Also