xquery/XQuery__DefaultXDMAdaptorProvider.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 02 Jul 2018 08:46:01 +0200
changeset 305 bad21c4f64bf
parent 296 ea3dbc023c80
permissions -rw-r--r--
Tagged Smalltalk/X 8.0.0

"{ Package: 'stx:goodies/xmlsuite/xquery' }"

"{ NameSpace: XQuery }"

XDMAdaptorProvider subclass:#DefaultXDMAdaptorProvider
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'XQuery-XDM'
!


!DefaultXDMAdaptorProvider methodsFor:'accessing'!

documentAdaptorsFor: aStringOrURI

    | uri documentAdaptor |
    uri := aStringOrURI asURI.
    uri exists ifFalse:[^XQuery::DocumentNotFoundError raiseErrorString:'A document ',uri asString,' is not found'].
    uri readStreamDo:
        [:stream :attrs|
        documentAdaptor := XQuery::XDMAdaptorFactory
            documentAdaptorFor:(XMLv2::Parser forDOM3 processDocumentInStream:stream
            beforeScanDo:[:parser | parser validate:false ])].

    ^Array with:documentAdaptor

    "Created: / 20-09-2007 / 10:32:41 / janfrog"
    "Modified: / 06-04-2010 / 11:55:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!DefaultXDMAdaptorProvider class methodsFor:'documentation'!

version_SVN
    ^ '$Id$'
! !