Dear XML users,
I am attempting to read a MRML file using
doc = xmlReadFile(this->Filename.c_str(), NULL, 0);
and processing the doc file node by node, where the MRML file features the
following type of entries...
<Slice
id="vtkMRMLSliceNode2" name="Red" hideFromEditors="true" selectable="true"
selected="false" fieldOfView="258.98 249.71 1" dimensions="894 862 1"
activeSlice="0" la
youtGridRows="1" layoutGridColumns="1" sliceToRAS="-1 0 0 0 0 1 0 0 0 0 1 0
0 0 0 1" layoutName="Red" orientation="Axial" jumpMode="1"
sliceVisibility="false" widge
tVisibility="false" useLabelOutline="false" sliceSpacingMode="0"
prescribedSliceSpacing="1 1 1"></Slice>
I'm finding that "meaningful" nodes seem to alternate with nodes whose name
is "text", and I would like to find a way to parse what is in these "text"
nodes. Meantime, I get results like this:
for ( nodeLevel1 = doc->children; nodeLevel1 != NULL; nodeLevel1 =
nodeLevel1->next)
{
//printf("nodeLevel1->name %s count %d \n",nodeLevel1->name, count);
for( nodeLevel2 = nodeLevel1->children; nodeLevel2 != NULL;
nodeLevel2 = nodeLevel2->next)
{
std::cout << " nodeLevel2->name " << nodeLevel2->name
<< " type " << nodeLevel2->type
//<< " content " << (char *)(nodeLevel2->content)
<< "\n";
...
}
}
Output:
...
nodeLevel2->name Slice type 1
adding slice Slice0
nodeLevel2->name text type 3
nodeLevel2->name text content
Can anyone recommend a function in XML that will parse this data?
id="vtkMRMLSliceNode2" name="Red" hideFromEditors="true" selectable="true"
selected="false" fieldOfView="258.98 249.71 1" dimensions="894 862 1"
activeSlice="0" la
youtGridRows="1" layoutGridColumns="1" sliceToRAS="-1 0 0 0 0 1 0 0 0 0 1 0
0 0 0 1" layoutName="Red" orientation="Axial" jumpMode="1"
sliceVisibility="false" widge
tVisibility="false" useLabelOutline="false" sliceSpacingMode="0"
prescribedSliceSpacing="1 1 1">
Best wishes,
Michel
--
Michel Audette, Ph.D.
R & D Engineer,
Kitware Inc.,
Chapel Hill, N.C.
_______________________________________________
xml mailing list, project page http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml