I try to create a diagramm based on a XML-file. I am using a changed variant of ProcessDocument. The biggest change I made is removing everything connectred to writing XML, because I only need to read.
My problem is that my programm doesn't read the Child elements. The child in ConsumeChild is always null and the Allocate method for the child -which I overrode- is never called.
You did set BodyConsumesChildElements to true on your parent element transformer, right? I'm just guessing at what might be wrong, since it isn't obvious to me.
Thanks, for trying to help. Actually it was only a really stupid copy-and-paste mistake, so that I used the same TransformerType twice, for the child and the child’s child.
At the moment I am not totally sure about that and just now I can’t reproduce it. What I know for sure is, that ConsumeChild is called once for the node transformer and twice for the content transformer. In both cases the value of small is false.
As soon as I can test it again, I will write more information about how often allocate is called.
The elements got all allocated and the attributes seem to be right. What causes a problem is the fact that ConsumeChild of the node transformer is only called with the first content element as child but not with the second. So it isn't added to the node.
Sorry for confusing with wrong information in the posts before.
Yes, there’s a bug doing the XML parsing when there are nested elements and when using an XmlTextReader instead of using XML DOM. We’ll fix this for the next release (2.5.3), which should be coming out soon.