File tree Expand file tree Collapse file tree
src/OneScript.StandardLibrary/Xml Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -387,6 +387,16 @@ private void V8CompatibleSkip()
387387
388388 [ ContextMethod ( "Прочитать" , "Read" ) ]
389389 public bool Read ( )
390+ {
391+ var readingDone = ReadInternal ( ) ;
392+ if ( readingDone && _reader . NodeType == XmlNodeType . XmlDeclaration && _settings . IgnoreXMLDeclaration )
393+ {
394+ readingDone = ReadInternal ( ) ;
395+ }
396+ return readingDone ;
397+ }
398+
399+ private bool ReadInternal ( )
390400 {
391401 if ( _reader == null )
392402 return false ;
@@ -396,6 +406,15 @@ public bool Read()
396406 _emptyElemReadState = EmptyElemCompabilityState . EmptyElementRead ;
397407 return true ;
398408 }
409+ else if ( _reader . NodeType == XmlNodeType . XmlDeclaration || _reader . NodeType == XmlNodeType . DocumentType )
410+ {
411+ var readingDone = _reader . Read ( ) ;
412+ while ( readingDone && _reader . NodeType == XmlNodeType . Whitespace )
413+ {
414+ readingDone = _reader . Read ( ) ;
415+ }
416+ return readingDone ;
417+ }
399418 else
400419 {
401420 bool readingDone = _ignoreWSChanged ? ReadWhenStateChanged ( ) : _reader . Read ( ) ;
You can’t perform that action at this time.
0 commit comments