@@ -39,6 +39,27 @@ class XmlReaderCaster
3939 \XmlReader::XML_DECLARATION =>'XML_DECLARATION '
4040 );
4141
42+ protected static $ filteredTypes =array (
43+ \XmlReader::NONE =>true ,
44+ \XmlReader::ELEMENT =>true ,
45+ \XmlReader::ATTRIBUTE =>false ,
46+ \XmlReader::TEXT =>true ,
47+ \XmlReader::CDATA =>true ,
48+ \XmlReader::ENTITY_REF =>false ,
49+ \XmlReader::ENTITY =>false ,
50+ \XmlReader::PI =>false ,
51+ \XmlReader::COMMENT =>true ,
52+ \XmlReader::DOC =>false ,
53+ \XmlReader::DOC_TYPE =>false ,
54+ \XmlReader::DOC_FRAGMENT =>false ,
55+ \XmlReader::NOTATION =>false ,
56+ \XmlReader::WHITESPACE =>false ,
57+ \XmlReader::SIGNIFICANT_WHITESPACE =>false ,
58+ \XmlReader::END_ELEMENT =>false ,
59+ \XmlReader::END_ENTITY =>false ,
60+ \XmlReader::XML_DECLARATION =>true
61+ );
62+
4263public static function castXmlReader (\XmlReader $ reader ,array $ a ,Stub $ stub ,$ isNested )
4364 {
4465$ infos =array (
@@ -67,6 +88,11 @@ public static function castXmlReader(\XmlReader $reader, array $a, Stub $stub, $
6788 }
6889 }
6990
91+ if (false ===static ::$ filteredTypes [$ reader ->nodeType ]) {
92+ $ stub ->cut +=count ($ infos );
93+ return array ();
94+ }
95+
7096return $ a +$ infos ;
7197 }
7298}