icarus-consulting / Yaapii.Xambly

A port of Xembly library by Yegor Bugayenko. Lighweight XML parser, generator and manipulator.
MIT License
7 stars 0 forks source link

CopyOfDirective doesn't support namespaces #192

Open aveXcaesar opened 6 months ago

aveXcaesar commented 6 months ago

Expected Behavior

The CopyOfDirective works with nodes that contains namespace definitions.

Actual Behavior

Example:

      var xml =
                XDocument.Parse(
                    "<root xmlns=\"MyDefaultNamespaceUri\">" +
                        "<parent>content</parent>" +
                    "</root>"
                );
      new Xambler(
                ...
                    new CopyOfDirective(xml.FirstNode)
                ...
            ).Apply(xml);

Failes with Yaapii.Xambly.Error.ImpossibleModificationException : Exception at dir 1: XPATH /def:root (Invalid XPath expr '/def:root' (Namespacepräfix 'def' wurde nicht definiert.))

Steps to reproduce the behavior

The log given by the failure.

Mention any other details that might be useful