-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
ADAPT https://github.com/ADAPT/ISOv4Plugin
I need to add a custom attribute to the output xml nodes.
I cannot find any extensions/functions to add custom attribute to: ISOCustomer ISOFarm ISOPartField ISOGUidanceGroup
The way that works for me is to extend one of the base classes
public class ISOGuidanceGroupVG : ISOGuidanceGroup
{
public string GuidanceGroupType { get; set; }
public override XmlWriter WriteXML(XmlWriter xmlBuilder)
{
xmlBuilder.WriteStartElement("GGP");
xmlBuilder.WriteXmlAttribute("A", GuidanceGroupId);
xmlBuilder.WriteXmlAttribute("B", GuidanceGroupDesignator);
xmlBuilder.WriteXmlAttribute("CUSTOM_ATTRIBUTE", "value"); //adding custom attribute
![Uploading ZKiY0.png…]()
if (XmlComments != null)
{
XmlComments.ForEach(delegate (string s)
{
xmlBuilder.WriteComment(s);
});
}
foreach (ISOGuidancePattern guidancePattern in GuidancePatterns)
{
guidancePattern.WriteXML(xmlBuilder);
}
foreach (ISOPolygon boundaryPolygon in BoundaryPolygons)
{
boundaryPolygon.WriteXML(xmlBuilder);
}
xmlBuilder.WriteEndElement();
return xmlBuilder;
}
}
Now the question is, how do I do it in some native way...?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels