Log of /trunk/io/xml/src/TXMLEngine.cxx
Parent Directory
Revision
48992 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 28 15:26:26 2013 UTC (21 months, 3 weeks ago) by
rdm
File length: 49133 byte(s)
Diff to
previous 43515
From Lifeng Sun:
The attached patchset fixes a bunch of typo in the source:
0001-succes-success.patch
0002-preceed-preced.patch
0003-informations-information.patch
0004-childs-children.patch
0005-avaliable-available.patch
0006-writeable-writable.patch
0007-comand-command.patch
0008-unkown-unknown.patch
0009-wierd-weird.patch
0010-wheter-whether.patch
0011-unecessary-unnecessary.patch
0012-splitted-split.patch
0013-registerd-registered.patch
0014-recieve-receive.patch
0015-processsing-processing.patch
0016-ouput-output.patch
0017-mutiple-multiple.patch
0018-lenght-length.patch
0019-interupted-interrupted.patch
0020-independant-independent.patch
0021-inconsistant-inconsistent.patch
0022-expresion-expression.patch
0023-explicitely-explicitly.patch
0024-enviroment-environment.patch
0025-deafult-default.patch
0026-continous-continuous.patch
0027-completly-completely.patch
0028-commited-committed.patch
0029-choosen-chosen.patch
0030-backgroud-background.patch
0031-auxilliary-auxiliary.patch
0032-authentification-authentication.patch
0033-appropiate-appropriate.patch
0034-an-other-another.patch
0035-environement-environment.patch
0036-targetting-targeting.patch
0037-suppported-supported.patch
0038-paramater-parameter.patch
Revision
43515 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 27 21:15:53 2012 UTC (2 years, 9 months ago) by
pcanal
File length: 49119 byte(s)
Diff to
previous 38266
Fix coding convention R.RN7 (Avoid the raw C types 'long', 'unsigned long', 'long double', 'bool', 'long long' and 'unsigned long long'.)
Revision
38266 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Mar 1 18:46:08 2011 UTC (3 years, 10 months ago) by
rdm
File length: 49105 byte(s)
Diff to
previous 37871
Add new optional parameter maxbuf to TXMLEngine::ParseFile() allowing
the specification of the XML file size to be parsed. This fixes issue #78864.
Revision
36633 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Nov 12 16:04:12 2010 UTC (4 years, 2 months ago) by
pcanal
File length: 49358 byte(s)
Diff to
previous 36517
From Sergey:
Fix for coverity warnings.
Coverity warnings 23101 - 23112 should be fixed (hopefully) by removing
fName field from SXmlAttr_t and SXmlNode_t and replacing them by inline
static function.
Warning 23113 is not a problem. In this place result of SkipSpaces()
really doesn't matter at all.
Warning 23114 should be solved - was not an error.
Warnings 23115 - 23121 are about strcpy(). I replaced them by strncpy().
Here should be no penalties at all while exact number of copied bytes is
always specified.
Revision
36517 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Nov 5 14:43:58 2010 UTC (4 years, 2 months ago) by
pcanal
File length: 48118 byte(s)
Diff to
previous 36514
Revert r31745 which resolved coverity reports by moving struct from C to C++ but was actually very costly in memory(71% more)
Revision
32274 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Feb 8 13:16:16 2010 UTC (4 years, 11 months ago) by
brun
File length: 48749 byte(s)
Diff to
previous 32188
From Sergey Linev:
patch for XML engine, which allows to treat correctly spaces before and after '=' sign in xml attributes.
Like this one:
<constant name = "HALFPI" value = "pi/2."/>
Revision
25500 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Sep 22 20:19:46 2008 UTC (6 years, 4 months ago) by
brun
File length: 47399 byte(s)
Diff to
previous 23122
From Sergei Linev:
Fix a bug which can be observed under Windows (Linux is less strict in this sense).
At some point I was writing memory just one byte outside of allocated area.
Revision
22419 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 3 00:25:01 2008 UTC (6 years, 10 months ago) by
rdm
Original Path:
trunk/xml/src/TXMLEngine.cxx
File length: 47267 byte(s)
Diff to
previous 20882
From Andrew Savchenko:
ROOT can not be compiled with gcc-4.3.
Some ROOT source files doesn't contain required #include directives,
for example, they use strlen(), but #include <string.h> is missed or
malloc() is used and #include <stdlib.h> is missed.
Earlier versions of gcc allowed some headers to be included implicitly,
but issued a warning (-Wimplicit-function-declaration). Newer one,
gcc-4.3 denies such silly behaviour: all required headers must be explicitly
included.
Attached patch fixes this. Also it fixes another issue, which disallows
ROOT to compile under gcc-4.3: C functions don't belong to namespace std,
so expressions like std::memcpy() are no longer valid and plain memcpy()
should be used instead.
Revision
16434 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 5 10:28:49 2006 UTC (8 years, 3 months ago) by
brun
Original Path:
trunk/xml/src/TXMLEngine.cxx
File length: 47104 byte(s)
Diff to
previous 15512
From Sergey Linev:
1. TXMLEngine class (ROOT xml parser) in addition to normal xml nodes now can parse
xml processing instructions http://www.w3.org/TR/1998/REC-xml-19980210#sec-pi with syntax
<?something attr="value" attr2="value2" ... ?>
and xml comments http://www.w3.org/TR/1998/REC-xml-19980210#sec-comments with syntax
<!-- my comment string -->
2. Comment line and style sheet definition (one special case of xml processing instruction)
can be inserted manually by user with any text/xml editor or with new methods of TXMLFile
Bool_t TXMLFile::AddXmlComment(const char* comment);
Bool_t TXMLFile::AddXmlStyleSheet(const char* href, const char* type, ...);
3. Arbitrary text line can be inserted on the top of xml file with call:
Bool_t TXMLFile::AddXmlLine(const char* line);
Now this line can contain either comments or xml processing instruction, while
anything else will not pass xml syntax check.
Revision
15512 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 22 08:21:23 2006 UTC (8 years, 7 months ago) by
brun
Original Path:
trunk/xml/src/TXMLEngine.cxx
File length: 38525 byte(s)
Diff to
previous 15238
From Sergey Linev:
1. Implementation of TDirectory I/O for TSQLFile and TXMLFile
2. In TSQLFile identifier length is now controled.
Important for Oracle, where table or column name cannot be more than 32 symbols.
3. Adding usage of TSQLStatement class where possible.
4. Small performance improvment.
Revision
13871 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 20 01:12:13 2006 UTC (9 years ago) by
pcanal
Original Path:
trunk/xml/src/TXMLEngine.cxx
File length: 35100 byte(s)
Diff to
previous 13317
From Sergei Linev:
1. Better support of TClonesArray.
Now TBufferXML all set bit, that member-wise streaming is not supported.
Therefore, objects in TClonesArray are stored in XML file in "normal" form
and you can see correctly them in xml.
2. Object conversion to/from XML
Some times ago I get a request to convert object directly to XML form without
file I/O. I implement four static methods in TBufferXML:
static TString ConvertToXML(TObject* obj, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
static TString ConvertToXML(void* obj, TClass* cl, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
static TObject* ConvertFromXML(const char* str, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
static void* ConvertFromXMLAny(const char* str, TClass** cl = 0, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
They convert object to/from string with XML nodes. Simplest code is look like:
TH1* h = new TH1I("name","title", 1000, 0, 1000);
TString s = TBufferXML::ConvertToXML(h);
cout << s << endl;
TObject* obj = TBufferXML::ConvertFromXML(s);
if (obj) obj->Draw();
3. More information stored in XML file.
I now store file creation/modification time, file UUID, file title, key title and creation time.
I also put TXMLFile version into file itself to support old format of XML file for case of TClonesArray.
4. Preparation for custom streamers support
I already put implementation of methods
virtual void ClassBegin(const TClass*, Version_t = -1);
virtual void ClassEnd(const TClass*);
virtual void ClassMember(const char* name, const char* typeName = 0, Int_t arrsize1 = -1, Int_t arrsize2 = -1);
into TBufferXML class to enable support for custom streamers.
They work the same way as I did for TBufferSQL2 class,
but to enable them, I need declaration of that functions in TBuffer class.
For TBuffer these functions does not required any implementation.
Revision
13317 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Nov 22 20:42:37 2005 UTC (9 years, 2 months ago) by
pcanal
Original Path:
trunk/xml/src/TXMLEngine.cxx
File length: 32715 byte(s)
Diff to
previous 13291
From Sergei:
Fix white spaces, add more comment to functions, add CVS tag lines and copyright.
It should now work for array of objects and most stl classes.
I put limitation for array size. If array with fixed size exceed limit (default 20),
array will be converted to raw data, otherwise each element of array will be presented as
single column.
Revision
11170 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Feb 23 11:46:02 2005 UTC (9 years, 11 months ago) by
brun
Original Path:
trunk/xml/src/TXMLEngine.cxx
File length: 30094 byte(s)
Diff to
previous 10843
From Sergei Linev
1. My TXMLEngine does not correctly treat quote symbol ("), which may appear
in comments to any data member.
I fix this simple problem.
2. Somewhere between ROOT 4.01 and 4.03 algorithm how elements of STL
containers like vector<>,
set<>, deque<> are stored in TBuffer was changed. Before each element was
stored individually, now they will
be written simultaniousely by WriteFastArray operation. On binary level
it looks ok, but for xml
format it brakes compatibility with previous versions. Hopefully, this
will not affect any users.
3. In connection with previous problem I modify TXMLPlayer class to have a
propper support of STL containers
in external readers. I also add in class description link to example how
TXMLPlayer class can be used.
This example inludes additional TXmlFile class (differ from ROOT
TXMLFile) which is now also integrates own
xml parser and does not require libxml2 library.
Revision
10835 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Dec 20 17:04:29 2004 UTC (10 years, 1 month ago) by
brun
Original Path:
trunk/xml/src/TXMLEngine.cxx
File length: 30081 byte(s)
Diff to
previous 9341
From Sergei Linev:
I implemented my own xml parser, which is capable to read and write xml files,
produced by ROOT XML I/O.
A lot of xml features are skipped, therefore it is 2.5 times faster and 4.5
times smaller in memory compared to libxml2.
The new implementation is backward compatible.
Revision
9341 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 29 14:45:38 2004 UTC (10 years, 6 months ago) by
brun
Original Path:
trunk/xml/src/TXMLEngine.cxx
File length: 10764 byte(s)
Diff to
previous 9315
From Sergey Linev:
I slightly modify xml package. I remove non used class TXMLDtdGenerator. I
plan to move it's code in TXMLPlayer class later, when all code generation
will be done. Do not forget to delete TXMLDtdGenerator.* files from
root/xml/inc, root/xml/src and root/include directory.
I fix problem for the case, when class inherits from STL class.
I also add some comments to new TXMLPlayer class.
Revision
8929 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 14 14:30:46 2004 UTC (10 years, 8 months ago) by
brun
Original Path:
trunk/xml/src/TXMLEngine.cxx
File length: 10397 byte(s)
Diff to
previous 8888
From Sergey Linev
1. TXMLFile can be opened with "create", "recreate", "open", "new", "update"
options. Special string like "2xoo" can be specified to "recreate" xml file with
specific xml options (explained in TXMLSetup class).
Close() and ReOpen() methods are implemented.
2. Correct writing and reading of TStreamerInfo classes to xml file.
Before they were skiped them when reading.
This can be optional (default on) (first cross in "2xoo")
3. Any data, which are stored directly to TBuffer like TBuffer::WriteBuf,
will be stored as binary block of data and restored when reading from file
4. According to compression level of TFile:
==0: no any repetition counters in arrays;
>0: repetition counter in array, in future also for TClonesArray fields
>5: file created without space indentation and new lines
Binary data compressed by zip with the same compression level
5. Namespaces are introduced (optional - default off).
If on, any data member get prefix according to class name.
To test, create file option should be "2xox" (last cross set namespaces on).
Object will look like:
<TAttLine xmlns:TAttLine="http://root.cern.ch/root/htmldoc/TAttLine.html" version="1">
<TAttLine:fLineColor v="1"/>
<TAttLine:fLineStyle v="1"/>
<TAttLine:fLineWidth v="1"/>
</TAttLine>
Important for DTD (in future) and just for convenient viewing of xml file.
6. Generic layout of XML file is introduced again.
still have some problems how it looks (because reading is ok), which
should be solved later.
In list of options it is first number 3 "3xoo".
Number 2 is default for class specific layout.
I keep several numbers for some variants, which may come later.
7. gXML global pointer is removed. Now each instance of TXMLFile creates own
copy of TXMLEngine object.
8. TXMLBuffer parent always set to correpondent TXMLFile. Important for TRef
classes.
9. Comments for TXMLFile, TXMLBuffer, TXMLKey are created. Other in progress
10. Small changes according to recent changes in TDirectory and in TKey
classes for not TObject classes.
Revision
8860 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Added
Mon May 10 21:29:26 2004 UTC (10 years, 8 months ago) by
brun
Original Path:
trunk/xml/src/TXMLEngine.cxx
File length: 8482 byte(s)
Introduce new package xml.
Originally proposed by Hans Essel from GSI.
Main implementation by Sergey Linev from GSI.
Adaptation to ROOT framework by Rene Brun.
"xml" is an optional package that can be used to write file.xml
instead of file.root. XML files do not have any advantages
compared to the normal ROOT files, except that the information
in these files can be edited via a normal editor.
The main motivation for this new format is to facilitate the
communication with other non ROOT applications. Currently
writing and reading XML files is limited to ROOT applications.
It is our intention to develop a simple reader independent
of the ROOT libraries that could be used as an example for
real applications.
The XML format should be used only for small data volumes,
typically histogram files, pictures, geometries, calibrations.
The XML file is built in memory before being dumped to disk.
Like for normal ROOT files, XML files use the same I/O mechanism
exploiting the ROOT/CINT dictionary. Any class having a dictionary
can be saved in XML format.
This first implementation does not support subdirectories
or Trees.
The shared library libRXML.so may be loaded dynamically
via gSystem->Load("libRXML"). This library is automatically
loaded by the plugin manager as soon as a XML file is created
via, eg
TFile::Open("file.xml","recreate");
TFile::Open returns a TXMLFile object. When a XML file is open in write mode,
one can use the normal TObject::Write to write an object in the file.
Alternatively one can use the new functions TDirectory::WriteObject and
TDirectory::WriteObjectAny to write a TObject* or any class not deriving
from TObject.
example of a session saving a histogram to a XML file
=====================================================
TFile *f = TFile::Open("Example.xml","recreate");
TH1F *h = new TH1F("h","test",1000,-2,2);
h->FillRandom("gaus");
h->Write();
delete f;
example of a session reading the histogram from the file
========================================================
TFile *f = TFile::Open("Example.xml");
TH1F *h = (TH1F*)f->Get("h");
h->Draw();
A new option in the canvas "File" menu is available to save
a TCanvas as a XML file. One can also do
canvas->Print("Example.xml");
Configuring ROOT with the option "xml"
======================================
The XML package uses the public XML parser and toolkit
from Gnome. You should download the latest version 2-6.9
from http://www.xmlsoft.org/downloads.html.
On Unix systems dowload "libxml2-2.6.9.tar.gz" and create
XMLDIR pointing to the directory libxml2-2.6.9. in the XMLDIR
directory, run the normal
./configure
make
On Windows, from the same web site download
libxml2-2.6.9.win32.zip
iconv-1.9.1.win32.zip
unzip the two files, then copy the file iconv.h from the iconv/include file
to $XMLDIR/include. Also copy iconv.dll, iconv.lib and iconv_a.lib
from the iconv/lib directory to $XMLDIR/lib.
You are now ready to configure ROOT with the XML option. do:
./configure -enable-xml -enable-xxxxx, etc
documentation
=============
The "xml" package is currently under development. A more complete
documentation will be provided shortly in the classes reference guide.
See classes TXMLFile, TXMLKey, TXMLBuffer, TXMLEngine, TXMLSetup
and TXMLDtdGenerator.
An example of XML file corresponding to the small example below
can be found at http://root.cern.ch/root/Example.xml.
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.