public List <XmlNode> FindNodes(string name, FNodeFinderCondition condition = null) { unsafe { List <XmlNode> nodeList = new List <XmlNode>(); if (mCoreObject.Pointer == IntPtr.Zero) { return(nodeList); } XmlNode.NativePointer node = XmlSDK.RapidXmlNodeA_first_node(mCoreObject, name); while (mCoreObject.Pointer != IntPtr.Zero && node.Pointer != IntPtr.Zero) { int pNeedFreeStr = 0; var strPtr = XmlSDK.RapidXmlNodeA_name(node, ref pNeedFreeStr); var nodeName = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(strPtr); if (pNeedFreeStr == 1) { XmlSDK.RapidXmlNodeA_FreeString(strPtr); } if (name == nodeName) { XmlNode nd = new XmlNode(node); nd.mHolder = mHolder; bool bCancel = false; if (condition != null) { if (condition(nd, ref bCancel)) { nodeList.Add(nd); } } else { nodeList.Add(nd); } if (bCancel) { break; } } node = XmlSDK.RapidXmlNodeA_next_sibling(node); } return(nodeList); } }
public extern static IntPtr RapidXmlNodeA_GetStringFromNode(XmlNode.NativePointer node);
public extern static IntPtr RapidXmlNodeA_value(XmlNode.NativePointer node, ref int pNeedFreeStr);
public extern static XmlNode.NativePointer RapidXmlNodeA_next_sibling(XmlNode.NativePointer node);
public extern static XmlAttrib.NativePointer RapidXmlNodeA_first_attribute(XmlNode.NativePointer node, string name);
public extern static XmlNode.NativePointer RapidXmlNodeA_first_node(XmlNode.NativePointer node, string name);
public extern static void RapidXmlNodeA_remove_attribute(XmlNode.NativePointer xmlNode, XmlAttrib.NativePointer childXmlAttr);
public extern static void RapidXmlNodeA_remove_node(XmlNode.NativePointer xmlNode, XmlNode.NativePointer childXmlNode);
public extern static void RapidXmlNodeA_append_attribute(XmlNode.NativePointer node, XmlAttrib.NativePointer childAttr);
public extern static void RapidXmlNodeA_append_node(XmlNode.NativePointer node, XmlNode.NativePointer childNode);
public extern static IntPtr RapidXmlA_append_node(XmlHolder.NativePointer xmlHolder, XmlNode.NativePointer node);
public XmlNode(XmlNode.NativePointer node) { mCoreObject = node; }