From: Jan T. <de...@us...> - 2003-05-29 16:00:06
|
Update of /cvsroot/net-script/netscript2/src/perl/XML/DAL In directory sc8-pr-cvs1:/tmp/cvs-serv27198 Added Files: DAL.pm LibXMLDAL.pm README.html XMLDOM2DAL.pm wipeout.project Log Message: * began implementation of DAL --- NEW FILE: DAL.pm --- #-------------------------------------------------------- # DOM Abstraction Layer # $Id: DAL.pm,v 1.1 2003/05/29 16:00:02 derkork Exp $ # # DOM2 and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; #/** # This is the base class of the insOMnia DOM abstraction Layer. # it serves as a template for any abstraction layers. # @abstract #*/ package XML::DAL::DAL; #/** # Ctor. # @public #*/ sub new { my $proto = shift; # get Prototype my $class = ref($proto) || $proto; my $this = {}; bless( $this, $class ); $this; } #/** # Parses the file with the given filename and returns the document # of the wrapped DOM. # @param a filename containing XML which should be parsed # @return the Document representation of the parsed file # @public #*/ sub parseFile { } #/** # Same as parseFile, however parses the given string instead of a file. # @param a string containing XML to be parsed. # @return the document representation of the parsed string. # @public #*/ sub parseString { } # ---------------- Node Type Checking -------------------- #/** # Returns nonzero if the given node is an element node. # @param a node #*/ sub isElementNode { } #/** # Returns nonzero if the given node is a text node # @param a node #*/ sub isTextNode { } #/** # Returns nonzero, if the given node is a processing instruction node # @param a node #*/ sub isProcessingInstructionNode { } #/** # Returns nonzero if the given node is a comment node. # @param a node #*/ sub isCommentNode { } #/** # Returns nonzero if the given node is a document node. # @param a node #*/ sub isDocumentNode { } # ---------------- Node Functions -------------------- #/** # Appends the given child node to the given parent node. # @param the parent node # @param the node to append to the parent node. #*/ sub appendChild { } #/** # Inserts the given node before the given child node of the given parent node # @param the parent node # @param the reference node # @param the node to insert #*/ sub insertBefore { } #/** # Removes the given child node from the given parent node. # @param the node to remove the child from # @param the node to remove from the parent node. # @return the removed node. #*/ sub removeChild { } #/** # Returns the first child of the given node. # @param the node whichs first child should be returned. # @return the first child of the given node or undef if the node has no child # nodes. #*/ sub getFirstChild { } #/** # Returns the parent node of the given node. # @param the node whichs parent should be returned. # @return the parent node of the given node. #*/ sub getParentNode { } #/** # Returns the next sibling of the given node. # @param the node whichs next sibling should be returned. # @return the next sibling of the given node or undef if there is no next # sibling. #*/ sub getNextSibling { } #/** # Returns the previous sibling of the given node. # @param the node whichs previous sibling should be returned. # @return the previous sibling or undef if there is no previous sibling. #*/ sub getPreviousSibling { } #/** # Returns a NodeList containing the child nodes of the given node. # @param the node whichs childnodes should be returned # @return a node list #*/ sub getChildNodes { } #/** # Returns the attributes of the given node as a NodeList. # @param the node # @return a nodelist containing the attributes of this node. #*/ sub getAttributes { } #/** # Returns the fully qualified node name of the given node. # @param a node # @return the node name of the given node. #*/ sub getNodeName { } #/** # Returns the namespace URI of the given node. # @param a node # @return the namespace uri of the given node #*/ sub getNamespaceURI { } #/** # Returns the local name of the given node. # @param a node # @return the local (non-prefixed) name of the node #*/ sub getLocalName { } # ---------------- PI functions -------------------- #/** # Returns the target of a processing instruction. # @param the processing instruction node # @return a string holding the target of the PI #*/ sub getPITarget { } #/** # Returns the data of a processing instruction # @param the processing instruction node # @return a string holding the data of the PI #*/ sub getPIData { } # ---------------- Attr functions -------------------- #/** # Returns the node value of the given Attr. # @param an Attr # @return a string holding the value of the node #*/ sub getAttrValue { } #/** # Sets the node value of the given node. # @param a node # @param a string holding the new value of the given node. #*/ sub setAttrValue { } # ---------------- Element functions -------------------- #/** # Returns the value of the given attribute of the given element. # @param an element node # @param the name of the attribute to return # @return a string holding the attribute's value #*/ sub getAttribute { } # ---------------- CDATA functions -------------------- #/** # Returns the data of the given CDATA/Text node. # @param a node # @return a string holding the data of the node. #*/ sub getCData { } #/** # Sets the data of the given CDATA/Text node. # @param a node # @param the new value for the node. #*/ sub setCData { } # ---------------- NodeList functions -------------------- #/** # Returns the length of a nodelist # @param a NodeList # @return the length of a node list #*/ sub getLength { } #/** # Return the item at the given index from the node list. # @param the list to retrieve the item from. # @param the index of the item (zero-based) # @return a node from the given index #*/ sub getItemAt { } # ---------------- Document Functions -------------------- #/** # Creates a new document. # @param the namespace uri of the document element # @param the fully qualified name of the document element. # @return a document node #*/ sub createDocument { } #/** # Returns the document element of the given document. # @param a document node # @return an element node - the document element of the given document. #*/ sub getDocumentElement { } #/** # Import the given node into the given document. # @param the document to import the node into # @param the node to import # @param set nonzero to do a deep (recursive) import, zero to do a shallow import # @return the imported node. #*/ sub importNode { } 1; --- NEW FILE: LibXMLDAL.pm --- #-------------------------------------------------------- # LibXML DOM Abstraction Layer # $Id: LibXMLDAL.pm,v 1.1 2003/05/29 16:00:02 derkork Exp $ # # DOM2 and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; use XML::LibXML; #/** # An implementation of the DAL for XML::LibXML. #*/ package XML::DAL::LibXMLDAL; use base qw(XML::DAL::DAL); sub parseFile { my ( $this, $file ) = @_; my $parser = XML::LibXML -> new(); return $parser -> parse_file( $file ); } sub parseString { my ( $this, $string ) = @_; my $parser = XML::LibXML -> new(); return $parser -> parse_string( $string ); } 1; --- NEW FILE: README.html --- <pre> /---------------------------------------------------------------------\ | $Id: README.html,v 1.1 2003/05/29 16:00:02 derkork Exp $ | NetScript and all related materials, such as documentation, | are protected under the terms and conditions of the Artistic License. | | (C) 2000-2002 by Jan Thomä, insOMnia (ko...@in...) \---------------------------------------------------------------------/ The DAL is the DOM Abstraction Layer used by NetScript to abstract over different available DOM implementations. It is not meant to be a generic abstraction layer for any kind of DOM implementation. It just holds enough functions to provide sufficient support to NetScript's needs. If the need for a more sophisticated DAL arises, this will become a project of its own. </pre> --- NEW FILE: XMLDOM2DAL.pm --- #-------------------------------------------------------- # XML::DOM2 DOM Abstraction Layer # $Id: XMLDOM2DAL.pm,v 1.1 2003/05/29 16:00:02 derkork Exp $ # # DOM2 and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; use XML::DOM2::DOMParser; #/** # An implementation of the DAL for XML::DOM2. #*/ package XML::DAL::XMLDOM2DAL; use base qw(XML::DAL::DAL); sub parseFile { my ( $this, $file ) = @_; my $parser = XML::DOM2::DOMParser -> new(); return $parser -> parseFile( $file ); } sub parseString { my ( $this, $string ) = @_; my $parser = XML::DOM2::DOMParser -> new(); return $parser -> parseString( $string ); } 1; --- NEW FILE: wipeout.project --- b C DmDictionary 0 77f08 8 c 0 77fec 9 C Category 1 6ca42 c 0 7802c 4 C DmString 2 78033 2 e3 c 2 78032 a defaultExe C DmSet 3 78035 1 c 2 6ca54 2 e3 L 6ca54 c 2 78034 b executables c 3 78030 3 c 2 6ca4a 3 *.C L 6ca4a c 2 6ca4c 4 *.cc L 6ca4c c 2 6ca4e 5 *.cpp L 6ca4e c 2 7802f a extensions c 2 7802e a CPP_source c 2 7802d 4 name c 2 77fee a CPP_source c 1 6ca58 c 0 78072 4 c 2 78079 2 e3 c 2 78078 a defaultExe c 3 7807b 1 c 2 6ca66 2 e3 L 6ca66 c 2 7807a b executables c 3 78076 1 c 2 6ca60 3 *.c L 6ca60 c 2 78075 a extensions c 2 78074 8 C_source c 2 78073 4 name c 2 77fef 8 C_source c 1 6ca6a c 0 780ac 4 c 2 780b3 2 e3 c 2 780b2 a defaultExe c 3 780b5 1 c 2 6ca78 2 e3 L 6ca78 c 2 780b4 b executables c 3 780b0 1 c 2 6ca72 3 *.e L 6ca72 c 2 780af a extensions c 2 780ae 6 Eiffel c 2 780ad 4 name c 2 77ff0 6 Eiffel c 1 6ca7c c 0 780e6 4 c 2 780ed 2 e3 c 2 780ec a defaultExe c 3 780ef 1 c 2 6ca90 2 e3 L 6ca90 c 2 780ee b executables c 3 780ea 4 c 2 6ca84 3 *.F L 6ca84 c 2 6ca86 3 *.f L 6ca86 c 2 6ca88 5 *.for L 6ca88 c 2 6ca8a 5 *.fpp L 6ca8a c 2 780e9 a extensions c 2 780e8 7 Fortran c 2 780e7 4 name c 2 77ff1 7 Fortran c 1 6ca94 c 0 7812c 4 c 2 78133 2 e3 c 2 78132 a defaultExe c 3 78135 1 c 2 6caa4 2 e3 L 6caa4 c 2 78134 b executables c 3 78130 2 c 2 6ca9c 3 *.H L 6ca9c c 2 6ca9e 3 *.h L 6ca9e c 2 7812f a extensions c 2 7812e 6 Header c 2 7812d 4 name c 2 77ff2 6 Header c 1 6caa8 c 0 7816a 4 c 2 78171 9 surfboard c 2 78170 a defaultExe c 3 78173 2 c 2 6cab8 2 e3 L 6cab8 c 2 6caba 9 surfboard L 6caba c 2 78172 b executables c 3 7816e 2 c 2 6cab0 5 *.htm L 6cab0 c 2 6cab2 6 *.html L 6cab2 c 2 7816d a extensions c 2 7816c 4 Html c 2 7816b 4 name c 2 77ff3 4 Html c 1 6cabe c 0 781ac 4 c 2 781b3 2 e3 c 2 781b2 a defaultExe c 3 781b5 1 c 2 6cacc 2 e3 L 6cacc c 2 781b4 b executables c 3 781b0 1 c 2 6cac6 6 *.java L 6cac6 c 2 781af a extensions c 2 781ae 4 Java c 2 781ad 4 name c 2 77ff4 4 Java c 1 6cad0 c 0 781e6 4 c 2 781ed 2 e3 c 2 781ec a defaultExe c 3 781ef 1 c 2 6cade 2 e3 L 6cade c 2 781ee b executables c 3 781ea 1 c 2 6cad8 5 *.tex L 6cad8 c 2 781e9 a extensions c 2 781e8 5 Latex c 2 781e7 4 name c 2 77ff5 5 Latex c 1 6cae2 c 0 78220 4 c 2 78227 2 e3 c 2 78226 a defaultExe c 3 78229 1 c 2 6caed 2 e3 L 6caed c 2 78228 b executables c 3 78224 0 c 2 78223 a extensions c 2 78222 5 Other c 2 78221 4 name c 2 77ff6 5 Other c 2 77feb a categories c 0 77ff8 1 C ProjectDir 4 6cb1a c 2 6cb1b 1c netscript2/src/perl/XML/DAL/ 11 81 c 2 6cb1c 0 0 c 2 77ffa 1c netscript2/src/perl/XML/DAL/ c 2 77ff7 b directories C DmBag 5 77f14 4 c 2 77f4a d8 b C DmDictionary 0 77f16 3 C DmString 1 77f28 39 b C DmSet 0 73c22 1 C DmString 1 73db4 5 Other L 73db4 c 1 77f27 a categories c 1 77f18 6 DAL.pm c 1 77f17 4 name C DmInteger 2 77f2a 1 c 1 77f29 9 substMode c 2 77f7f de b C DmDictionary 0 77f4b 3 C DmString 1 77f5d 39 b C DmSet 0 75118 1 C DmString 1 752aa 5 Other L 752aa c 1 77f5c a categories c 1 77f4d c LibXMLDAL.pm c 1 77f4c 4 name C DmInteger 2 77f5f 1 c 1 77f5e 9 substMode c 2 77fb4 dc b C DmDictionary 0 77f80 3 C DmString 1 77f92 38 b C DmSet 0 77d67 1 C DmString 1 77f04 4 Html L 77f04 c 1 77f91 a categories c 1 77f82 b README.html c 1 77f81 4 name C DmInteger 2 77f94 1 c 1 77f93 9 substMode c 2 77fe9 df b C DmDictionary 0 77fb5 3 C DmString 1 77fc7 39 b C DmSet 0 759d7 1 C DmString 1 75b69 5 Other L 75b69 c 1 77fc6 a categories c 1 77fb7 d XMLDOM2DAL.pm c 1 77fb6 4 name C DmInteger 2 77fc9 1 c 1 77fc8 9 substMode c 2 77fea 5 files c 2 77f10 94 xterm -ls -fn -*-lucidatypewriter-medium-r-normal-*-12-* -bg gray90 -T Program -geometry 80x10+0+0 -e "[set command with 'Project->Launch Command']" c 2 77f0f 6 launch c 2 77f0c 4 make c 2 77f0b 4 make c 2 77f0e 0 c 2 77f0d 8 makeFile c 5 77f11 0 c 2 77f13 7 modules c 2 77f0a 3 DAL c 2 77f09 4 name |