NFe.Components.XMLIniFile.GetPathNode C# (CSharp) Method

GetPathNode() public method

public GetPathNode ( string NodePath, bool CanCreate ) : XmlNode
NodePath string
CanCreate bool
return System.Xml.XmlNode
		public XmlNode GetPathNode(string NodePath, bool CanCreate)
		{
			XmlNode lnode;
			XmlNode Result = null;
			ArrayList s1 = new ArrayList();

			try
			{
                CheckInitialized();
                Result = xmldoc.DocumentElement;

				s1 = ParseString( Translate(NodePath) );
				for (int i = 0; i < s1.Count; ++i)
				{
					lnode = Result;
					Result = _FindNode(lnode, Translate(s1[i].ToString()));
					if (Result == null)// || this.ReplaceValue)
						if (CanCreate)
						{
							XmlNode xmlProp = xmldoc.CreateElement("", Translate(s1[i].ToString()), "");
							Result = lnode.AppendChild(xmlProp);
						}
						else 
						{
							Result = null;
							break;
						}
				}
			}
			catch
			{
                Result = null;
			}
			return Result;
		}