From: Jan T. <de...@us...> - 2002-06-09 12:48:16
|
Update of /cvsroot/net-script/netscript2/src/perl/XML/DOM2 In directory usw-pr-cvs1:/tmp/cvs-serv25095 Modified Files: DOMParser.pm Node.pm Log Message: * minor fixes * domparser sets line-property of node, which specifies in which line the node was in the textual representation of the document Index: DOMParser.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/XML/DOM2/DOMParser.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DOMParser.pm 8 Jun 2002 12:14:29 -0000 1.6 --- DOMParser.pm 9 Jun 2002 12:48:12 -0000 1.7 *************** *** 138,141 **** --- 138,142 ---- $namespaceURI, defined($prefix) ? $prefix.":".$element : $element ); + $elementNode -> setLine( $expat -> current_line() ); # get currently innermost open Element. *************** *** 185,188 **** --- 186,190 ---- # first, create a text node my $textNode = $this -> { m_document } -> createTextNode( $string ); + $textNode -> setLine( $expat -> current_line() ); # append it to the context element *************** *** 200,204 **** my $procNode = $this -> { m_document } -> createProcessingInstruction( $target, $data ); ! # append it to the context element $this -> { m_contextElement } -> appendChild( $procNode ); --- 202,206 ---- my $procNode = $this -> { m_document } -> createProcessingInstruction( $target, $data ); ! $procNode -> setLine( $expat -> current_line() ); # append it to the context element $this -> { m_contextElement } -> appendChild( $procNode ); *************** *** 215,218 **** --- 217,221 ---- my $commentNode = $this -> { m_document } -> createComment( $data ); + $commentNode -> setLine( $expat -> current_line() ); # append it to the context element Index: Node.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/XML/DOM2/Node.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Node.pm 8 Jun 2002 12:14:29 -0000 1.19 --- Node.pm 9 Jun 2002 12:48:12 -0000 1.20 *************** *** 70,73 **** --- 70,74 ---- $this -> { m_firstChild } = undef; $this -> { m_lastChild } = undef; + $this -> { m_line } = undef; return $this; # return Object } *************** *** 754,756 **** --- 755,779 ---- } + #/** + # Sets the line number where this node occured in the textual representation + # of the document. + # @param a line number + # @not-standard + # @public + #*/ + sub setLine { + my ( $this, $line ) = @_; + $this -> { m_Line } = $line; + } + + #/** + # Returns the line number where this node occured in the textual representation + # of the document. + # @not-standard + # @public + #*/ + sub getLine { + my ( $this ) = @_; + $this -> { m_Line }; + } 1; # make require happy |