0
|
1 |
"{ Package: 'stx:goodies/xmlsuite/xpath' }"
|
|
2 |
|
|
3 |
"{ NameSpace: XMLv2 }"
|
|
4 |
|
|
5 |
XPathDocumentProvider subclass:#XPathSimpleDocumentProvider
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'XML Suite-XPath-Adaptors'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!XPathSimpleDocumentProvider methodsFor:'accessing'!
|
|
14 |
|
|
15 |
documentAdaptorsFor: aStringOrURI
|
|
16 |
|
|
17 |
| uri documentAdaptor |
|
|
18 |
uri := aStringOrURI asURI.
|
|
19 |
uri exists ifFalse:[^XPathDocumentNotFoundError raiseErrorString:'A document ',uri asString,' is not found'].
|
|
20 |
uri readStreamDo:
|
|
21 |
[:stream :attrs|
|
|
22 |
documentAdaptor := XMLv2::XPathDocumentAdaptorFactory
|
|
23 |
documentAdaptorFor:(XMLv2::Parser forDOM3 processDocumentInStream:stream
|
|
24 |
beforeScanDo:[:parser | parser validate:false ])].
|
|
25 |
|
|
26 |
^Array with:documentAdaptor
|
|
27 |
|
|
28 |
"Created: / 20-09-2007 / 10:32:41 / janfrog"
|
|
29 |
! !
|
|
30 |
|
|
31 |
!XPathSimpleDocumentProvider class methodsFor:'documentation'!
|
|
32 |
|
|
33 |
version
|
|
34 |
^ '$Header: /opt/data/cvs/stx/goodies/xmlsuite/xpath/XMLv2__XPathSimpleDocumentProvider.st,v 1.3 2007-09-21 11:06:52 vranyj1 Exp $'
|
|
35 |
! !
|