XIncludingReader seems to drop the top-level attributes of the included XML file when used with the Saxon.NET engine.
The bug appears to be with Oleg's changes to MoveToAttribute(int i), where he forgets to reset the state back to Default as follows:
if (i >= _reader.AttributeCount || i == _realXmlBaseIndex)
{
_state = XIncludingReaderState.ExposingXmlBaseAttr;
}
else
{
_state = XIncludingReaderState.Default;
_reader.MoveToAttribute(i);
}
Also, we may want to actually set the state to ExposingXmlLangAttr inside the first statement like this:
if (i > _reader.AttributeCount && _differentLang)
_state = XIncludingReaderState.ExposingXmlLangAttr;
The bug appears to be with Oleg's changes to MoveToAttribute(int i), where he forgets to reset the state back to Default as follows:
if (i >= _reader.AttributeCount || i == _realXmlBaseIndex)
{
_state = XIncludingReaderState.ExposingXmlBaseAttr;
}
else
{
_state = XIncludingReaderState.Default;
_reader.MoveToAttribute(i);
}
Also, we may want to actually set the state to ExposingXmlLangAttr inside the first statement like this:
if (i > _reader.AttributeCount && _differentLang)
_state = XIncludingReaderState.ExposingXmlLangAttr;