core/XMLv2__CincomDOMXMLReader.st
changeset 296 ea3dbc023c80
parent 174 76f50ac2e6a0
child 300 b6d834208d33
equal deleted inserted replaced
295:c8f93ca6258c 296:ea3dbc023c80
       
     1 "{ Package: 'stx:goodies/xmlsuite/core' }"
       
     2 
       
     3 "{ NameSpace: XMLv2 }"
       
     4 
       
     5 XMLReader subclass:#CincomDOMXMLReader
       
     6 	instanceVariableNames:''
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'XML Suite-SAX2-XMLReaders'
       
    10 !
       
    11 
       
    12 
       
    13 !CincomDOMXMLReader class methodsFor:'accessing'!
       
    14 
       
    15 concreteClass
       
    16 
       
    17     ^self
       
    18 
       
    19     "Created: / 21-12-2005 / 17:41:18 / janfrog"
       
    20 ! !
       
    21 
       
    22 !CincomDOMXMLReader class methodsFor:'testing'!
       
    23 
       
    24 isSpecial
       
    25 
       
    26     ^true
       
    27 
       
    28     "Created: / 29-10-2006 / 22:43:25 / janfrog"
       
    29 ! !
       
    30 
       
    31 !CincomDOMXMLReader methodsFor:'SAX2 events'!
       
    32 
       
    33 getColumnNumber
       
    34 
       
    35     ^nil
       
    36 
       
    37     "Created: / 21-12-2005 / 17:22:44 / janfrog"
       
    38 !
       
    39 
       
    40 getLineNumber
       
    41 
       
    42     ^nil
       
    43 
       
    44     "Created: / 21-12-2005 / 17:22:44 / janfrog"
       
    45 !
       
    46 
       
    47 parseFragmentStream:aStream
       
    48 
       
    49     "I read Cincom DOM tree, not stream"
       
    50 
       
    51     self shouldNotImplement
       
    52 
       
    53     "Modified: / 21-12-2005 / 17:23:30 / janfrog"
       
    54 !
       
    55 
       
    56 parseNode:aDocument 
       
    57     aDocument acceptVisitor:self
       
    58 
       
    59     "Created: / 10-12-2006 / 13:49:55 / janfrog"
       
    60 !
       
    61 
       
    62 parseStream:aStream 
       
    63     "Superclass says that I am responsible to implement this method"
       
    64 
       
    65     self shouldImplement
       
    66 
       
    67     "Created: / 21-12-2005 / 17:22:44 / janfrog"
       
    68 !
       
    69 
       
    70 visitComment:aComment
       
    71 
       
    72     contentHandler comment: aComment text
       
    73 
       
    74     "Created: / 21-12-2005 / 17:22:37 / janfrog"
       
    75 !
       
    76 
       
    77 visitDocument:aDocument
       
    78 
       
    79     contentHandler startDocument.
       
    80     aDocument children do:
       
    81         [:child|child acceptVisitor: self].
       
    82     contentHandler endDocument
       
    83 
       
    84     "Created: / 21-12-2005 / 17:22:37 / janfrog"
       
    85 !
       
    86 
       
    87 visitElement:anElement
       
    88 
       
    89     | ns localName prefix attrs |
       
    90     ns := anElement tag namespace.
       
    91     localName := anElement tag type.
       
    92     prefix := anElement tag qualifier.
       
    93     attrs := Attributes new:(anElement attributes size).
       
    94     anElement attributes do:
       
    95         [:oldAttr | attrs add: (Attr fromCincomAttribute: oldAttr)].
       
    96 
       
    97 
       
    98     contentHandler 
       
    99         startElement: localName 
       
   100         namespace: ns
       
   101         prefix: prefix
       
   102         attributes: attrs.
       
   103 
       
   104     anElement children do:
       
   105         [:child| child acceptVisitor:self].
       
   106 
       
   107     contentHandler 
       
   108         endElement: localName 
       
   109         namespace: ns
       
   110         prefix: prefix
       
   111 
       
   112     "Modified: / 30-05-2005 / 16:30:11 / masca"
       
   113     "Created: / 21-12-2005 / 17:22:37 / janfrog"
       
   114 !
       
   115 
       
   116 visitPI:aPI
       
   117 
       
   118     contentHandler processingInstruction:aPI name data:aPI text
       
   119 
       
   120     "Created: / 21-12-2005 / 17:22:37 / janfrog"
       
   121 !
       
   122 
       
   123 visitText:aText
       
   124 
       
   125     contentHandler characters: aText text
       
   126 
       
   127     "Created: / 21-12-2005 / 17:22:37 / janfrog"
       
   128 ! !
       
   129 
       
   130 !CincomDOMXMLReader class methodsFor:'documentation'!
       
   131 
       
   132 version
       
   133     ^ '$Header: /opt/data/cvs/stx/goodies/xmlsuite/xmlreaderimpl/XMLv2__CincomDOMXMLReader.st,v 1.4 2006-12-12 13:53:47 vranyj1 Exp $'
       
   134 !
       
   135 
       
   136 version_SVN
       
   137     ^ '$Id$'
       
   138 ! !