core/trunk/XMLv2__DOM3XMLReader.st
changeset 3 7909b6680107
parent 2 06f508a6f55c
child 77 d17c7dfb3d53
equal deleted inserted replaced
2:06f508a6f55c 3:7909b6680107
     1 "{ Package: 'stx:goodies/xmlsuite' }"
     1 "{ Package: 'stx:goodies/xmlsuite/core' }"
     2 
     2 
     3 "{ NameSpace: XMLv2 }"
     3 "{ NameSpace: XMLv2 }"
     4 
     4 
     5 XMLReader subclass:#DOM3XMLReader
     5 XMLReader subclass:#DOM3XMLReader
     6 	instanceVariableNames:''
     6 	instanceVariableNames:''
    15 concreteClass
    15 concreteClass
    16 
    16 
    17     ^self
    17     ^self
    18 
    18 
    19     "Created: / 23-12-2005 / 20:06:28 / janfrog"
    19     "Created: / 23-12-2005 / 20:06:28 / janfrog"
       
    20 ! !
       
    21 
       
    22 !DOM3XMLReader class methodsFor:'testing'!
       
    23 
       
    24 isSpecial
       
    25 
       
    26     ^true
       
    27 
       
    28     "Created: / 11-11-2006 / 19:26:14 / janfrog"
    20 ! !
    29 ! !
    21 
    30 
    22 !DOM3XMLReader methodsFor:'SAX2 events'!
    31 !DOM3XMLReader methodsFor:'SAX2 events'!
    23 
    32 
    24 getColumnNumber
    33 getColumnNumber
    50     self shouldImplement
    59     self shouldImplement
    51 
    60 
    52     "Created: / 23-12-2005 / 20:06:28 / janfrog"
    61     "Created: / 23-12-2005 / 20:06:28 / janfrog"
    53 ! !
    62 ! !
    54 
    63 
       
    64 !DOM3XMLReader methodsFor:'initialization'!
       
    65 
       
    66 initialize
       
    67 
       
    68     super initialize.
       
    69     namespacePrefixMapping := Dictionary new
       
    70 
       
    71     "Created: / 11-11-2006 / 12:01:36 / janfrog"
       
    72 ! !
       
    73 
    55 !DOM3XMLReader methodsFor:'visiting'!
    74 !DOM3XMLReader methodsFor:'visiting'!
       
    75 
       
    76 parseNode:aDocument 
       
    77     aDocument acceptVisitor:self
       
    78 
       
    79     "Created: / 10-12-2006 / 13:49:55 / janfrog"
       
    80 !
    56 
    81 
    57 readDOMNode:aDocument 
    82 readDOMNode:aDocument 
    58     aDocument acceptVisitor:self
    83     aDocument acceptVisitor:self
    59 
    84 
    60     "Created: / 23-12-2005 / 20:26:04 / janfrog"
    85     "Created: / 23-12-2005 / 20:26:04 / janfrog"
    73         endElement: 'fakeNode' 
    98         endElement: 'fakeNode' 
    74         namespace: ''
    99         namespace: ''
    75         prefix: ''
   100         prefix: ''
    76 
   101 
    77     "Modified: / 25-12-2005 / 11:16:25 / janfrog"
   102     "Modified: / 25-12-2005 / 11:16:25 / janfrog"
       
   103 !
       
   104 
       
   105 visitCDATASection:aCDATASection
       
   106 
       
   107     (contentHandler respondsTo:#cDataSection:)
       
   108         ifTrue:[contentHandler cDataSection:aCDATASection data]
       
   109         ifFalse:[contentHandler characters:aCDATASection data]
       
   110 
       
   111     "Created: / 28-12-2005 / 16:18:05 / janfrog"
    78 !
   112 !
    79 
   113 
    80 visitComment:aComment
   114 visitComment:aComment
    81 
   115 
    82     contentHandler comment: aComment data
   116     contentHandler comment: aComment data
    99 
   133 
   100     aDocumentFragment childNodes do:
   134     aDocumentFragment childNodes do:
   101         [:child|child acceptVisitor: self].
   135         [:child|child acceptVisitor: self].
   102 
   136 
   103     "Created: / 24-12-2005 / 10:55:01 / janfrog"
   137     "Created: / 24-12-2005 / 10:55:01 / janfrog"
       
   138 !
       
   139 
       
   140 visitDocumentType:aDocumentType
       
   141     "nothing to do"
       
   142 
       
   143     "Created: / 07-04-2007 / 15:03:59 / janfrog"
   104 !
   144 !
   105 
   145 
   106 visitElement:anElement
   146 visitElement:anElement
   107 
   147 
   108     | ns localName prefix attrs |
   148     | ns localName prefix attrs |