Skip to content

Commit 23f0375

Browse files
committed
Merged the work on METAL macro expansion into the master development channel.
2 parents 650597c + b5aa3df commit 23f0375

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1370
-336
lines changed

Parser/Metal/MetalDocument.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,44 @@ public override XmlNode ReadNode (XmlReader reader)
7777
output = MetalElement.MetalElementFactory((XmlElement) output);
7878
}
7979

80+
return output;
81+
}
82+
83+
/// <summary>
84+
/// <para>
85+
/// Overridden. Imports an <see cref="XmlNode"/> into this document instance, so that the node may be used as if
86+
/// it were a first-class part of this document.
87+
/// </para>
88+
/// </summary>
89+
/// <param name="node">
90+
/// An <see cref="XmlNode"/> to clone as a member of this document.
91+
/// </param>
92+
/// <param name="deep">
93+
/// A <see cref="System.Boolean"/> that indicates whether a deep or shallow copy is to be performed. In a
94+
/// <see cref="MetalDocument"/> this should almost always be true.
95+
/// </param>
96+
/// <returns>
97+
/// The newly-imported <see cref="XmlNode"/> instance.
98+
/// </returns>
99+
public override XmlNode ImportNode (XmlNode node, bool deep)
100+
{
101+
XmlNode output;
102+
103+
if(node is XmlElement)
104+
{
105+
if(!deep)
106+
{
107+
throw new NotSupportedException("Importing XML element nodes into a TAL document as shallow " +
108+
"copies is not supported.");
109+
}
110+
111+
output = MetalElement.MetalElementFactory((XmlElement) node, this);
112+
}
113+
else
114+
{
115+
output = base.ImportNode (node, deep);
116+
}
117+
80118
return output;
81119
}
82120

0 commit comments

Comments
 (0)