@@ -2473,6 +2473,55 @@ abc`)).rejects.toBeTruthy();
24732473 quad ( 'http://ex.org/i/subject' , 'http://anon.org/o/hasBlankNode' , '_:yellow"' ) ,
24742474 ] ) ;
24752475 } ) ;
2476+
2477+ it ( 'rdf:version attribute on the root tag' , async ( ) => {
2478+ const cb = jest . fn ( ) ;
2479+ parser . on ( 'version' , cb ) ;
2480+ await parse ( parser , `<?xml version="1.0"?>
2481+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
2482+ xmlns:dc="http://purl.org/dc/elements/1.1/"
2483+ xmlns:ex="http://example.org/stuff/1.0/"
2484+ rdf:version="1.2">
2485+ <rdf:Description>
2486+ <ex:editor>
2487+ <rdf:Description></rdf:Description>
2488+ </ex:editor>
2489+ </rdf:Description>
2490+ </rdf:RDF>` ) ;
2491+ return expect ( cb ) . toHaveBeenCalledWith ( '1.2' ) ;
2492+ } ) ;
2493+
2494+ it ( 'rdf:version attribute a property tag' , async ( ) => {
2495+ const cb = jest . fn ( ) ;
2496+ parser . on ( 'version' , cb ) ;
2497+ await parse ( parser , `<?xml version="1.0"?>
2498+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
2499+ xmlns:dc="http://purl.org/dc/elements/1.1/"
2500+ xmlns:ex="http://example.org/stuff/1.0/">
2501+ <rdf:Description>
2502+ <ex:editor rdf:version="1.2">
2503+ <rdf:Description></rdf:Description>
2504+ </ex:editor>
2505+ </rdf:Description>
2506+ </rdf:RDF>` ) ;
2507+ return expect ( cb ) . toHaveBeenCalledWith ( '1.2' ) ;
2508+ } ) ;
2509+
2510+ it ( 'rdf:version attribute an internal tag' , async ( ) => {
2511+ const cb = jest . fn ( ) ;
2512+ parser . on ( 'version' , cb ) ;
2513+ await parse ( parser , `<?xml version="1.0"?>
2514+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
2515+ xmlns:dc="http://purl.org/dc/elements/1.1/"
2516+ xmlns:ex="http://example.org/stuff/1.0/">
2517+ <rdf:Description>
2518+ <ex:editor>
2519+ <rdf:Description rdf:version="1.2"></rdf:Description>
2520+ </ex:editor>
2521+ </rdf:Description>
2522+ </rdf:RDF>` ) ;
2523+ return expect ( cb ) . toHaveBeenCalledWith ( '1.2' ) ;
2524+ } ) ;
24762525 } ) ;
24772526
24782527 describe ( 'streaming-wise' , ( ) => {
0 commit comments