1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
4  *
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  *
7  * This file is hereby licensed under the terms of the GNU GPL v2.0,
8  * pursuant to article 5.3.4 of the CeCILL v.2.1.
9  * This file was originally licensed under the terms of the CeCILL v2.1,
10  * and continues to be available under such terms.
11  * For more information, see the COPYING file which you should have received
12  * along with this program.
13  *
14  */
15 
16 #ifndef __XMLNODESET_HXX__
17 #define __XMLNODESET_HXX__
18 
19 #include "XMLList.hxx"
20 #include "xml.h"
21 
22 namespace org_modules_xml
23 {
24 class XMLDocument;
25 class XMLElement;
26 
27 /**
28  * @file
29  * @author Calixte DENIZET <calixte.denizet@scilab.org>
30  *
31  * Class to wrap the list of the elements returned by a XPath query
32  */
33 class XMLNodeSet: public XMLList
34 {
35 
36     const XMLDocument & doc;
37     xmlNodeSet *nodeSet;
38     xmlXPathObject *xpath;
39 
40 public:
41     /**
42      * Default constructor
43      * @param doc the document where the node set is existing
44      * @param nodeSet a xmlNodeSet
45      */
46     XMLNodeSet(const XMLDocument & doc, xmlXPathObject * _xpath);
47 
48     ~XMLNodeSet();
49 
50     void *getRealXMLPointer() const;
51 
52     const char **getContentFromList() const;
53 
54     const char **getNameFromList() const;
55 
56     void remove() const;
57     void setAttributeValue(const char **prefix, const char **name, const char **value, int lsize) const;
58     void setAttributeValue(const char **name, const char **value, int lsize) const;
59     const XMLObject *getXMLObjectParent() const;
60     const XMLObject *getListElement(int index);
61 };
62 }
63 
64 #endif
65