public virtual void VisitAttribute(AttributeBridge tealBean, Relationship relationship, ConstrainedDatatype constraints, TimeZoneInfo dateTimeZone, TimeZoneInfo dateTimeTimeZone) { PushPropertyPathName(DeterminePropertyName(tealBean.GetPropertyName(), relationship), false); if (relationship.Structural) { string propertyPath = BuildPropertyPath(); if (tealBean.GetValue() != null) { HandleNotAllowedAndIgnored(relationship, propertyPath); } // TODO - CDA - TM - may need to handle constraints for structural attributes new VisitorStructuralAttributeRenderer(relationship, tealBean.GetValue()).Render(CurrentBuffer().GetStructuralBuilder(), propertyPath, this.result); AddNewErrorsToList(CurrentBuffer().GetWarnings()); } else { bool hasProperty = !StringUtils.IsEmpty(tealBean.GetPropertyName()); if (hasProperty) { RenderNonStructuralAttribute(tealBean, relationship, constraints, dateTimeZone, dateTimeTimeZone); } else { if (ConformanceLevelUtil.IsMandatoryOrPopulated(relationship)) { IDictionary <string, string> attributes = null; if (ConformanceLevelUtil.IsPopulated(relationship)) { attributes = new Dictionary <string, string>(); attributes["nullFlavor"] = "NI"; } string placeholderXml = XmlRenderingUtils.CreateStartElement(relationship.Name, attributes, GetIndent(), true, true); CurrentBuffer().GetChildBuilder().Append(placeholderXml); } } } this.propertyPathNames.Pop(); }
protected virtual string CreateElement(string name, IDictionary <string, string> attributes, int indentLevel, bool close, bool lineBreak) { return(XmlRenderingUtils.CreateStartElement(name, attributes, indentLevel, close, lineBreak)); }