This is an example of how Dom Parser works. It will parse the xml file (person.xml) to the Person object. A DTD validation will be run on this example.
public:
private:
};
class Address {
public:
Address() { }
private:
};
public:
delete address;
}
out <<
"ID: " <<
p.id << endl;
out <<
"First name: " <<
p.firstName << endl;
out <<
"Last name: " <<
p.lastName << endl;
out <<
"Sex: " <<
p.gender << endl;
out <<
"Date of birth: " <<
p.dateOfBirth->GetDay() <<
"/"
<<
p.dateOfBirth->GetMonth() <<
"/"
<<
p.dateOfBirth->GetYear() << endl;
out <<
"Address: " <<
p.address->GetStreet() << endl;
out <<
"\t" <<
p.address->GetPostalCode() << endl;
out <<
"\t" <<
p.address->GetCountry() << endl;
}
private:
Address *address;
};
public:
}
return -1;
}
return 0;
}
id = atoi(
attr->GetValue());
break;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return new Address(s,
p,
c);
}
Address *address;
}
}
}
}
}
}
}
private:
};
{
gROOT->ProcessLine(
".O 0");
if (
personlist.ParseFile(dir+
"/xml/person.xml") == 0)
}
TBuffer & operator<<(TBuffer &buf, const Tmpl *obj)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Mother of all ROOT objects.
TXMLAttribute is the attribute of an Element.
TXMLNode contains a pointer to xmlNode, which is a node under the DOM tree.
TList * GetAttributes()
Returns a list of node's attribute if any, returns 0 if no attribute.
const char * GetText() const
Returns the content of a Text node if node is a TextNode, 0 otherwise.
TXMLNode * GetNextNode()
Returns the next sibling XMLNode in the DOM tree, if any return 0 if no next node.
TXMLNode * GetChildren()
Returns the node's child if any, returns 0 if no child.
const char * GetNodeName() const
Returns the node's name.
Bool_t HasAttributes() const
Returns true if Element node has attribute.
EXMLElementType GetNodeType() const
Returns the node's type.
ULong64_t GetAddress(std::vector< std::string > &p)