toXml method

  1. @override
void toXml(
  1. XmlBuilder context,
  2. NamespaceManager nsmgr
)
override

Implementation

@override
void toXml(XmlBuilder context, NamespaceManager nsmgr) {
  const davns = kDavNamespaceUrlStr;
  context.element(
    WebDavElementNames.lockinfo,
    namespace: davns,
    namespaces: Map.fromEntries(nsmgr.all),
    nest: () {
      if (!nsmgr.contain(davns)) {
        context.namespace(davns, nsmgr.generate(davns));
      }
      context.element(WebDavElementNames.lockscope,
          namespace: davns,
          nest: () => context.element(lockScope.name, namespace: davns));
      context.element(WebDavElementNames.locktype,
          namespace: davns,
          nest: () => context.element("write", namespace: davns));
      final owner = this.owner;
      if (owner != null) {
        context.element(WebDavElementNames.owner,
            namespace: davns, nest: () => owner.toXml(context, nsmgr));
      }
    },
  );
}