Commits

Anonymous committed 2f14b3a

Modified Files:
Changes README
+ notes about version changes

LibXML.xs LibXML.pm
+ added some aliases

  • Participants
  • Parent commits 3e105c0

Comments (0)

Files changed (4)

 Revision history for Perl extension XML::LibXML
 
+*NOTE:* 
+The General DOM API changed from Version 1.40 to 1.49/1.50. Therefore
+the behaviour of some functions may have changed to previous
+versions. Make shure you read the informations on the XML::LibXML::DOM
+manpage!
+
 1.50
    - push parser interface
-   - basic native libxml2 SAX interface
+   - fixed major problems with the validating parser
    - XML::LibXML::Document::process_xincludes reintroduced
    - Class wide callbacks added 
    - code cleanings
    - fixed library tests and output in Makefile.PL
    - more documentation
-   - more tests
-   - importNode() bug fix
+   - importNode() bug fix 
    - fixed external entity loading for entity expansion
    - compatibility fixes
+   - basic native libxml2 SAX interface
+     THIS INTERFACE IS STILL EXPERIMENTAL, check XML::LibXML::SAX man page
    - cloneNode clones now within documents
 
 1.49
     if ( not exists $options{XML_LIBXML_KEEP_BLANKS} ) {
         $options{XML_LIBXML_KEEP_BLANKS} = 1;
     }
+
     my $self = bless \%options, $class;
+    if ( defined $options{Handler} ) {
+        $self->set_handler( $options{Handler} );
+    }
     return $self;
 }
 
     return $self->{XML_LIBXML_BASE_URI};
 }
 
-sub set_sax_handler {
+sub set_handler {
     my $self = shift;
-    $self->{SAX} = {HANDLER    => $_[0],
-                    NAMESPACES => {},
+    $self->{HANDLER} = $_[0];
+
+    $self->{SAX} = {NAMESPACES => {},
                     ELSTACK    => []};
 }
 
     return $result;
 }
 
+sub parse_chunk { my $self = shift; return $self->parse_xml_chunk(@_); }
+
 sub parse_xml_chunk {
     my $self = shift;
     # max 2 parameter:
     return $self->can($feature) ? 1 : 0;
 }
 
+sub getChildNodes { my $self = shift; return $self->childNodes(); }
+
 sub childNodes {
     my $self = shift;
     my @children = $self->_childNodes();
 
 sub start_document {
     my $parser = shift;
-    $parser->{SAX}->{HANDLER}->start_document({});
+    $parser->{HANDLER}->start_document({});
 }
 
 sub xml_decl {
 
     my $decl = {version => $version};
     $decl->{encoding} = $encoding if defined $encoding;
-    $parser->{SAX}->{HANDLER}->xml_decl($decl);
+    $parser->{HANDLER}->xml_decl($decl);
 }
 
 sub end_document {
     my $parser = shift;
-    $parser->{SAX}->{HANDLER}->end_document({});
+    $parser->{HANDLER}->end_document({});
 }
 
 sub start_element {
     my $saxattr = {};
     foreach my $att ( keys %attrs ) {
         next unless $att =~ /^xmlns/;
-        $parser->{SAX}->{Namespaces}->{$att} = $attrs{$att};
+        $parser->{Namespaces}->{$att} = $attrs{$att};
     }
 
     foreach my $att ( keys %attrs ) {
         $elem->{NamespaceURI} = "";
     }
     push @{$parser->{SAX}->{ELSTACK}}, $elem;
-    $parser->{SAX}->{HANDLER}->start_element( { %$elem, Attributes=>$saxattr} )
+    $parser->{HANDLER}->start_element( { %$elem, Attributes=>$saxattr} )
 
 }
 
     if ( $elem->{Name} ne $name ) {
         croak( "cought error where parser should work" );
     }
-    $parser->{SAX}->{HANDLER}->end_element( $elem );
+    $parser->{HANDLER}->end_element( $elem );
 }
 
 sub characters {
     my ( $parser, $data ) = @_;
-    $parser->{SAX}->{HANDLER}->characters( {Data => $data} );
+    $parser->{HANDLER}->characters( {Data => $data} );
 }
 
 sub comment {
     my ( $parser, $data ) = @_;
-    $parser->{SAX}->{HANDLER}->comment( {Data => $data} );
+    $parser->{HANDLER}->comment( {Data => $data} );
 }
 
 sub cdata_block {
     my ( $parser, $data ) = @_;
-    $parser->{SAX}->{HANDLER}->start_cdata();
-    $parser->{SAX}->{HANDLER}->characters( {Data => $data} );
-    $parser->{SAX}->{HANDLER}->end_cdata();
+    $parser->{HANDLER}->start_cdata();
+    $parser->{HANDLER}->characters( {Data => $data} );
+    $parser->{HANDLER}->end_cdata();
 }
 
 sub processing_instruction {
     my ( $parser, $target, $data ) = @_;
-    $parser->{SAX}->{HANDLER}->processing_instruction( {Target => $target,
-                                                        Data   => $data} );
+    $parser->{HANDLER}->processing_instruction( {Target => $target,
+                                                 Data   => $data} );
 }
 
 1;
         char * encoding
     ALIAS:
         XML::LibXML::Document::new = 1
+        XML::LibXML::createDocument = 2
     PREINIT:
         xmlDocPtr doc=NULL;
     CODE:
         RETVAL
 
 SV *
-importNode( dom, node ) 
+importNode( dom, node, dummy=0 ) 
         SV * dom
         SV * node
+        int dummy
     PREINIT:
         xmlNodePtr ret = NULL;
         xmlNodePtr real_node = NULL;
         SV * self
         int value
     CODE:
-        ((xmlDocPtr)PmmSvNode(self))->standalone = value;
+        if ( value > 0 ) {
+            ((xmlDocPtr)PmmSvNode(self))->standalone = 1;
+        }
+        else if ( value < 0 ) {
+            ((xmlDocPtr)PmmSvNode(self))->standalone = -1;
+        }
+        else {
+            ((xmlDocPtr)PmmSvNode(self))->standalone = 0;
+        }
 
 char*
 version( self ) 
         RETVAL
 
 void
-setName( pnode , value )
+setNodeName( pnode , value )
         SV * pnode
         SV* value
     ALIAS:
-        setNodeName = 1
+        setName = 1
     PREINIT:
         xmlNodePtr node = PmmSvNode(pnode);
         xmlChar* string;
         xmlNodePtr node;
         xmlChar * content = NULL;
     CODE:
-        /* this implementation is prolly b0rked!
-         * I have to go through the spec to find out what should
-         * be returned here.
-         */
-
-        xs_warn( "getDATA" );
         content = domGetNodeValue( PmmSvNode(proxy_node) ); 
         
         if ( content != NULL ) {
 and highly capable validating XML parser library, as well as
 a high performance DOM.
 
+IMPORTANT NOTE
+==============
+
+XML::LibXML was almost entirely reimplemented between version 1.40 
+to version 1.49. This may cause problems on some production machines.
+with version 1.50 a lot of compatibility fixes were applied, so 
+programs written for XML::LibXML 1.40 or less should run with 
+version 1.50 again.
+
 Installation
 ============