Beispiel #1
0
        private void ProcessRawDocument(CPS_Connection connection, XmlElement xmld, bool saveDocs)
        {
            if (xmld.Name == connection.getDocumentRootXpath())
            {
                string id = "";

                if (this.p_command == "show-history")
                {
                    try
                    {
                        XmlElement xmlid = xmld["revision_id", "www.clusterpoint.com"];
                        id = xmlid.InnerXml;
                    }
                    catch (Exception)
                    {
                    }
                }
                else
                {
                    List<string> idPath = connection.getDocumentIdXpath();
                    XmlElement xmlid = xmld;
                    int i = 0;
                    for (i = 1; i < idPath.Count; i++)
                    {
                        if (xmlid[idPath[i]] != null)
                            xmlid = xmlid[idPath[i]];
                        else
                            break;

                        if (i + 1 == idPath.Count)
                            id = xmlid.InnerXml;
                    }
                }

                if (id.Length > 0)
                {
                    if (saveDocs)
                        this.p_documents[id] = xmld;
                    else
                        this.p_documents[id] = null;
                }
            }
        }