You can subscribe to this list here.
| 2002 |
Jan
(8) |
Feb
(22) |
Mar
(3) |
Apr
(13) |
May
(1) |
Jun
(4) |
Jul
|
Aug
(5) |
Sep
(9) |
Oct
(36) |
Nov
(7) |
Dec
(15) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(4) |
Feb
(1) |
Mar
(55) |
Apr
(25) |
May
(25) |
Jun
(4) |
Jul
(2) |
Aug
|
Sep
(12) |
Oct
(6) |
Nov
(14) |
Dec
(1) |
| 2004 |
Jan
(1) |
Feb
(8) |
Mar
(6) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(3) |
Nov
(11) |
Dec
|
| 2005 |
Jan
(14) |
Feb
(3) |
Mar
(4) |
Apr
(14) |
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(2) |
Dec
(1) |
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(19) |
Nov
(5) |
Dec
|
| 2007 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Petr P. <pa...@us...> - 2003-05-29 14:29:19
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext In directory sc8-pr-cvs1:/tmp/cvs-serv22557 Modified Files: Changes Log Message: *** empty log message *** Index: Changes =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/Changes,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Changes 21 May 2003 10:45:18 -0000 1.10 +++ Changes 29 May 2003 14:29:16 -0000 1.11 @@ -2,6 +2,10 @@ Revision history for Perl module XML::LibXML::XPathContext. +Changes after 0.04 + +* lookupNs() method added + 0.04 Wed May 21 2003 * Fixed Mac OS X compatibility problems. Now this module should work |
|
From: Petr P. <pa...@us...> - 2003-05-29 14:28:32
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext
In directory sc8-pr-cvs1:/tmp/cvs-serv22150
Modified Files:
XPathContext.xs XPathContext.pm
Log Message:
added lookupNs method
Index: XPathContext.xs
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.xs,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- XPathContext.xs 21 May 2003 10:30:15 -0000 1.34
+++ XPathContext.xs 29 May 2003 14:28:29 -0000 1.35
@@ -563,6 +563,23 @@
}
SV*
+lookupNs( pxpath_context, prefix )
+ SV * pxpath_context
+ SV * prefix
+ PREINIT:
+ xmlXPathContextPtr ctxt = NULL;
+ INIT:
+ ctxt = (xmlXPathContextPtr)SvIV(SvRV(pxpath_context));
+ if ( ctxt == NULL ) {
+ croak("XPathContext: missing xpath context");
+ }
+ xpc_LibXML_configure_xpathcontext(ctxt);
+ PPCODE:
+ RETVAL = xpc_C2Sv(xmlXPathNsLookup(ctxt, SvPV_nolen(prefix)));
+ OUTPUT:
+ RETVAL
+
+SV*
getVarLookupData( self )
SV * self
INIT:
@@ -783,9 +800,8 @@
if (found != NULL) {
nodelist = found->nodesetval;
} else {
- nodelist = NULL;
+ nodelist = NULL;
}
-
xmlFree(xpath);
sv_2mortal( xpc_LibXML_error );
@@ -832,8 +848,8 @@
/* prevent libxml2 from freeing the actual nodes */
if (found->boolval) found->boolval=0;
xmlXPathFreeObject(found);
- }
- else {
+ }
+ else {
xmlXPathFreeObject(found);
xpc_LibXML_croak_error();
}
Index: XPathContext.pm
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- XPathContext.pm 21 May 2003 12:19:38 -0000 1.27
+++ XPathContext.pm 29 May 2003 14:28:29 -0000 1.28
@@ -166,6 +166,9 @@
my $value = $xc->findvalue($xpath);
my $value = $xc->findvalue($xpath, $context_node);
+ my $namespace_uri = $xc->lookupNs($prefix);
+
+
=head1 DESCRIPTION
This module augments L<XML::LibXML|XML::LibXML> by providing Perl
|
|
From: Petr P. <pa...@us...> - 2003-05-29 14:28:32
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext/t
In directory sc8-pr-cvs1:/tmp/cvs-serv22150/t
Modified Files:
00-xpathcontext.t
Log Message:
added lookupNs method
Index: 00-xpathcontext.t
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/t/00-xpathcontext.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- 00-xpathcontext.t 21 May 2003 10:17:35 -0000 1.8
+++ 00-xpathcontext.t 29 May 2003 14:28:28 -0000 1.9
@@ -1,5 +1,5 @@
use Test;
-BEGIN { plan tests => 28 };
+BEGIN { plan tests => 30 };
use XML::LibXML;
use XML::LibXML::XPathContext;
@@ -38,11 +38,13 @@
my $xc = XML::LibXML::XPathContext->new($doc1);
$xc->registerNs('xxx', 'http://example.com/foobar');
ok($xc->findnodes('/xxx:foo')->pop->nodeName eq 'foo');
+ok($xc->lookupNs('xxx') eq '/xxx:foo');
# test unregisterNs()
$xc->unregisterNs('xxx');
eval { $xc->findnodes('/xxx:foo') };
ok($@);
+ok(!defined($xc->lookupNs('xxx')));
# test getContextNode and setContextNode
ok($xc->getContextNode->isSameNode($doc1));
|
|
From: Petr P. <pa...@us...> - 2003-05-28 09:54:17
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext
In directory sc8-pr-cvs1:/tmp/cvs-serv8009
Modified Files:
xpath.c
Log Message:
sigsegv bugfix (same done for XML::LibXML)
Index: xpath.c
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/xpath.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- xpath.c 20 May 2003 15:25:50 -0000 1.2
+++ xpath.c 28 May 2003 09:45:07 -0000 1.3
@@ -165,6 +165,7 @@
if ( tdoc != NULL ) {
/* after looking through a fragment, we need to drop the
fake document again */
+ xmlSetTreeDoc(froot,NULL);
froot->doc = NULL;
tdoc->children = NULL;
tdoc->last = NULL;
|
|
From: Ilya M. <m_...@us...> - 2003-05-21 15:33:52
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext
In directory sc8-pr-cvs1:/tmp/cvs-serv10277
Modified Files:
README
Log Message:
Updated
Index: README
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/README,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- README 30 Apr 2003 20:45:15 -0000 1.4
+++ README 21 May 2003 15:33:44 -0000 1.5
@@ -196,8 +196,6 @@
$xc->registerFunction('func', sub { $xc->findvalue('1') });
my $result = $xc->findvalue('func()');
- Currently this module doesn't work on Mac OS X.
-
AUTHORS
Based on XML::LibXML and XML::XSLT code by Matt Sergeant and Christian
Glahn.
|
|
From: Ilya M. <m_...@us...> - 2003-05-21 12:19:49
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext
In directory sc8-pr-cvs1:/tmp/cvs-serv26517
Modified Files:
XPathContext.pm
Log Message:
Cosmetic fixes
Index: XPathContext.pm
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- XPathContext.pm 21 May 2003 10:49:09 -0000 1.26
+++ XPathContext.pm 21 May 2003 12:19:38 -0000 1.27
@@ -33,9 +33,8 @@
sub find {
my ($self, $xpath, $node) = @_;
- my ($type, @params);
- ($type, @params) = $self->_guarded_find_call('_find', $xpath, $node);
+ my ($type, @params) = $self->_guarded_find_call('_find', $xpath, $node);
if ($type) {
return $type->new(@params);
|
|
From: Ilya M. <m_...@us...> - 2003-05-21 10:49:13
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext In directory sc8-pr-cvs1:/tmp/cvs-serv27428 Modified Files: XPathContext.pm Log Message: Bump version number Index: XPathContext.pm =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- XPathContext.pm 21 May 2003 10:40:59 -0000 1.25 +++ XPathContext.pm 21 May 2003 10:49:09 -0000 1.26 @@ -7,7 +7,7 @@ use XML::LibXML::NodeList; -$VERSION = '0.03'; +$VERSION = '0.04'; require DynaLoader; @ISA = qw(DynaLoader); |
|
From: Ilya M. <m_...@us...> - 2003-05-21 10:45:21
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext In directory sc8-pr-cvs1:/tmp/cvs-serv24907 Modified Files: Changes Log Message: Updated Index: Changes =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/Changes,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Changes 30 Apr 2003 20:47:53 -0000 1.9 +++ Changes 21 May 2003 10:45:18 -0000 1.10 @@ -2,6 +2,14 @@ Revision history for Perl module XML::LibXML::XPathContext. +0.04 Wed May 21 2003 + +* Fixed Mac OS X compatibility problems. Now this module should work +on this platform. + +* Fixed a bug which caused a segfault. Thanks to Steve Hay for the +bug report. + 0.03 Thu May 1 2003 * Added optional $context_node argument to findnodes(), find(), and |
|
From: Ilya M. <m_...@us...> - 2003-05-21 10:41:08
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext
In directory sc8-pr-cvs1:/tmp/cvs-serv21389
Modified Files:
XPathContext.pm
Log Message:
Remove note that this module doesn't work under Mac OS X - it is not
true anymore
Index: XPathContext.pm
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- XPathContext.pm 21 May 2003 09:15:57 -0000 1.24
+++ XPathContext.pm 21 May 2003 10:40:59 -0000 1.25
@@ -377,8 +377,6 @@
$xc->registerFunction('func', sub { $xc->findvalue('1') });
my $result = $xc->findvalue('func()');
-Currently this module doesn't work on Mac OS X.
-
=head1 AUTHORS
Based on L<XML::LibXML|XML::LibXML> and L<XML::XSLT|XML::XSLT> code by
|
|
From: Ilya M. <m_...@us...> - 2003-05-21 10:30:18
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext
In directory sc8-pr-cvs1:/tmp/cvs-serv14178
Modified Files:
XPathContext.xs
Log Message:
Simplify code of getContextNode()
Index: XPathContext.xs
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.xs,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- XPathContext.xs 21 May 2003 09:03:00 -0000 1.33
+++ XPathContext.xs 21 May 2003 10:30:15 -0000 1.34
@@ -413,9 +413,9 @@
xmlNodePtr node = xpc_PmmSvNode(XPathContextDATA(ctxt)->node);
if (node != NULL) {
- ctxt->doc = node->doc;
+ ctxt->doc = node->doc;
} else {
- ctxt->doc = NULL;
+ ctxt->doc = NULL;
}
ctxt->node = node;
@@ -508,14 +508,10 @@
if ( ctxt == NULL ) {
croak("XPathContext: missing xpath context");
}
- xpc_LibXML_configure_xpathcontext(ctxt);
CODE:
- if (ctxt->node != NULL) {
- RETVAL = xpc_PmmNodeToSv(ctxt->node,
- xpc_PmmOWNERPO( xpc_PmmPROXYNODE(ctxt->node)));
-
+ if(XPathContextDATA(ctxt)->node != NULL) {
+ RETVAL = newSVsv(XPathContextDATA(ctxt)->node);
} else {
- /* croak("XPathContext: lost context node"); */
RETVAL = &PL_sv_undef;
}
OUTPUT:
@@ -531,13 +527,13 @@
croak("XPathContext: missing xpath context");
}
PPCODE:
- if (XPathContextDATA(ctxt)->node && SvOK(XPathContextDATA(ctxt)->node)) {
+ if (XPathContextDATA(ctxt)->node != NULL) {
SvREFCNT_dec(XPathContextDATA(ctxt)->node);
}
if (SvOK(pnode)) {
- XPathContextDATA(ctxt)->node = newSVsv(pnode);
+ XPathContextDATA(ctxt)->node = newSVsv(pnode);
} else {
- XPathContextDATA(ctxt)->node = &PL_sv_undef;
+ XPathContextDATA(ctxt)->node = NULL;
}
void
|
|
From: Ilya M. <m_...@us...> - 2003-05-21 10:17:48
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext/t
In directory sc8-pr-cvs1:/tmp/cvs-serv7499
Modified Files:
00-xpathcontext.t
Log Message:
Added testcase for segfault found by Steve Hay
Index: 00-xpathcontext.t
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/t/00-xpathcontext.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- 00-xpathcontext.t 11 Apr 2003 16:39:31 -0000 1.7
+++ 00-xpathcontext.t 21 May 2003 10:17:35 -0000 1.8
@@ -1,5 +1,5 @@
use Test;
-BEGIN { plan tests => 27 };
+BEGIN { plan tests => 28 };
use XML::LibXML;
use XML::LibXML::XPathContext;
@@ -85,3 +85,15 @@
ok($xc4->findnodes('parent::*',$bar)->pop->nodeName eq 'foo');
ok($xc4->getContextNode->isSameNode($doc2->getDocumentElement));
+
+# testcase for segfault found by Steve Hay
+my $xc5 = XML::LibXML::XPathContext->new();
+$xc5->registerNs('pfx', 'http://www.foo.com');
+my $doc = XML::LibXML->new->parse_string('<foo xmlns="http://www.foo.com" />');
+$xc5->setContextNode($doc);
+$xc5->findnodes('/');
+$xc5->setContextNode(undef);
+$xc5->getContextNode();
+$xc5->setContextNode($doc);
+$xc5->findnodes('/');
+ok(1);
|
|
From: Ilya M. <m_...@us...> - 2003-05-21 09:16:13
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext
In directory sc8-pr-cvs1:/tmp/cvs-serv8650
Modified Files:
XPathContext.pm
Log Message:
Minor refactoring: move dublicated logic from find() and findnodes() to _guarded_find_call()
Index: XPathContext.pm
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- XPathContext.pm 30 Apr 2003 20:31:46 -0000 1.23
+++ XPathContext.pm 21 May 2003 09:15:57 -0000 1.24
@@ -20,20 +20,8 @@
sub findnodes {
my ($self, $xpath, $node) = @_;
- my @nodes;
- my $prev_node;
- if (ref($node)) {
- $prev_node=$self->getContextNode();
- $self->setContextNode($node);
- }
- $self->_enter;
- eval {
- @nodes = $self->_findnodes($xpath);
- };
- $self->_leave;
- $self->setContextNode($prev_node) if ref($node);
- if ($@) { die $@; }
+ my @nodes = $self->_guarded_find_call('_findnodes', $xpath, $node);
if (wantarray) {
return @nodes;
@@ -43,33 +31,42 @@
}
}
+sub find {
+ my ($self, $xpath, $node) = @_;
+ my ($type, @params);
+
+ ($type, @params) = $self->_guarded_find_call('_find', $xpath, $node);
+
+ if ($type) {
+ return $type->new(@params);
+ }
+ return undef;
+}
+
sub findvalue {
my $self = shift;
return $self->find(@_)->to_literal->value;
}
-sub find {
- my ($self, $xpath, $node) = @_;
- my ($type, @params);
+sub _guarded_find_call {
+ my ($self, $method, $xpath, $node) = @_;
my $prev_node;
if (ref($node)) {
- $prev_node=$self->getContextNode();
- $self->setContextNode($node);
+ $prev_node = $self->getContextNode();
+ $self->setContextNode($node);
}
$self->_enter;
+ my @ret;
eval {
- ($type, @params) = $self->_find($xpath);
+ @ret = $self->$method($xpath);
};
$self->_leave;
$self->setContextNode($prev_node) if ref($node);
- if ($@) { die $@; }
+ if ($@) { die $@; }
- if ($type) {
- return $type->new(@params);
- }
- return undef;
+ return @ret;
}
sub registerFunction {
|
|
From: Petr P. <pa...@us...> - 2003-05-21 09:03:04
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext
In directory sc8-pr-cvs1:/tmp/cvs-serv3383
Modified Files:
XPathContext.xs
Log Message:
uninitialized non-NULL ctxt->namespace bug fixed
Index: XPathContext.xs
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.xs,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- XPathContext.xs 20 May 2003 15:27:21 -0000 1.32
+++ XPathContext.xs 21 May 2003 09:03:00 -0000 1.33
@@ -391,6 +391,7 @@
if (ctxt->namespaces != NULL) {
xmlFree( ctxt->namespaces );
+ ctxt->namespaces = NULL;
}
if (node != NULL) {
if (node->type == XML_DOCUMENT_NODE) {
@@ -437,6 +438,8 @@
pnode = ST(1);
ctxt = xmlXPathNewContext( NULL );
+ ctxt->namespaces = NULL;
+
New(0, ctxt->user, sizeof(XPathContextData), XPathContextData);
if (ctxt->user == NULL) {
croak("XPathContext: failed to allocate proxy object");
|
|
From: Petr P. <pa...@us...> - 2003-05-20 15:27:26
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext
In directory sc8-pr-cvs1:/tmp/cvs-serv3873
Modified Files:
XPathContext.xs
Log Message:
- added xpc_ prefix to all exported symbols
- fixed handling of XPath nodesets marked with boolval=1
(only relevant for extension functions written in C)
Index: XPathContext.xs
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.xs,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- XPathContext.xs 4 Apr 2003 18:42:59 -0000 1.31
+++ XPathContext.xs 20 May 2003 15:27:21 -0000 1.32
@@ -23,15 +23,15 @@
}
#endif
-static SV * LibXML_error = NULL;
+static SV * xpc_LibXML_error = NULL;
-#define LibXML_init_error() LibXML_error = NEWSV(0, 512); \
- sv_setpvn(LibXML_error, "", 0); \
+#define xpc_LibXML_init_error() xpc_LibXML_error = NEWSV(0, 512); \
+ sv_setpvn(xpc_LibXML_error, "", 0); \
xmlSetGenericErrorFunc( NULL , \
- (xmlGenericErrorFunc)LibXML_error_handler);
+ (xmlGenericErrorFunc)xpc_LibXML_error_handler);
-#define LibXML_croak_error() if ( SvCUR( LibXML_error ) > 0 ) { \
- croak("%s",SvPV(LibXML_error, len)); \
+#define xpc_LibXML_croak_error() if ( SvCUR( xpc_LibXML_error ) > 0 ) { \
+ croak("%s",SvPV(xpc_LibXML_error, len)); \
}
struct _XPathContextData {
@@ -51,7 +51,7 @@
/* stores libxml errors into $@ */
static void
-LibXML_error_handler(void * ctxt, const char * msg, ...)
+xpc_LibXML_error_handler(void * ctxt, const char * msg, ...)
{
va_list args;
SV * sv;
@@ -62,8 +62,8 @@
sv_vsetpvfn(sv, msg, strlen(msg), &args, NULL, 0, NULL);
va_end(args);
- if (LibXML_error != NULL) {
- sv_catsv(LibXML_error, sv); /* remember the last error */
+ if (xpc_LibXML_error != NULL) {
+ sv_catsv(xpc_LibXML_error, sv); /* remember the last error */
}
else {
croak("%s",SvPV(sv, PL_na));
@@ -80,7 +80,7 @@
/* at least one reference. */
/* If pnode is NULL, only return current value for hashkey */
static SV*
-LibXML_XPathContext_pool ( xmlXPathContextPtr ctxt, int hashkey, SV * pnode ) {
+xpc_LibXML_XPathContext_pool ( xmlXPathContextPtr ctxt, int hashkey, SV * pnode ) {
SV ** value;
HV * pool;
SV * key;
@@ -115,7 +115,7 @@
/* convert perl result structures to LibXML structures */
static xmlXPathObjectPtr
-LibXML_perldata_to_LibXMLdata(xmlXPathParserContextPtr ctxt,
+xpc_LibXML_perldata_to_LibXMLdata(xmlXPathParserContextPtr ctxt,
SV* perl_result) {
if (!SvOK(perl_result)) {
return (xmlXPathObjectPtr)xmlXPathNewCString("");
@@ -137,10 +137,10 @@
if (pnode != NULL && sv_isobject(*pnode) &&
sv_derived_from(*pnode,"XML::LibXML::Node")) {
xmlXPathNodeSetAdd(ret->nodesetval,
- (xmlNodePtr)PmmSvNode(*pnode));
+ (xmlNodePtr)xpc_PmmSvNode(*pnode));
if(ctxt) {
- LibXML_XPathContext_pool(ctxt->context,
- (int) PmmSvNode(*pnode), *pnode);
+ xpc_LibXML_XPathContext_pool(ctxt->context,
+ (int) xpc_PmmSvNode(*pnode), *pnode);
}
} else {
warn("XPathContext: ignoring non-node member of a nodelist");
@@ -155,10 +155,10 @@
xmlXPathObjectPtr ret;
ret = (xmlXPathObjectPtr)xmlXPathNewNodeSet(NULL);
- tmp_node = (xmlNodePtr)PmmSvNode(perl_result);
+ tmp_node = (xmlNodePtr)xpc_PmmSvNode(perl_result);
xmlXPathNodeSetAdd(ret->nodesetval,tmp_node);
if(ctxt) {
- LibXML_XPathContext_pool(ctxt->context, (int) PmmSvNode(perl_result),
+ xpc_LibXML_XPathContext_pool(ctxt->context, (int) xpc_PmmSvNode(perl_result),
perl_result);
}
@@ -190,7 +190,7 @@
* **************************************************************** */
/* Much of the code is borrowed from Matt Sergeant's XML::LibXSLT */
static xmlXPathObjectPtr
-LibXML_generic_variable_lookup(void* varLookupData,
+xpc_LibXML_generic_variable_lookup(void* varLookupData,
const xmlChar *name,
const xmlChar *ns_uri)
{
@@ -219,8 +219,8 @@
PUSHMARK(SP);
XPUSHs( (lookup_data != NULL) ? *lookup_data : &PL_sv_undef );
- XPUSHs(sv_2mortal(C2Sv(name,NULL)));
- XPUSHs(sv_2mortal(C2Sv(ns_uri,NULL)));
+ XPUSHs(sv_2mortal(xpc_C2Sv(name,NULL)));
+ XPUSHs(sv_2mortal(xpc_C2Sv(ns_uri,NULL)));
PUTBACK ;
count = perl_call_sv(*lookup_func, G_SCALAR|G_EVAL);
@@ -232,7 +232,7 @@
}
if (count != 1) croak("XPathContext: variable lookup function returned more than one argument!");
- ret = LibXML_perldata_to_LibXMLdata(NULL, POPs);
+ ret = xpc_LibXML_perldata_to_LibXMLdata(NULL, POPs);
PUTBACK;
FREETMPS;
@@ -245,7 +245,7 @@
* **************************************************************** */
/* Much of the code is borrowed from Matt Sergeant's XML::LibXSLT */
static void
-LibXML_generic_extension_function(xmlXPathParserContextPtr ctxt, int nargs)
+xpc_LibXML_generic_extension_function(xmlXPathParserContextPtr ctxt, int nargs)
{
xmlXPathObjectPtr obj,ret;
xmlNodeSetPtr nodelist = NULL;
@@ -253,16 +253,15 @@
SV * perl_dispatch;
int i;
STRLEN len;
- ProxyNodePtr owner = NULL;
+ xpc_ProxyNodePtr owner = NULL;
SV *key;
char *strkey;
const char *function, *uri;
SV **perl_function;
- int xslt_tree = 0;
dSP;
SV * data;
- /* warn("entered LibXML_generic_extension_function for %s\n",ctxt->context->function); */
+ /* warn("entered xpc_LibXML_generic_extension_function for %s\n",ctxt->context->function); */
data = (SV *) ctxt->context->funcLookupData;
if (ctxt->context->funcLookupData == NULL || !SvROK(data) ||
SvTYPE(SvRV(data)) != SVt_PVHV) {
@@ -299,11 +298,8 @@
/* set up call to perl dispatcher function */
for (i = 0; i < nargs; i++) {
obj = (xmlXPathObjectPtr)valuePop(ctxt);
- xslt_tree = 0;
switch (obj->type) {
- case XPATH_XSLT_TREE: /* PP: what's this? */
- warn("%d's argument to %s is XPATH_XSLT_TREE",i,function);
- xslt_tree = 1; /* PP: these get destroyed (they have boolval=1) */
+ case XPATH_XSLT_TREE:
case XPATH_NODESET:
nodelist = obj->nodesetval;
if ( nodelist ) {
@@ -319,27 +315,20 @@
for( j ; j < len; j++){
tnode = nodelist->nodeTab[j];
if( tnode != NULL && tnode->doc != NULL) {
- owner = PmmOWNERPO(PmmNewNode((xmlNodePtr) tnode->doc));
+ owner = xpc_PmmOWNERPO(xpc_PmmNewNode((xmlNodePtr) tnode->doc));
} else {
owner = NULL;
}
if (tnode->type == XML_NAMESPACE_DECL) {
element = sv_newmortal();
- cls = PmmNodeTypeName( tnode );
+ cls = xpc_PmmNodeTypeName( tnode );
element = sv_setref_pv( element,
(const char *)cls,
(void *)xmlCopyNamespace((xmlNsPtr)tnode)
);
}
else {
- /* need to copy the node as libxml2 will free it */
- /* PP: I guess its only true for XSLT_TREEs */
- if (xslt_tree) {
- xmlNodePtr tnode_cpy = xmlCopyNode(tnode, 1);
- element = PmmNodeToSv(tnode_cpy, owner);
- } else {
- element = PmmNodeToSv(tnode, owner);
- }
+ element = xpc_PmmNodeToSv(tnode, owner);
}
XPUSHs( sv_2mortal(element) );
}
@@ -350,6 +339,8 @@
XPUSHs(sv_2mortal(newSVpv("XML::LibXML::NodeList", 0)));
XPUSHs(sv_2mortal(newSViv(0)));
}
+ /* prevent libxml2 from freeing the actual nodes */
+ if (obj->boolval) obj->boolval=0;
break;
case XPATH_BOOLEAN:
XPUSHs(sv_2mortal(newSVpv("XML::LibXML::Boolean", 0)));
@@ -361,12 +352,12 @@
break;
case XPATH_STRING:
XPUSHs(sv_2mortal(newSVpv("XML::LibXML::Literal", 0)));
- XPUSHs(sv_2mortal(C2Sv(obj->stringval, 0)));
+ XPUSHs(sv_2mortal(xpc_C2Sv(obj->stringval, 0)));
break;
default:
warn("Unknown XPath return type (%d) in call to {%s}%s - assuming string", obj->type, uri, function);
XPUSHs(sv_2mortal(newSVpv("XML::LibXML::Literal", 0)));
- XPUSHs(sv_2mortal(C2Sv((char*)xmlXPathCastToString(obj), 0)));
+ XPUSHs(sv_2mortal(xpc_C2Sv((char*)xmlXPathCastToString(obj), 0)));
}
xmlXPathFreeObject(obj);
}
@@ -386,7 +377,7 @@
if (count != 1) croak("XPathContext: perl-dispatcher in pm file returned more than one argument!");
- ret = LibXML_perldata_to_LibXMLdata(ctxt, POPs);
+ ret = xpc_LibXML_perldata_to_LibXMLdata(ctxt, POPs);
valuePush(ctxt, ret);
PUTBACK;
@@ -395,7 +386,7 @@
}
static void
-LibXML_configure_namespaces( xmlXPathContextPtr ctxt ) {
+xpc_LibXML_configure_namespaces( xmlXPathContextPtr ctxt ) {
xmlNodePtr node = ctxt->node;
if (ctxt->namespaces != NULL) {
@@ -417,8 +408,8 @@
}
static void
-LibXML_configure_xpathcontext( xmlXPathContextPtr ctxt ) {
- xmlNodePtr node = PmmSvNode(XPathContextDATA(ctxt)->node);
+xpc_LibXML_configure_xpathcontext( xmlXPathContextPtr ctxt ) {
+ xmlNodePtr node = xpc_PmmSvNode(XPathContextDATA(ctxt)->node);
if (node != NULL) {
ctxt->doc = node->doc;
@@ -427,7 +418,7 @@
}
ctxt->node = node;
- LibXML_configure_namespaces(ctxt);
+ xpc_LibXML_configure_namespaces(ctxt);
}
MODULE = XML::LibXML::XPathContext PACKAGE = XML::LibXML::XPathContext
@@ -462,7 +453,7 @@
xmlXPathRegisterFunc(ctxt,
(const xmlChar *) "document",
- perlDocumentFunction);
+ xpc_perlDocumentFunction);
RETVAL = NEWSV(0,0),
RETVAL = sv_setref_pv( RETVAL,
@@ -514,11 +505,11 @@
if ( ctxt == NULL ) {
croak("XPathContext: missing xpath context");
}
- LibXML_configure_xpathcontext(ctxt);
+ xpc_LibXML_configure_xpathcontext(ctxt);
CODE:
if (ctxt->node != NULL) {
- RETVAL = PmmNodeToSv(ctxt->node,
- PmmOWNERPO( PmmPROXYNODE(ctxt->node)));
+ RETVAL = xpc_PmmNodeToSv(ctxt->node,
+ xpc_PmmOWNERPO( xpc_PmmPROXYNODE(ctxt->node)));
} else {
/* croak("XPathContext: lost context node"); */
@@ -559,7 +550,7 @@
if ( ctxt == NULL ) {
croak("XPathContext: missing xpath context");
}
- LibXML_configure_xpathcontext(ctxt);
+ xpc_LibXML_configure_xpathcontext(ctxt);
PPCODE:
if(SvOK(ns_uri)) {
if(xmlXPathRegisterNs(ctxt, SvPV_nolen(prefix),
@@ -581,7 +572,7 @@
if ( ctxt == NULL ) {
croak("XPathContext: missing xpath context");
}
- LibXML_configure_xpathcontext(ctxt);
+ xpc_LibXML_configure_xpathcontext(ctxt);
CODE:
if (ctxt->varLookupData != NULL &&
SvROK((SV*)(ctxt->varLookupData)) &&
@@ -615,7 +606,7 @@
if ( ctxt == NULL ) {
croak("XPathContext: missing xpath context");
}
- LibXML_configure_xpathcontext(ctxt);
+ xpc_LibXML_configure_xpathcontext(ctxt);
if (SvOK(lookup_func)) {
if ( SvROK(lookup_func) && SvTYPE(SvRV(lookup_func)) == SVt_PVCV ) {
pfdr = newRV_inc((SV*) newAV());
@@ -637,7 +628,7 @@
}
PPCODE:
if (SvOK(lookup_func)) {
- xmlXPathRegisterVariableLookup(ctxt, LibXML_generic_variable_lookup, pfdr);
+ xmlXPathRegisterVariableLookup(ctxt, xpc_LibXML_generic_variable_lookup, pfdr);
if (ctxt->varLookupData==NULL || ctxt->varLookupData != pfdr) {
croak( "XPathContext: registration failure" );
}
@@ -664,7 +655,7 @@
if ( ctxt == NULL ) {
croak("XPathContext: missing xpath context");
}
- LibXML_configure_xpathcontext(ctxt);
+ xpc_LibXML_configure_xpathcontext(ctxt);
if ( !SvOK(func) || SvOK(func) &&
((SvROK(func) && SvTYPE(SvRV(func)) == SVt_PVCV ) || SvPOK(func))) {
if (ctxt->funcLookupData == NULL) {
@@ -708,11 +699,11 @@
if (SvOK(uri)) {
xmlXPathRegisterFuncNS(ctxt, name, SvPV(uri, len),
(SvOK(func) ?
- LibXML_generic_extension_function : NULL));
+ xpc_LibXML_generic_extension_function : NULL));
} else {
xmlXPathRegisterFunc(ctxt, name,
(SvOK(func) ?
- LibXML_generic_extension_function : NULL));
+ xpc_LibXML_generic_extension_function : NULL));
}
void
@@ -754,7 +745,8 @@
SV * perl_xpath
PREINIT:
xmlXPathContextPtr ctxt = NULL;
- ProxyNodePtr owner = NULL;
+ xpc_ProxyNodePtr owner = NULL;
+ xmlXPathObjectPtr found = NULL;
xmlNodeSetPtr nodelist = NULL;
SV * element = NULL ;
STRLEN len = 0 ;
@@ -764,11 +756,11 @@
if ( ctxt == NULL ) {
croak("XPathContext: missing xpath context");
}
- LibXML_configure_xpathcontext(ctxt);
+ xpc_LibXML_configure_xpathcontext(ctxt);
if ( ctxt->node == NULL ) {
croak("XPathContext: lost current node");
}
- xpath = nodeSv2C(perl_xpath, ctxt->node);
+ xpath = nodexpc_Sv2C(perl_xpath, ctxt->node);
if ( !(xpath && xmlStrlen(xpath)) ) {
if ( xpath )
xmlFree(xpath);
@@ -777,23 +769,28 @@
}
PPCODE:
if ( ctxt->node->doc ) {
- domNodeNormalize( xmlDocGetRootElement(ctxt->node->doc) );
+ xpc_domNodeNormalize( xmlDocGetRootElement(ctxt->node->doc) );
}
else {
- domNodeNormalize( PmmOWNER(PmmNewNode(ctxt->node)) );
+ xpc_domNodeNormalize( xpc_PmmOWNER(xpc_PmmNewNode(ctxt->node)) );
}
- LibXML_init_error();
-
+ xpc_LibXML_init_error();
PUTBACK ;
- nodelist = domXPathSelect( ctxt, xpath );
+ found = xpc_domXPathFind( ctxt, xpath );
SPAGAIN ;
+ if (found != NULL) {
+ nodelist = found->nodesetval;
+ } else {
+ nodelist = NULL;
+ }
+
xmlFree(xpath);
- sv_2mortal( LibXML_error );
- LibXML_croak_error();
+ sv_2mortal( xpc_LibXML_error );
+ xpc_LibXML_croak_error();
if ( nodelist ) {
if ( nodelist->nodeNr > 0 ) {
@@ -812,7 +809,7 @@
xmlNsPtr newns = xmlCopyNamespace((xmlNsPtr)tnode);
if ( newns != NULL ) {
element = NEWSV(0,0);
- cls = PmmNodeTypeName( tnode );
+ cls = xpc_PmmNodeTypeName( tnode );
element = sv_setref_pv( element,
(const char *)cls,
newns
@@ -824,19 +821,22 @@
}
else {
if (tnode->doc) {
- owner = PmmOWNERPO(PmmNewNode((xmlNodePtr) tnode->doc));
+ owner = xpc_PmmOWNERPO(xpc_PmmNewNode((xmlNodePtr) tnode->doc));
} else {
owner = NULL; /* self contained node */
}
- element = PmmNodeToSv(tnode, owner);
+ element = xpc_PmmNodeToSv(tnode, owner);
}
XPUSHs( sv_2mortal(element) );
}
}
- xmlXPathFreeNodeSet( nodelist );
- }
- else {
- LibXML_croak_error();
+ /* prevent libxml2 from freeing the actual nodes */
+ if (found->boolval) found->boolval=0;
+ xmlXPathFreeObject(found);
+ }
+ else {
+ xmlXPathFreeObject(found);
+ xpc_LibXML_croak_error();
}
void
@@ -845,7 +845,7 @@
SV * pxpath
PREINIT:
xmlXPathContextPtr ctxt = NULL;
- ProxyNodePtr owner = NULL;
+ xpc_ProxyNodePtr owner = NULL;
xmlXPathObjectPtr found = NULL;
xmlNodeSetPtr nodelist = NULL;
SV* element = NULL ;
@@ -856,11 +856,11 @@
if ( ctxt == NULL ) {
croak("XPathContext: missing xpath context");
}
- LibXML_configure_xpathcontext(ctxt);
+ xpc_LibXML_configure_xpathcontext(ctxt);
if ( ctxt->node == NULL ) {
croak("XPathContext: lost current node");
}
- xpath = nodeSv2C(pxpath, ctxt->node);
+ xpath = nodexpc_Sv2C(pxpath, ctxt->node);
if ( !(xpath && xmlStrlen(xpath)) ) {
if ( xpath )
xmlFree(xpath);
@@ -870,22 +870,22 @@
PPCODE:
if ( ctxt->node->doc ) {
- domNodeNormalize( xmlDocGetRootElement( ctxt->node->doc ) );
+ xpc_domNodeNormalize( xmlDocGetRootElement( ctxt->node->doc ) );
}
else {
- domNodeNormalize( PmmOWNER(PmmNewNode(ctxt->node)) );
+ xpc_domNodeNormalize( xpc_PmmOWNER(xpc_PmmNewNode(ctxt->node)) );
}
- LibXML_init_error();
+ xpc_LibXML_init_error();
PUTBACK ;
- found = domXPathFind( ctxt, xpath );
+ found = xpc_domXPathFind( ctxt, xpath );
SPAGAIN ;
xmlFree( xpath );
- sv_2mortal( LibXML_error );
- LibXML_croak_error();
+ sv_2mortal( xpc_LibXML_error );
+ xpc_LibXML_croak_error();
if (found) {
switch (found->type) {
@@ -916,7 +916,7 @@
xmlNsPtr newns = xmlCopyNamespace((xmlNsPtr)tnode);
if ( newns != NULL ) {
element = NEWSV(0,0);
- cls = PmmNodeTypeName( tnode );
+ cls = xpc_PmmNodeTypeName( tnode );
element = sv_setref_pv( element,
(const char *)cls,
(void*)newns
@@ -928,18 +928,18 @@
}
else {
if (tnode->doc) {
- owner = PmmOWNERPO(PmmNewNode((xmlNodePtr) tnode->doc));
+ owner = xpc_PmmOWNERPO(xpc_PmmNewNode((xmlNodePtr) tnode->doc));
} else {
owner = NULL; /* self contained node */
}
- element = PmmNodeToSv(tnode, owner);
+ element = xpc_PmmNodeToSv(tnode, owner);
}
XPUSHs( sv_2mortal(element) );
}
}
- xmlXPathFreeNodeSet( found->nodesetval );
- found->nodesetval = NULL;
}
+ /* prevent libxml2 from freeing the actual nodes */
+ if (found->boolval) found->boolval=0;
break;
case XPATH_BOOLEAN:
/* return as a Boolean */
@@ -957,7 +957,7 @@
/* access ->stringval */
/* return as a Literal */
XPUSHs(sv_2mortal(newSVpv("XML::LibXML::Literal", 0)));
- XPUSHs(sv_2mortal(C2Sv(found->stringval, NULL)));
+ XPUSHs(sv_2mortal(xpc_C2Sv(found->stringval, NULL)));
break;
default:
croak("Unknown XPath return type");
@@ -965,5 +965,5 @@
xmlXPathFreeObject(found);
}
else {
- LibXML_croak_error();
+ xpc_LibXML_croak_error();
}
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext
In directory sc8-pr-cvs1:/tmp/cvs-serv2917
Modified Files:
xpath.h xpath.c perl-libxml-sax.h perl-libxml-sax.c
perl-libxml-mm.h perl-libxml-mm.c dom.h dom.c
Log Message:
added xpc_ prefix to all exported symbols
Index: xpath.h
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/xpath.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- xpath.h 14 Mar 2003 14:32:02 -0000 1.1.1.1
+++ xpath.h 20 May 2003 15:25:50 -0000 1.2
@@ -5,12 +5,12 @@
#include <libxml/xpath.h>
void
-perlDocumentFunction( xmlXPathParserContextPtr ctxt, int nargs );
+xpc_perlDocumentFunction( xmlXPathParserContextPtr ctxt, int nargs );
xmlNodeSetPtr
-domXPathSelect( xmlXPathContextPtr ctxt, xmlChar * xpathstring );
+xpc_domXPathSelect( xmlXPathContextPtr ctxt, xmlChar * xpathstring );
xmlXPathObjectPtr
-domXPathFind( xmlXPathContextPtr ctxt, xmlChar * xpathstring );
+xpc_domXPathFind( xmlXPathContextPtr ctxt, xmlChar * xpathstring );
#endif
Index: xpath.c
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/xpath.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- xpath.c 14 Mar 2003 14:32:00 -0000 1.1.1.1
+++ xpath.c 20 May 2003 15:25:50 -0000 1.2
@@ -8,7 +8,7 @@
#include "dom.h"
void
-perlDocumentFunction(xmlXPathParserContextPtr ctxt, int nargs){
+xpc_perlDocumentFunction(xmlXPathParserContextPtr ctxt, int nargs){
xmlXPathObjectPtr obj = NULL, obj2 = NULL;
xmlChar *base = NULL, *URI = NULL;
@@ -48,7 +48,7 @@
valuePush(ctxt,
xmlXPathNewNodeSet(obj->nodesetval->nodeTab[i]));
}
- perlDocumentFunction(ctxt, 2);
+ xpc_perlDocumentFunction(ctxt, 2);
newobj = valuePop(ctxt);
ret->nodesetval = xmlXPathNodeSetMerge(ret->nodesetval,
newobj->nodesetval);
@@ -124,7 +124,7 @@
**/
xmlXPathObjectPtr
-domXPathFind( xmlXPathContextPtr ctxt, xmlChar * path ) {
+xpc_domXPathFind( xmlXPathContextPtr ctxt, xmlChar * path ) {
xmlXPathObjectPtr res = NULL;
if ( ctxt->node != NULL && path != NULL ) {
@@ -178,11 +178,11 @@
}
xmlNodeSetPtr
-domXPathSelect( xmlXPathContextPtr ctxt, xmlChar * path ) {
+xpc_domXPathSelect( xmlXPathContextPtr ctxt, xmlChar * path ) {
xmlNodeSetPtr rv = NULL;
xmlXPathObjectPtr res = NULL;
- res = domXPathFind( ctxt, path );
+ res = xpc_domXPathFind( ctxt, path );
if (res != NULL) {
/* here we have to transfer the result from the internal
Index: perl-libxml-sax.h
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/perl-libxml-sax.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- perl-libxml-sax.h 14 Mar 2003 14:32:02 -0000 1.1.1.1
+++ perl-libxml-sax.h 20 May 2003 15:25:50 -0000 1.2
@@ -18,15 +18,15 @@
/* has to be called in BOOT sequence */
void
-PmmSAXInitialize();
+xpc_PmmSAXInitialize();
void
-PmmSAXInitContext( xmlParserCtxtPtr ctxt, SV * parser );
+xpc_PmmSAXInitContext( xmlParserCtxtPtr ctxt, SV * parser );
void
-PmmSAXCloseContext( xmlParserCtxtPtr ctxt );
+xpc_PmmSAXCloseContext( xmlParserCtxtPtr ctxt );
xmlSAXHandlerPtr
-PSaxGetHandler();
+xpc_PSaxGetHandler();
#endif
Index: perl-libxml-sax.c
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/perl-libxml-sax.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- perl-libxml-sax.c 14 Mar 2003 14:32:03 -0000 1.1.1.1
+++ perl-libxml-sax.c 20 May 2003 15:25:50 -0000 1.2
@@ -35,9 +35,9 @@
xmlSAXLocator * locator;
xmlDocPtr ns_stack_root;
SV * handler;
-} PmmSAXVector;
+} xpc_PmmSAXVector;
-typedef PmmSAXVector* PmmSAXVectorPtr;
+typedef xpc_PmmSAXVector* xpc_PmmSAXVectorPtr;
static U32 PrefixHash; /* pre-computed */
static U32 NsURIHash;
@@ -50,12 +50,12 @@
static U32 VersionHash;
static U32 EncodingHash;
-/* helper function C2Sv is ment to work faster than the perl-libxml-mm
+/* helper function xpc_C2Sv is ment to work faster than the perl-libxml-mm
version. this shortcut is usefull, because SAX handles only UTF8
strings, so there is no conversion logic required.
*/
SV*
-_C2Sv( const xmlChar *string, const xmlChar *dummy )
+_xpc_C2Sv( const xmlChar *string, const xmlChar *dummy )
{
dTHX;
@@ -77,7 +77,7 @@
}
void
-PmmSAXInitialize()
+xpc_PmmSAXInitialize()
{
PERL_HASH(PrefixHash, "Prefix", 6);
PERL_HASH(NsURIHash, "NamespaceURI", 12);
@@ -91,18 +91,18 @@
PERL_HASH(EncodingHash, "Encoding", 8);
}
-xmlSAXHandlerPtr PSaxGetHandler();
+xmlSAXHandlerPtr xpc_PSaxGetHandler();
void
-PmmSAXInitContext( xmlParserCtxtPtr ctxt, SV * parser )
+xpc_PmmSAXInitContext( xmlParserCtxtPtr ctxt, SV * parser )
{
xmlNodePtr ns_stack = NULL;
- PmmSAXVectorPtr vec = NULL;
+ xpc_PmmSAXVectorPtr vec = NULL;
SV ** th;
dTHX;
- vec = (PmmSAXVector*) xmlMalloc( sizeof(PmmSAXVector) );
+ vec = (xpc_PmmSAXVector*) xmlMalloc( sizeof(xpc_PmmSAXVector) );
vec->ns_stack_root = xmlNewDoc(NULL);
vec->ns_stack = xmlNewDocNode(vec->ns_stack_root,
@@ -126,15 +126,15 @@
if ( ctxt->sax ) {
xmlFree( ctxt->sax );
}
- ctxt->sax = PSaxGetHandler();
+ ctxt->sax = xpc_PSaxGetHandler();
ctxt->_private = (void*)vec;
}
void
-PmmSAXCloseContext( xmlParserCtxtPtr ctxt )
+xpc_PmmSAXCloseContext( xmlParserCtxtPtr ctxt )
{
- PmmSAXVector * vec = (PmmSAXVectorPtr) ctxt->_private;
+ xpc_PmmSAXVector * vec = (xpc_PmmSAXVectorPtr) ctxt->_private;
dTHX;
if ( vec->handler != NULL ) {
@@ -156,7 +156,7 @@
xmlNsPtr
-PmmGetNsMapping( xmlNodePtr ns_stack, const xmlChar * prefix )
+xpc_PmmGetNsMapping( xmlNodePtr ns_stack, const xmlChar * prefix )
{
if ( ns_stack != NULL ) {
return xmlSearchNs( ns_stack->doc, ns_stack, prefix );
@@ -167,7 +167,7 @@
void
-PSaxStartPrefix( PmmSAXVectorPtr sax, const xmlChar * prefix,
+xpc_PSaxStartPrefix( xpc_PmmSAXVectorPtr sax, const xmlChar * prefix,
const xmlChar * uri, SV * handler )
{
dTHX;
@@ -182,15 +182,15 @@
param = newHV();
hv_store(param, "NamespaceURI", 12,
- _C2Sv(uri, NULL), NsURIHash);
+ _xpc_C2Sv(uri, NULL), NsURIHash);
if ( prefix != NULL ) {
hv_store(param, "Prefix", 6,
- _C2Sv(prefix, NULL), PrefixHash);
+ _xpc_C2Sv(prefix, NULL), PrefixHash);
}
else {
hv_store(param, "Prefix", 6,
- _C2Sv((const xmlChar*)"", NULL), PrefixHash);
+ _xpc_C2Sv((const xmlChar*)"", NULL), PrefixHash);
}
PUSHMARK(SP) ;
@@ -213,7 +213,7 @@
}
void
-PSaxEndPrefix( PmmSAXVectorPtr sax, const xmlChar * prefix,
+xpc_PSaxEndPrefix( xpc_PmmSAXVectorPtr sax, const xmlChar * prefix,
const xmlChar * uri, SV * handler )
{
dTHX;
@@ -226,15 +226,15 @@
SAVETMPS;
param = newHV();
hv_store(param, "NamespaceURI", 12,
- _C2Sv(uri, NULL), NsURIHash);
+ _xpc_C2Sv(uri, NULL), NsURIHash);
if ( prefix != NULL ) {
hv_store(param, "Prefix", 6,
- _C2Sv(prefix, NULL), PrefixHash);
+ _xpc_C2Sv(prefix, NULL), PrefixHash);
}
else {
hv_store(param, "Prefix", 6,
- _C2Sv((const xmlChar *)"", NULL), PrefixHash);
+ _xpc_C2Sv((const xmlChar *)"", NULL), PrefixHash);
}
PUSHMARK(SP) ;
@@ -259,7 +259,7 @@
}
void
-PmmExtendNsStack( PmmSAXVectorPtr sax , const xmlChar * name) {
+xpc_PmmExtendNsStack( xpc_PmmSAXVectorPtr sax , const xmlChar * name) {
xmlNodePtr newNS = NULL;
xmlChar * localname = NULL;
xmlChar * prefix = NULL;
@@ -294,14 +294,14 @@
}
void
-PmmNarrowNsStack( PmmSAXVectorPtr sax, SV *handler )
+xpc_PmmNarrowNsStack( xpc_PmmSAXVectorPtr sax, SV *handler )
{
xmlNodePtr parent = sax->ns_stack->parent;
xmlNsPtr list = sax->ns_stack->nsDef;
while ( list ) {
if ( !xmlStrEqual(list->prefix, (const xmlChar*)"xml") ) {
- PSaxEndPrefix( sax, list->prefix, list->href, handler );
+ xpc_PSaxEndPrefix( sax, list->prefix, list->href, handler );
}
list = list->next;
}
@@ -311,7 +311,7 @@
}
void
-PmmAddNamespace( PmmSAXVectorPtr sax, const xmlChar * name,
+xpc_PmmAddNamespace( xpc_PmmSAXVectorPtr sax, const xmlChar * name,
const xmlChar * href, SV *handler)
{
xmlNsPtr ns = NULL;
@@ -349,11 +349,11 @@
xmlFree( localname );
}
- PSaxStartPrefix( sax, name, href, handler );
+ xpc_PSaxStartPrefix( sax, name, href, handler );
}
HV *
-PmmGenElementSV( pTHX_ PmmSAXVectorPtr sax, const xmlChar * name )
+xpc_PmmGenElementSV( pTHX_ xpc_PmmSAXVectorPtr sax, const xmlChar * name )
{
HV * retval = newHV();
SV * tmp;
@@ -362,7 +362,7 @@
if ( name != NULL && xmlStrlen( name ) ) {
hv_store(retval, "Name", 4,
- _C2Sv(name, NULL), NameHash);
+ _xpc_C2Sv(name, NULL), NameHash);
if ( sax->ns_stack->ns != NULL ) {
ns = sax->ns_stack->ns;
@@ -370,26 +370,26 @@
if ( ns != NULL ) {
hv_store(retval, "NamespaceURI", 12,
- _C2Sv(ns->href, NULL), NsURIHash);
+ _xpc_C2Sv(ns->href, NULL), NsURIHash);
if ( ns->prefix ) {
hv_store(retval, "Prefix", 6,
- _C2Sv(ns->prefix, NULL), PrefixHash);
+ _xpc_C2Sv(ns->prefix, NULL), PrefixHash);
}
else {
hv_store(retval, "Prefix", 6,
- _C2Sv((const xmlChar *)"",NULL), PrefixHash);
+ _xpc_C2Sv((const xmlChar *)"",NULL), PrefixHash);
}
hv_store(retval, "LocalName", 9,
- _C2Sv(sax->ns_stack->name, NULL), LocalNameHash);
+ _xpc_C2Sv(sax->ns_stack->name, NULL), LocalNameHash);
}
else {
hv_store(retval, "NamespaceURI", 12,
- _C2Sv((const xmlChar *)"",NULL), NsURIHash);
+ _xpc_C2Sv((const xmlChar *)"",NULL), NsURIHash);
hv_store(retval, "Prefix", 6,
- _C2Sv((const xmlChar *)"",NULL), PrefixHash);
+ _xpc_C2Sv((const xmlChar *)"",NULL), PrefixHash);
hv_store(retval, "LocalName", 9,
- _C2Sv(name, NULL), LocalNameHash);
+ _xpc_C2Sv(name, NULL), LocalNameHash);
}
}
@@ -397,7 +397,7 @@
}
xmlChar *
-PmmGenNsName( const xmlChar * name, const xmlChar * nsURI )
+xpc_PmmGenNsName( const xmlChar * name, const xmlChar * nsURI )
{
int namelen = 0;
int urilen = 0;
@@ -419,7 +419,7 @@
}
HV *
-PmmGenAttributeHashSV( pTHX_ PmmSAXVectorPtr sax,
+xpc_PmmGenAttributeHashSV( pTHX_ xpc_PmmSAXVectorPtr sax,
const xmlChar **attr, SV * handler )
{
HV * retval = NULL;
@@ -450,59 +450,59 @@
localname = xmlSplitQName(NULL, name, &prefix);
hv_store(atV, "Name", 4,
- _C2Sv(name, NULL), NameHash);
+ _xpc_C2Sv(name, NULL), NameHash);
if ( value != NULL ) {
hv_store(atV, "Value", 5,
- _C2Sv(value, NULL), ValueHash);
+ _xpc_C2Sv(value, NULL), ValueHash);
}
if ( xmlStrEqual( (const xmlChar *)"xmlns", name ) ) {
/* a default namespace */
- PmmAddNamespace( sax, NULL, value, handler);
+ xpc_PmmAddNamespace( sax, NULL, value, handler);
nsURI = (const xmlChar*)NSDEFAULTURI;
hv_store(atV, "Prefix", 6,
- _C2Sv(name, NULL), PrefixHash);
+ _xpc_C2Sv(name, NULL), PrefixHash);
hv_store(atV, "LocalName", 9,
- _C2Sv((const xmlChar *)"",NULL), LocalNameHash);
+ _xpc_C2Sv((const xmlChar *)"",NULL), LocalNameHash);
hv_store(atV, "NamespaceURI", 12,
- _C2Sv((const xmlChar *)NSDEFAULTURI,NULL),
+ _xpc_C2Sv((const xmlChar *)NSDEFAULTURI,NULL),
NsURIHash);
}
else if (xmlStrncmp((const xmlChar *)"xmlns:", name, 6 ) == 0 ) {
- PmmAddNamespace( sax,
+ xpc_PmmAddNamespace( sax,
localname,
value,
handler);
hv_store(atV, "Prefix", 6,
- _C2Sv(prefix, NULL), PrefixHash);
+ _xpc_C2Sv(prefix, NULL), PrefixHash);
hv_store(atV, "LocalName", 9,
- _C2Sv(localname, NULL), LocalNameHash);
+ _xpc_C2Sv(localname, NULL), LocalNameHash);
hv_store(atV, "NamespaceURI", 12,
- _C2Sv((const xmlChar *)NSDEFAULTURI,NULL),
+ _xpc_C2Sv((const xmlChar *)NSDEFAULTURI,NULL),
NsURIHash);
}
else if ( prefix != NULL
- && (ns = PmmGetNsMapping( sax->ns_stack, prefix ) ) ) {
+ && (ns = xpc_PmmGetNsMapping( sax->ns_stack, prefix ) ) ) {
hv_store(atV, "NamespaceURI", 12,
- _C2Sv(ns->href, NULL), NsURIHash);
+ _xpc_C2Sv(ns->href, NULL), NsURIHash);
hv_store(atV, "Prefix", 6,
- _C2Sv(ns->prefix, NULL), PrefixHash);
+ _xpc_C2Sv(ns->prefix, NULL), PrefixHash);
hv_store(atV, "LocalName", 9,
- _C2Sv(localname, NULL), LocalNameHash);
+ _xpc_C2Sv(localname, NULL), LocalNameHash);
}
else {
hv_store(atV, "NamespaceURI", 12,
- _C2Sv((const xmlChar *)"", NULL), NsURIHash);
+ _xpc_C2Sv((const xmlChar *)"", NULL), NsURIHash);
hv_store(atV, "Prefix", 6,
- _C2Sv((const xmlChar *)"", NULL), PrefixHash);
+ _xpc_C2Sv((const xmlChar *)"", NULL), PrefixHash);
hv_store(atV, "LocalName", 9,
- _C2Sv(name, NULL), LocalNameHash);
+ _xpc_C2Sv(name, NULL), LocalNameHash);
}
- keyname = PmmGenNsName( localname != NULL ? localname : name,
+ keyname = xpc_PmmGenNsName( localname != NULL ? localname : name,
nsURI );
len = xmlStrlen( keyname );
@@ -533,20 +533,20 @@
}
HV *
-PmmGenCharDataSV( pTHX_ PmmSAXVectorPtr sax, const xmlChar * data )
+xpc_PmmGenCharDataSV( pTHX_ xpc_PmmSAXVectorPtr sax, const xmlChar * data )
{
HV * retval = newHV();
if ( data != NULL && xmlStrlen( data ) ) {
hv_store(retval, "Data", 4,
- _C2Sv(data, NULL), DataHash);
+ _xpc_C2Sv(data, NULL), DataHash);
}
return retval;
}
HV *
-PmmGenPISV( pTHX_ PmmSAXVectorPtr sax,
+xpc_PmmGenPISV( pTHX_ xpc_PmmSAXVectorPtr sax,
const xmlChar * target,
const xmlChar * data )
{
@@ -554,15 +554,15 @@
if ( target != NULL && xmlStrlen( target ) ) {
hv_store(retval, "Target", 6,
- _C2Sv(target, NULL), TargetHash);
+ _xpc_C2Sv(target, NULL), TargetHash);
if ( data != NULL && xmlStrlen( data ) ) {
hv_store(retval, "Data", 4,
- _C2Sv(data, NULL), DataHash);
+ _xpc_C2Sv(data, NULL), DataHash);
}
else {
hv_store(retval, "Data", 4,
- _C2Sv((const xmlChar *)"", NULL), DataHash);
+ _xpc_C2Sv((const xmlChar *)"", NULL), DataHash);
}
}
@@ -570,10 +570,10 @@
}
int
-PSaxStartDocument(void * ctx)
+xpc_PSaxStartDocument(void * ctx)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
- PmmSAXVectorPtr sax = (PmmSAXVectorPtr)ctxt->_private;
+ xpc_PmmSAXVectorPtr sax = (xpc_PmmSAXVectorPtr)ctxt->_private;
int count = 0;
dTHX;
HV* empty;
@@ -610,16 +610,16 @@
empty = newHV();
if ( ctxt->version != NULL ) {
hv_store(empty, "Version", 7,
- _C2Sv(ctxt->version, NULL), VersionHash);
+ _xpc_C2Sv(ctxt->version, NULL), VersionHash);
}
else {
hv_store(empty, "Version", 7,
- _C2Sv((const xmlChar *)"1.0", NULL), VersionHash);
+ _xpc_C2Sv((const xmlChar *)"1.0", NULL), VersionHash);
}
if ( ctxt->encoding != NULL ) {
hv_store(empty, "Encoding", 8,
- _C2Sv(ctxt->encoding, NULL), EncodingHash);
+ _xpc_C2Sv(ctxt->encoding, NULL), EncodingHash);
}
rv = newRV_noinc((SV*)empty);
@@ -643,10 +643,10 @@
}
int
-PSaxEndDocument(void * ctx)
+xpc_PSaxEndDocument(void * ctx)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
- PmmSAXVectorPtr sax = (PmmSAXVectorPtr)ctxt->_private;
+ xpc_PmmSAXVectorPtr sax = (xpc_PmmSAXVectorPtr)ctxt->_private;
int count = 0;
dTHX;
@@ -673,10 +673,10 @@
}
int
-PSaxStartElement(void *ctx, const xmlChar * name, const xmlChar** attr)
+xpc_PSaxStartElement(void *ctx, const xmlChar * name, const xmlChar** attr)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
- PmmSAXVectorPtr sax = (PmmSAXVectorPtr)ctxt->_private;
+ xpc_PmmSAXVectorPtr sax = (xpc_PmmSAXVectorPtr)ctxt->_private;
int count = 0;
dTHX;
HV * attrhash = NULL;
@@ -690,10 +690,10 @@
ENTER;
SAVETMPS;
- PmmExtendNsStack(sax, name);
+ xpc_PmmExtendNsStack(sax, name);
- attrhash = PmmGenAttributeHashSV(aTHX_ sax, attr, handler );
- element = PmmGenElementSV(aTHX_ sax, name);
+ attrhash = xpc_PmmGenAttributeHashSV(aTHX_ sax, attr, handler );
+ element = xpc_PmmGenElementSV(aTHX_ sax, name);
arv = newRV_noinc((SV*)attrhash);
hv_store( element,
@@ -726,9 +726,9 @@
}
int
-PSaxEndElement(void *ctx, const xmlChar * name) {
+xpc_PSaxEndElement(void *ctx, const xmlChar * name) {
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
- PmmSAXVectorPtr sax = (PmmSAXVectorPtr)ctxt->_private;
+ xpc_PmmSAXVectorPtr sax = (xpc_PmmSAXVectorPtr)ctxt->_private;
dTHX;
int count;
SV * handler = sax->handler;
@@ -743,7 +743,7 @@
PUSHMARK(SP) ;
XPUSHs(handler);
- element = PmmGenElementSV(aTHX_ sax, name);
+ element = xpc_PmmGenElementSV(aTHX_ sax, name);
rv = newRV_noinc((SV*)element);
XPUSHs(rv);
@@ -761,15 +761,15 @@
FREETMPS ;
LEAVE ;
- PmmNarrowNsStack(sax, handler);
+ xpc_PmmNarrowNsStack(sax, handler);
return 1;
}
int
-PSaxCharacters(void *ctx, const xmlChar * ch, int len) {
+xpc_PSaxCharacters(void *ctx, const xmlChar * ch, int len) {
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
- PmmSAXVectorPtr sax = (PmmSAXVectorPtr)ctxt->_private;
+ xpc_PmmSAXVectorPtr sax = (xpc_PmmSAXVectorPtr)ctxt->_private;
int count = 0;
dTHX;
HV* element;
@@ -794,7 +794,7 @@
PUSHMARK(SP) ;
XPUSHs(handler);
- element = PmmGenCharDataSV(aTHX_ sax,data);
+ element = xpc_PmmGenCharDataSV(aTHX_ sax,data);
rv = newRV_noinc((SV*)element);
XPUSHs(rv);
PUTBACK;
@@ -818,9 +818,9 @@
}
int
-PSaxComment(void *ctx, const xmlChar * ch) {
+xpc_PSaxComment(void *ctx, const xmlChar * ch) {
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
- PmmSAXVectorPtr sax = (PmmSAXVectorPtr)ctxt->_private;
+ xpc_PmmSAXVectorPtr sax = (xpc_PmmSAXVectorPtr)ctxt->_private;
int count = 0;
dTHX;
HV* element;
@@ -838,7 +838,7 @@
PUSHMARK(SP) ;
XPUSHs(handler);
- element = PmmGenCharDataSV(aTHX_ sax,data);
+ element = xpc_PmmGenCharDataSV(aTHX_ sax,data);
rv = newRV_noinc((SV*)element);
XPUSHs(rv);
PUTBACK;
@@ -862,9 +862,9 @@
}
int
-PSaxCDATABlock(void *ctx, const xmlChar * ch, int len) {
+xpc_PSaxCDATABlock(void *ctx, const xmlChar * ch, int len) {
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
- PmmSAXVectorPtr sax = (PmmSAXVectorPtr)ctxt->_private;
+ xpc_PmmSAXVectorPtr sax = (xpc_PmmSAXVectorPtr)ctxt->_private;
int count = 0;
dTHX;
@@ -895,7 +895,7 @@
PUSHMARK(SP) ;
XPUSHs(handler);
- element = PmmGenCharDataSV(aTHX_ sax,data);
+ element = xpc_PmmGenCharDataSV(aTHX_ sax,data);
rv = newRV_noinc((SV*)element);
XPUSHs(rv);
PUTBACK;
@@ -933,10 +933,10 @@
}
int
-PSaxProcessingInstruction( void * ctx, const xmlChar * target, const xmlChar * data )
+xpc_PSaxProcessingInstruction( void * ctx, const xmlChar * target, const xmlChar * data )
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
- PmmSAXVectorPtr sax = (PmmSAXVectorPtr)ctxt->_private;
+ xpc_PmmSAXVectorPtr sax = (xpc_PmmSAXVectorPtr)ctxt->_private;
int count = 0;
dTHX;
HV* empty = newHV();
@@ -953,7 +953,7 @@
PUSHMARK(SP) ;
XPUSHs(handler);
- element = (SV*)PmmGenPISV(aTHX_ sax, (const xmlChar *)target, data);
+ element = (SV*)xpc_PmmGenPISV(aTHX_ sax, (const xmlChar *)target, data);
rv = newRV_noinc((SV*)element);
XPUSHs(rv);
@@ -976,10 +976,10 @@
}
int
-PmmSaxWarning(void * ctx, const char * msg, ...)
+xpc_PmmSaxWarning(void * ctx, const char * msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
- PmmSAXVectorPtr sax = (PmmSAXVectorPtr)ctxt->_private;
+ xpc_PmmSAXVectorPtr sax = (xpc_PmmSAXVectorPtr)ctxt->_private;
va_list args;
SV * svMessage;
@@ -1025,10 +1025,10 @@
int
-PmmSaxError(void * ctx, const char * msg, ...)
+xpc_PmmSaxError(void * ctx, const char * msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
- PmmSAXVectorPtr sax = (PmmSAXVectorPtr)ctxt->_private;
+ xpc_PmmSAXVectorPtr sax = (xpc_PmmSAXVectorPtr)ctxt->_private;
va_list args;
SV * svMessage;
@@ -1067,10 +1067,10 @@
int
-PmmSaxFatalError(void * ctx, const char * msg, ...)
+xpc_PmmSaxFatalError(void * ctx, const char * msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)ctx;
- PmmSAXVectorPtr sax = (PmmSAXVectorPtr)ctxt->_private;
+ xpc_PmmSAXVectorPtr sax = (xpc_PmmSAXVectorPtr)ctxt->_private;
va_list args;
SV * svMessage;
@@ -1111,33 +1111,33 @@
* XML::LibXML::SAX instead!
*/
xmlSAXHandlerPtr
-PSaxGetHandler()
+xpc_PSaxGetHandler()
{
xmlSAXHandlerPtr retval = (xmlSAXHandlerPtr)xmlMalloc(sizeof(xmlSAXHandler));
memset(retval, 0, sizeof(xmlSAXHandler));
- retval->startDocument = (startDocumentSAXFunc)&PSaxStartDocument;
+ retval->startDocument = (startDocumentSAXFunc)&xpc_PSaxStartDocument;
/* libxml2 will not handle perls returnvalue correctly, so we have
* to end the document ourselfes
*/
- retval->endDocument = NULL; /* (endDocumentSAXFunc)&PSaxEndDocument; */
+ retval->endDocument = NULL; /* (endDocumentSAXFunc)&xpc_PSaxEndDocument; */
- retval->startElement = (startElementSAXFunc)&PSaxStartElement;
- retval->endElement = (endElementSAXFunc)&PSaxEndElement;
+ retval->startElement = (startElementSAXFunc)&xpc_PSaxStartElement;
+ retval->endElement = (endElementSAXFunc)&xpc_PSaxEndElement;
- retval->characters = (charactersSAXFunc)&PSaxCharacters;
- retval->ignorableWhitespace = (ignorableWhitespaceSAXFunc)&PSaxCharacters;
+ retval->characters = (charactersSAXFunc)&xpc_PSaxCharacters;
+ retval->ignorableWhitespace = (ignorableWhitespaceSAXFunc)&xpc_PSaxCharacters;
- retval->comment = (commentSAXFunc)&PSaxComment;
- retval->cdataBlock = (cdataBlockSAXFunc)&PSaxCDATABlock;
+ retval->comment = (commentSAXFunc)&xpc_PSaxComment;
+ retval->cdataBlock = (cdataBlockSAXFunc)&xpc_PSaxCDATABlock;
- retval->processingInstruction = (processingInstructionSAXFunc)&PSaxProcessingInstruction;
+ retval->processingInstruction = (processingInstructionSAXFunc)&xpc_PSaxProcessingInstruction;
/* warning functions should be internal */
- retval->warning = (warningSAXFunc)&PmmSaxWarning;
- retval->error = (errorSAXFunc)&PmmSaxError;
- retval->fatalError = (fatalErrorSAXFunc)&PmmSaxFatalError;
+ retval->warning = (warningSAXFunc)&xpc_PmmSaxWarning;
+ retval->error = (errorSAXFunc)&xpc_PmmSaxError;
+ retval->fatalError = (fatalErrorSAXFunc)&xpc_PmmSaxFatalError;
return retval;
}
Index: perl-libxml-mm.h
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/perl-libxml-mm.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- perl-libxml-mm.h 14 Mar 2003 14:32:03 -0000 1.1.1.1
+++ perl-libxml-mm.h 20 May 2003 15:25:50 -0000 1.2
@@ -45,7 +45,7 @@
#define xs_warn(string)
#endif
-struct _ProxyNode {
+struct _xpc_ProxyNode {
xmlNodePtr node;
xmlNodePtr owner;
int count;
@@ -53,38 +53,38 @@
};
/* helper type for the proxy structure */
-typedef struct _ProxyNode ProxyNode;
+typedef struct _xpc_ProxyNode xpc_ProxyNode;
/* pointer to the proxy structure */
-typedef ProxyNode* ProxyNodePtr;
+typedef xpc_ProxyNode* xpc_ProxyNodePtr;
/* this my go only into the header used by the xs */
-#define SvPROXYNODE(x) ((ProxyNodePtr)SvIV(SvRV(x)))
-#define PmmPROXYNODE(x) ((ProxyNodePtr)x->_private)
+#define SvPROXYNODE(x) ((xpc_ProxyNodePtr)SvIV(SvRV(x)))
+#define xpc_PmmPROXYNODE(x) ((xpc_ProxyNodePtr)x->_private)
-#define PmmREFCNT(node) node->count
-#define PmmREFCNT_inc(node) node->count++
-#define PmmNODE(xnode) xnode->node
-#define PmmOWNER(node) node->owner
-#define PmmOWNERPO(node) ((node && PmmOWNER(node)) ? (ProxyNodePtr)PmmOWNER(node)->_private : node)
-#define PmmENCODING(node) node->encoding
+#define xpc_PmmREFCNT(node) node->count
+#define xpc_PmmREFCNT_inc(node) node->count++
+#define xpc_PmmNODE(xnode) xnode->node
+#define xpc_PmmOWNER(node) node->owner
+#define xpc_PmmOWNERPO(node) ((node && xpc_PmmOWNER(node)) ? (xpc_ProxyNodePtr)xpc_PmmOWNER(node)->_private : node)
+#define xpc_PmmENCODING(node) node->encoding
-ProxyNodePtr
-PmmNewNode(xmlNodePtr node);
+xpc_ProxyNodePtr
+xpc_PmmNewNode(xmlNodePtr node);
-ProxyNodePtr
-PmmNewFragment(xmlDocPtr document);
+xpc_ProxyNodePtr
+xpc_PmmNewFragment(xmlDocPtr document);
SV*
-PmmCreateDocNode( unsigned int type, ProxyNodePtr pdoc, ...);
+xpc_PmmCreateDocNode( unsigned int type, xpc_ProxyNodePtr pdoc, ...);
int
-PmmREFCNT_dec( ProxyNodePtr node );
+xpc_PmmREFCNT_dec( xpc_ProxyNodePtr node );
SV*
-PmmNodeToSv( xmlNodePtr node, ProxyNodePtr owner );
+xpc_PmmNodeToSv( xmlNodePtr node, xpc_ProxyNodePtr owner );
-/* PmmSvNodeExt
+/* xpc_PmmSvNodeExt
* TYPE
* Function
* PARAMETER
@@ -101,9 +101,9 @@
* the default value should be allways '1'.
*/
xmlNodePtr
-PmmSvNodeExt( SV * perlnode, int copy );
+xpc_PmmSvNodeExt( SV * perlnode, int copy );
-/* PmmSvNode
+/* xpc_PmmSvNode
* TYPE
* Macro
* PARAMETER
@@ -111,36 +111,36 @@
*
* DESCRIPTION
*
- * PmmSvNode fetches the libxml node such as PmmSvNodeExt does. It is
+ * xpc_PmmSvNode fetches the libxml node such as xpc_PmmSvNodeExt does. It is
* a wrapper, that sets the copy always to 1, which is good for all
* cases XML::LibXML uses.
*/
-#define PmmSvNode(n) PmmSvNodeExt(n,1)
+#define xpc_PmmSvNode(n) xpc_PmmSvNodeExt(n,1)
xmlNodePtr
-PmmSvOwner( SV * perlnode );
+xpc_PmmSvOwner( SV * perlnode );
SV*
-PmmSetSvOwner(SV * perlnode, SV * owner );
+xpc_PmmSetSvOwner(SV * perlnode, SV * owner );
void
-PmmFixOwner(ProxyNodePtr node, ProxyNodePtr newOwner );
+xpc_PmmFixOwner(xpc_ProxyNodePtr node, xpc_ProxyNodePtr newOwner );
void
-PmmFixOwnerNode(xmlNodePtr node, ProxyNodePtr newOwner );
+xpc_PmmFixOwnerNode(xmlNodePtr node, xpc_ProxyNodePtr newOwner );
int
-PmmContextREFCNT_dec( ProxyNodePtr node );
+xpc_PmmContextREFCNT_dec( xpc_ProxyNodePtr node );
SV*
-PmmContextSv( xmlParserCtxtPtr ctxt );
+xpc_PmmContextSv( xmlParserCtxtPtr ctxt );
xmlParserCtxtPtr
-PmmSvContext( SV * perlctxt );
+xpc_PmmSvContext( SV * perlctxt );
/**
- * NAME PmmCopyNode
+ * NAME xpc_PmmCopyNode
* TYPE function
*
* returns libxml2 node
@@ -152,10 +152,10 @@
* XML::LibXSLT reuses it.
*/
xmlNodePtr
-PmmCloneNode( xmlNodePtr node , int deep );
+xpc_PmmCloneNode( xmlNodePtr node , int deep );
/**
- * NAME PmmNodeToGdomeSv
+ * NAME xpc_PmmNodeToGdomeSv
* TYPE function
*
* returns XML::GDOME node
@@ -169,25 +169,25 @@
*
*/
SV *
-PmmNodeToGdomeSv( xmlNodePtr node );
+xpc_PmmNodeToGdomeSv( xmlNodePtr node );
/**
- * NAME PmmNodeTypeName
+ * NAME xpc_PmmNodeTypeName
* TYPE function
*
* returns the perl class name for the given node
*
* SYNOPSIS
- * CLASS = PmmNodeTypeName( node );
+ * CLASS = xpc_PmmNodeTypeName( node );
*/
const char*
-PmmNodeTypeName( xmlNodePtr elem );
+xpc_PmmNodeTypeName( xmlNodePtr elem );
xmlChar*
-PmmEncodeString( const char *encoding, const char *string );
+xpc_PmmEncodeString( const char *encoding, const char *string );
char*
-PmmDecodeString( const char *encoding, const xmlChar *string);
+xpc_PmmDecodeString( const char *encoding, const xmlChar *string);
/* string manipulation will go elsewhere! */
@@ -205,7 +205,7 @@
*
*/
SV*
-C2Sv( const xmlChar *string, const xmlChar *encoding );
+xpc_C2Sv( const xmlChar *string, const xmlChar *encoding );
/*
* NAME sv_to_c_string
@@ -221,12 +221,12 @@
*
*/
xmlChar *
-Sv2C( SV* scalar, const xmlChar *encoding );
+xpc_Sv2C( SV* scalar, const xmlChar *encoding );
SV*
-nodeC2Sv( const xmlChar * string, xmlNodePtr refnode );
+nodexpc_C2Sv( const xmlChar * string, xmlNodePtr refnode );
xmlChar *
-nodeSv2C( SV * scalar, xmlNodePtr refnode );
+nodexpc_Sv2C( SV * scalar, xmlNodePtr refnode );
#endif
Index: perl-libxml-mm.c
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/perl-libxml-mm.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- perl-libxml-mm.c 14 Mar 2003 14:32:01 -0000 1.1.1.1
+++ perl-libxml-mm.c 20 May 2003 15:25:50 -0000 1.2
@@ -48,7 +48,7 @@
* memory leak problems that way.
**/
const char*
-PmmNodeTypeName( xmlNodePtr elem ){
+xpc_PmmNodeTypeName( xmlNodePtr elem ){
const char *name = "XML::LibXML::Node";
if ( elem != NULL ) {
@@ -107,7 +107,7 @@
* track how intense the nodes of a document are used and will not
* delete the nodes unless they are not refered from somewhere else.
*/
-struct _ProxyNode {
+struct _xpc_ProxyNode {
xmlNodePtr node;
xmlNodePtr owner;
int count;
@@ -115,31 +115,31 @@
};
/* helper type for the proxy structure */
-typedef struct _ProxyNode ProxyNode;
+typedef struct _xpc_ProxyNode xpc_ProxyNode;
/* pointer to the proxy structure */
-typedef ProxyNode* ProxyNodePtr;
+typedef xpc_ProxyNode* xpc_ProxyNodePtr;
/* this my go only into the header used by the xs */
-#define SvPROXYNODE(x) ((ProxyNodePtr)SvIV(SvRV(x)))
+#define SvPROXYNODE(x) ((xpc_ProxyNodePtr)SvIV(SvRV(x)))
#define SvNAMESPACE(x) ((xmlNsPtr)SvIV(SvRV(x)))
-#define PmmREFCNT(node) node->count
-#define PmmREFCNT_inc(node) node->count++
-#define PmmNODE(thenode) thenode->node
-#define PmmOWNER(node) node->owner
-#define PmmOWNERPO(node) ((node && PmmOWNER(node)) ? (ProxyNodePtr)PmmOWNER(node)->_private : node)
+#define xpc_PmmREFCNT(node) node->count
+#define xpc_PmmREFCNT_inc(node) node->count++
+#define xpc_PmmNODE(thenode) thenode->node
+#define xpc_PmmOWNER(node) node->owner
+#define xpc_PmmOWNERPO(node) ((node && xpc_PmmOWNER(node)) ? (xpc_ProxyNodePtr)xpc_PmmOWNER(node)->_private : node)
-#define PmmENCODING(node) node->encoding
-#define PmmNodeEncoding(node) ((ProxyNodePtr)(node->_private))->encoding
+#define xpc_PmmENCODING(node) node->encoding
+#define xpc_PmmNodeEncoding(node) ((xpc_ProxyNodePtr)(node->_private))->encoding
/* creates a new proxy node from a given node. this function is aware
* about the fact that a node may already has a proxy structure.
*/
-ProxyNodePtr
-PmmNewNode(xmlNodePtr node)
+xpc_ProxyNodePtr
+xpc_PmmNewNode(xmlNodePtr node)
{
- ProxyNodePtr proxy = NULL;
+ xpc_ProxyNodePtr proxy = NULL;
if ( node == NULL ) {
warn( "no node found\n" );
@@ -147,8 +147,8 @@
}
if ( node->_private == NULL ) {
- proxy = (ProxyNodePtr)malloc(sizeof(struct _ProxyNode));
- /* proxy = (ProxyNodePtr)Newz(0, proxy, 0, ProxyNode); */
+ proxy = (xpc_ProxyNodePtr)malloc(sizeof(struct _xpc_ProxyNode));
+ /* proxy = (xpc_ProxyNodePtr)Newz(0, proxy, 0, xpc_ProxyNode); */
if (proxy != NULL) {
proxy->node = node;
proxy->owner = NULL;
@@ -157,25 +157,25 @@
}
}
else {
- proxy = (ProxyNodePtr)node->_private;
+ proxy = (xpc_ProxyNodePtr)node->_private;
}
return proxy;
}
-ProxyNodePtr
-PmmNewFragment(xmlDocPtr doc)
+xpc_ProxyNodePtr
+xpc_PmmNewFragment(xmlDocPtr doc)
{
- ProxyNodePtr retval = NULL;
+ xpc_ProxyNodePtr retval = NULL;
xmlNodePtr frag = NULL;
xs_warn("new frag\n");
frag = xmlNewDocFragment( doc );
- retval = PmmNewNode(frag);
+ retval = xpc_PmmNewNode(frag);
if ( doc ) {
xs_warn("inc document\n");
- PmmREFCNT_inc(((ProxyNodePtr)doc->_private));
+ xpc_PmmREFCNT_inc(((xpc_ProxyNodePtr)doc->_private));
retval->owner = (xmlNodePtr)doc;
}
@@ -186,7 +186,7 @@
* has several diffrent nodetypes.
*/
void
-PmmFreeNode( xmlNodePtr node )
+xpc_PmmFreeNode( xmlNodePtr node )
{
switch( node->type ) {
case XML_DOCUMENT_NODE:
@@ -223,22 +223,22 @@
/* decrements the proxy counter. if the counter becomes zero or less,
this method will free the proxy node. If the node is part of a
- subtree, PmmREFCNT_def will fix the reference counts and delete
+ subtree, xpc_PmmREFCNT_def will fix the reference counts and delete
the subtree if it is not required any more.
*/
int
-PmmREFCNT_dec( ProxyNodePtr node )
+xpc_PmmREFCNT_dec( xpc_ProxyNodePtr node )
{
xmlNodePtr libnode = NULL;
- ProxyNodePtr owner = NULL;
+ xpc_ProxyNodePtr owner = NULL;
int retval = 0;
if ( node ) {
- retval = PmmREFCNT(node)--;
- if ( PmmREFCNT(node) <= 0 ) {
+ retval = xpc_PmmREFCNT(node)--;
+ if ( xpc_PmmREFCNT(node) <= 0 ) {
xs_warn( "NODE DELETATION\n" );
- libnode = PmmNODE( node );
+ libnode = xpc_PmmNODE( node );
if ( libnode != NULL ) {
if ( libnode->_private != node ) {
xs_warn( "lost node\n" );
@@ -249,25 +249,25 @@
}
}
- PmmNODE( node ) = NULL;
- if ( PmmOWNER(node) && PmmOWNERPO(node) ) {
+ xpc_PmmNODE( node ) = NULL;
+ if ( xpc_PmmOWNER(node) && xpc_PmmOWNERPO(node) ) {
xs_warn( "DOC NODE!\n" );
- owner = PmmOWNERPO(node);
- PmmOWNER( node ) = NULL;
+ owner = xpc_PmmOWNERPO(node);
+ xpc_PmmOWNER( node ) = NULL;
if( libnode != NULL && libnode->parent == NULL ) {
/* this is required if the node does not directly
* belong to the document tree
*/
xs_warn( "REAL DELETE" );
- PmmFreeNode( libnode );
+ xpc_PmmFreeNode( libnode );
}
xs_warn( "decrease owner" );
- PmmREFCNT_dec( owner );
+ xpc_PmmREFCNT_dec( owner );
}
else if ( libnode != NULL ) {
xs_warn( "STANDALONE REAL DELETE" );
- PmmFreeNode( libnode );
+ xpc_PmmFreeNode( libnode );
}
/* Safefree( node ); */
free( node );
@@ -293,27 +293,27 @@
* nodes.
*/
SV*
-PmmNodeToSv( xmlNodePtr node, ProxyNodePtr owner )
+xpc_PmmNodeToSv( xmlNodePtr node, xpc_ProxyNodePtr owner )
{
- ProxyNodePtr dfProxy= NULL;
+ xpc_ProxyNodePtr dfProxy= NULL;
SV * retval = &PL_sv_undef;
const char * CLASS = "XML::LibXML::Node";
if ( node != NULL ) {
/* find out about the class */
- CLASS = PmmNodeTypeName( node );
+ CLASS = xpc_PmmNodeTypeName( node );
xs_warn(" return new perl node\n");
xs_warn( CLASS );
if ( node->_private ) {
- dfProxy = PmmNewNode(node);
+ dfProxy = xpc_PmmNewNode(node);
}
else {
- dfProxy = PmmNewNode(node);
+ dfProxy = xpc_PmmNewNode(node);
if ( dfProxy != NULL ) {
if ( owner != NULL ) {
- dfProxy->owner = PmmNODE( owner );
- PmmREFCNT_inc( owner );
+ dfProxy->owner = xpc_PmmNODE( owner );
+ xpc_PmmREFCNT_inc( owner );
}
else {
xs_warn("node contains himself");
@@ -326,7 +326,7 @@
retval = NEWSV(0,0);
sv_setref_pv( retval, CLASS, (void*)dfProxy );
- PmmREFCNT_inc(dfProxy);
+ xpc_PmmREFCNT_inc(dfProxy);
switch ( node->type ) {
case XML_DOCUMENT_NODE:
@@ -348,7 +348,7 @@
}
xmlNodePtr
-PmmCloneNode( xmlNodePtr node, int recursive )
+xpc_PmmCloneNode( xmlNodePtr node, int recursive )
{
xmlNodePtr retval = NULL;
@@ -390,28 +390,28 @@
*/
xmlNodePtr
-PmmSvNodeExt( SV* perlnode, int copy )
+xpc_PmmSvNodeExt( SV* perlnode, int copy )
{
xmlNodePtr retval = NULL;
- ProxyNodePtr proxy = NULL;
+ xpc_ProxyNodePtr proxy = NULL;
if ( perlnode != NULL && perlnode != &PL_sv_undef ) {
/* if ( sv_derived_from(perlnode, "XML::LibXML::Node") */
/* && SvPROXYNODE(perlnode) != NULL ) { */
-/* retval = PmmNODE( SvPROXYNODE(perlnode) ) ; */
+/* retval = xpc_PmmNODE( SvPROXYNODE(perlnode) ) ; */
/* } */
xs_warn(" perlnode found\n" );
if ( sv_derived_from(perlnode, "XML::LibXML::Node") ) {
proxy = SvPROXYNODE(perlnode);
if ( proxy != NULL ) {
xs_warn( "is a xmlNodePtr structure\n" );
- retval = PmmNODE( proxy ) ;
+ retval = xpc_PmmNODE( proxy ) ;
}
if ( retval != NULL
- && ((ProxyNodePtr)retval->_private) != proxy ) {
+ && ((xpc_ProxyNodePtr)retval->_private) != proxy ) {
xs_warn( "no node in proxy node" );
- PmmNODE( proxy ) = NULL;
+ xpc_PmmNODE( proxy ) = NULL;
retval = NULL;
}
}
@@ -427,7 +427,7 @@
xs_warn( "no XML::LibXML node found in GDOME object" );
}
else if ( copy == 1 ) {
- retval = PmmCloneNode( retval, 1 );
+ retval = xpc_PmmCloneNode( retval, 1 );
}
}
}
@@ -440,32 +440,32 @@
/* extracts the libxml2 owner node from a perl reference
*/
xmlNodePtr
-PmmSvOwner( SV* perlnode )
+xpc_PmmSvOwner( SV* perlnode )
{
xmlNodePtr retval = NULL;
if ( perlnode != NULL
&& perlnode != &PL_sv_undef
&& SvPROXYNODE(perlnode) != NULL ) {
- retval = PmmOWNER( SvPROXYNODE(perlnode) );
+ retval = xpc_PmmOWNER( SvPROXYNODE(perlnode) );
}
return retval;
}
-/* reverse to PmmSvOwner(). sets the owner of the current node. this
+/* reverse to xpc_PmmSvOwner(). sets the owner of the current node. this
* will increase the proxy count of the owner.
*/
SV*
-PmmSetSvOwner( SV* perlnode, SV* extra )
+xpc_PmmSetSvOwner( SV* perlnode, SV* extra )
{
if ( perlnode != NULL && perlnode != &PL_sv_undef ) {
- PmmOWNER( SvPROXYNODE(perlnode)) = PmmNODE( SvPROXYNODE(extra) );
- PmmREFCNT_inc( SvPROXYNODE(extra) );
+ xpc_PmmOWNER( SvPROXYNODE(perlnode)) = xpc_PmmNODE( SvPROXYNODE(extra) );
+ xpc_PmmREFCNT_inc( SvPROXYNODE(extra) );
}
return perlnode;
}
void
-PmmFixOwnerList( xmlNodePtr list, ProxyNodePtr parent )
+xpc_PmmFixOwnerList( xmlNodePtr list, xpc_ProxyNodePtr parent )
{
if ( list ) {
xmlNodePtr iterator = list;
@@ -483,14 +483,14 @@
}
if ( iterator->_private != NULL ) {
- PmmFixOwner( (ProxyNodePtr)iterator->_private, parent );
+ xpc_PmmFixOwner( (xpc_ProxyNodePtr)iterator->_private, parent );
}
else {
if ( iterator->type != XML_ATTRIBUTE_NODE
&& iterator->properties != NULL ){
- PmmFixOwnerList( (xmlNodePtr)iterator->properties, parent );
+ xpc_PmmFixOwnerList( (xmlNodePtr)iterator->properties, parent );
}
- PmmFixOwnerList(iterator->children, parent);
+ xpc_PmmFixOwnerList(iterator->children, parent);
}
iterator = iterator->next;
}
@@ -503,7 +503,7 @@
* where the documents or the owner node may get changed. this method is
* aware about nodes that already belong to a certain owner node.
*
- * the method uses the internal methods PmmFixNode and PmmChildNodes to
+ * the method uses the internal methods xpc_PmmFixNode and xpc_PmmChildNodes to
* do the real updates.
*
* in the worst case this traverses the subtree twice durig a node
@@ -512,12 +512,12 @@
* owner may differ this double traversing makes sense.
*/
int
-PmmFixOwner( ProxyNodePtr nodetofix, ProxyNodePtr parent )
+xpc_PmmFixOwner( xpc_ProxyNodePtr nodetofix, xpc_ProxyNodePtr parent )
{
- ProxyNodePtr oldParent = NULL;
+ xpc_ProxyNodePtr oldParent = NULL;
if ( nodetofix != NULL ) {
- switch ( PmmNODE(nodetofix)->type ) {
+ switch ( xpc_PmmNODE(nodetofix)->type ) {
case XML_ENTITY_DECL:
case XML_ATTRIBUTE_DECL:
case XML_NAMESPACE_DECL:
@@ -528,8 +528,8 @@
break;
}
- if ( PmmOWNER(nodetofix) ) {
- oldParent = PmmOWNERPO(nodetofix);
+ if ( xpc_PmmOWNER(nodetofix) ) {
+ oldParent = xpc_PmmOWNERPO(nodetofix);
}
/* The owner data is only fixed if the node is neither a
@@ -539,28 +539,28 @@
*/
if( oldParent != parent ) {
if ( parent && parent != nodetofix ){
- PmmOWNER(nodetofix) = PmmNODE(parent);
- PmmREFCNT_inc( parent );
+ xpc_PmmOWNER(nodetofix) = xpc_PmmNODE(parent);
+ xpc_PmmREFCNT_inc( parent );
}
else {
- PmmOWNER(nodetofix) = NULL;
+ xpc_PmmOWNER(nodetofix) = NULL;
}
if ( oldParent && oldParent != nodetofix )
- PmmREFCNT_dec(oldParent);
+ xpc_PmmREFCNT_dec(oldParent);
- if ( PmmNODE(nodetofix)->type != XML_ATTRIBUTE_NODE
- && PmmNODE(nodetofix)->properties != NULL ) {
- PmmFixOwnerList( (xmlNodePtr)PmmNODE(nodetofix)->properties,
+ if ( xpc_PmmNODE(nodetofix)->type != XML_ATTRIBUTE_NODE
+ && xpc_PmmNODE(nodetofix)->properties != NULL ) {
+ xpc_PmmFixOwnerList( (xmlNodePtr)xpc_PmmNODE(nodetofix)->properties,
parent );
}
- if ( parent == NULL || PmmNODE(nodetofix)->parent == NULL ) {
+ if ( parent == NULL || xpc_PmmNODE(nodetofix)->parent == NULL ) {
/* fix to self */
parent = nodetofix;
}
- PmmFixOwnerList(PmmNODE(nodetofix)->children, parent);
+ xpc_PmmFixOwnerList(xpc_PmmNODE(nodetofix)->children, parent);
}
else {
xs_warn( "node doesn't need to get fixed" );
@@ -571,24 +571,24 @@
}
void
-PmmFixOwnerNode( xmlNodePtr node, ProxyNodePtr parent )
+xpc_PmmFixOwnerNode( xmlNodePtr node, xpc_ProxyNodePtr parent )
{
if ( node != NULL && parent != NULL ) {
if ( node->_private != NULL ) {
- PmmFixOwner( node->_private, parent );
+ xpc_PmmFixOwner( node->_private, parent );
}
else {
- PmmFixOwnerList(node->children, parent );
+ xpc_PmmFixOwnerList(node->children, parent );
}
}
}
-ProxyNodePtr
-PmmNewContext(xmlParserCtxtPtr node)
+xpc_ProxyNodePtr
+xpc_PmmNewContext(xmlParserCtxtPtr node)
{
- ProxyNodePtr proxy = NULL;
+ xpc_ProxyNodePtr proxy = NULL;
- proxy = (ProxyNodePtr)xmlMalloc(sizeof(ProxyNode));
+ proxy = (xpc_ProxyNodePtr)xmlMalloc(sizeof(xpc_ProxyNode));
if (proxy != NULL) {
proxy->node = (xmlNodePtr)node;
proxy->owner = NULL;
@@ -601,26 +601,26 @@
}
int
-PmmContextREFCNT_dec( ProxyNodePtr node )
+xpc_PmmContextREFCNT_dec( xpc_ProxyNodePtr node )
{
xmlParserCtxtPtr libnode = NULL;
int retval = 0;
if ( node ) {
- retval = PmmREFCNT(node)--;
- if ( PmmREFCNT(node) <= 0 ) {
+ retval = xpc_PmmREFCNT(node)--;
+ if ( xpc_PmmREFCNT(node) <= 0 ) {
xs_warn( "NODE DELETATION\n" );
- libnode = (xmlParserCtxtPtr)PmmNODE( node );
+ libnode = (xmlParserCtxtPtr)xpc_PmmNODE( node );
if ( libnode != NULL ) {
if (libnode->_private != NULL ) {
if ( libnode->_private != (void*)node ) {
- PmmSAXCloseContext( libnode );
+ xpc_PmmSAXCloseContext( libnode );
}
else {
xmlFree( libnode->_private );
}
libnode->_private = NULL;
}
- PmmNODE( node ) = NULL;
+ xpc_PmmNODE( node ) = NULL;
xmlFreeParserCtxt(libnode);
}
}
@@ -630,19 +630,19 @@
}
SV*
-PmmContextSv( xmlParserCtxtPtr ctxt )
+xpc_PmmContextSv( xmlParserCtxtPtr ctxt )
{
- ProxyNodePtr dfProxy= NULL;
+ xpc_ProxyNodePtr dfProxy= NULL;
SV * retval = &PL_sv_undef;
const char * CLASS = "XML::LibXML::ParserContext";
void * saxvector = NULL;
if ( ctxt != NULL ) {
- dfProxy = PmmNewContext(ctxt);
+ dfProxy = xpc_PmmNewContext(ctxt);
retval = NEWSV(0,0);
sv_setref_pv( retval, CLASS, (void*)dfProxy );
- PmmREFCNT_inc(dfProxy);
+ xpc_PmmREFCNT_inc(dfProxy);
}
else {
xs_warn( "no node found!" );
@@ -652,7 +652,7 @@
}
xmlParserCtxtPtr
-PmmSvContext( SV * scalar )
+xpc_PmmSvContext( SV * scalar )
{
xmlParserCtxtPtr retval = NULL;
@@ -660,7 +660,7 @@
&& scalar != &PL_sv_undef
&& sv_isa( scalar, "XML::LibXML::ParserContext" )
&& SvPROXYNODE(scalar) != NULL ) {
- retval = (xmlParserCtxtPtr)PmmNODE( SvPROXYNODE(scalar) );
+ retval = (xmlParserCtxtPtr)xpc_PmmNODE( SvPROXYNODE(scalar) );
}
else {
if ( scalar == NULL
@@ -681,7 +681,7 @@
}
xmlChar*
-PmmFastEncodeString( int charset,
+xpc_PmmFastEncodeString( int charset,
const xmlChar *string,
const xmlChar *encoding )
{
@@ -727,7 +727,7 @@
}
xmlChar*
-PmmFastDecodeString( int charset,
+xpc_PmmFastDecodeString( int charset,
const xmlChar *string,
const xmlChar *encoding)
{
@@ -777,7 +777,7 @@
* while the encodig has the name of the encoding of string
**/
xmlChar*
-PmmEncodeString( const char *encoding, const xmlChar *string ){
+xpc_PmmEncodeString( const char *encoding, const xmlChar *string ){
xmlCharEncoding enc;
xmlChar *ret = NULL;
xmlCharEncodingHandlerPtr coder = NULL;
@@ -786,7 +786,7 @@
if( encoding != NULL ) {
xs_warn( encoding );
enc = xmlParseCharEncoding( encoding );
- ret = PmmFastEncodeString( enc, string, (const xmlChar *)encoding );
+ ret = xpc_PmmFastEncodeString( enc, string, (const xmlChar *)encoding );
}
else {
/* if utf-8 is requested we do nothing */
@@ -802,18 +802,18 @@
* encoding is the coding name
**/
char*
-PmmDecodeString( const char *encoding, const xmlChar *string){
+xpc_PmmDecodeString( const char *encoding, const xmlChar *string){
char *ret=NULL;
xmlCharEncoding enc;
xmlBufferPtr in = NULL, out = NULL;
xmlCharEncodingHandlerPtr coder = NULL;
if ( string != NULL ) {
- xs_warn( "PmmDecodeString called" );
+ xs_warn( "xpc_PmmDecodeString called" );
if( encoding != NULL ) {
enc = xmlParseCharEncoding( encoding );
- ret = (char*)PmmFastDecodeString( enc, string, (const xmlChar*)encoding );
- xs_warn( "PmmDecodeString done" );
+ ret = (char*)xpc_PmmFastDecodeString( enc, string, (const xmlChar*)encoding );
+ xs_warn( "xpc_PmmDecodeString done" );
}
else {
ret = (char*)xmlStrdup(string);
@@ -824,7 +824,7 @@
SV*
-C2Sv( const xmlChar *string, const xmlChar *encoding )
+xpc_C2Sv( const xmlChar *string, const xmlChar *encoding )
{
SV *retval = &PL_sv_undef;
xmlCharEncoding enc;
@@ -866,7 +866,7 @@
}
xmlChar *
-Sv2C( SV* scalar, const xmlChar *encoding )
+xpc_Sv2C( SV* scalar, const xmlChar *encoding )
{
xmlChar *retval = NULL;
@@ -884,8 +884,8 @@
#else
if ( encoding != NULL ) {
#endif
- xs_warn( "domEncodeString!" );
- ts= PmmEncodeString( (const char *)encoding, string );
+ xs_warn( "xpc_domEncodeString!" );
+ ts= xpc_PmmEncodeString( (const char *)encoding, string );
xs_warn( "done!" );
if ( string != NULL ) {
xmlFree(string);
@@ -904,7 +904,7 @@
}
SV*
-nodeC2Sv( const xmlChar * string, xmlNodePtr refnode )
+nodexpc_C2Sv( const xmlChar * string, xmlNodePtr refnode )
{
/* this is a little helper function to avoid to much redundand
code in LibXML.xs */
@@ -915,7 +915,7 @@
xmlDocPtr real_doc = refnode->doc;
if ( real_doc && real_doc->encoding != NULL ) {
- xmlChar * decoded = PmmFastDecodeString( PmmNodeEncoding(real_doc) ,
+ xmlChar * decoded = xpc_PmmFastDecodeString( xpc_PmmNodeEncoding(real_doc) ,
(const xmlChar *)string,
(const xmlChar*)real_doc->encoding);
len = xmlStrlen( decoded );
@@ -938,7 +938,7 @@
retval = newSVpvn( (const char *)decoded, len );
}
- /* retval = C2Sv( decoded, real_doc->encoding ); */
+ /* retval = xpc_C2Sv( decoded, real_doc->encoding ); */
xmlFree( decoded );
}
else {
@@ -953,7 +953,7 @@
}
xmlChar *
-nodeSv2C( SV * scalar, xmlNodePtr refnode )
+nodexpc_Sv2C( SV * scalar, xmlNodePtr refnode )
{
/* this function requires conditionized compiling, because we
request a function, that does not exists in earlier versions of
@@ -981,8 +981,8 @@
#else
if ( real_dom->encoding != NULL ) {
#endif
- xs_warn( "domEncodeString!" );
- ts= PmmFastEncodeString( PmmNodeEncoding(real_dom),
+ xs_warn( "xpc_domEncodeString!" );
+ ts= xpc_PmmFastEncodeString( xpc_PmmNodeEncoding(real_dom),
string,
(const xmlChar*)real_dom->encoding );
xs_warn( "done!" );
@@ -1010,11 +1010,11 @@
xs_warn("no encoding !!");
#endif
- return Sv2C( scalar, NULL );
+ return xpc_Sv2C( scalar, NULL );
}
SV *
-PmmNodeToGdomeSv( xmlNodePtr node )
+xpc_PmmNodeToGdomeSv( xmlNodePtr node )
{
SV * retval = &PL_sv_undef;
Index: dom.h
===================================================================
RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/dom.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- dom.h 14 Mar 2003 14:32:04 -0000 1.1.1.1
+++ dom.h 20 May 2003 15:25:50 -0000 1.2
@@ -31,10 +31,10 @@
/**
- * NAME domParseChar
+ * NAME xpc_domParseChar
* TYPE function
* SYNOPSIS
- * int utf8char = domParseChar( curchar, &len );
+ * int utf8char = xpc_domParseChar( curchar, &len );
*
* The current char value, if using UTF-8 this may actually span
* multiple bytes in the given string. This function parses an utf8
@@ -50,7 +50,7 @@
* 2) not all perl versions XML::LibXML intends to run with have native
* UTF8 support.
*
- * domParseChar() allows to use the very same code with all versions
+ * xpc_domParseChar() allows to use the very same code with all versions
* of perl :)
*
* Returns the current char value and its length
@@ -60,19 +60,19 @@
* character is -1!
*/
int
-domParseChar( xmlChar *characters, int *len );
+xpc_domParseChar( xmlChar *characters, int *len );
xmlNodePtr
-domReadWellBalancedString( xmlDocPtr doc, xmlChar* string, int repair );
+xpc_domReadWellBalancedString( xmlDocPtr doc, xmlChar* string, int repair );
/**
- * NAME domIsParent
+ * NAME xpc_domIsParent
* TYPE function
*
* tests if a node is an ancestor of another node
*
* SYNOPSIS
- * if ( domIsParent(cur, ref) ) ...
+ * if ( xpc_domIsParent(cur, ref) ) ...
*
* this function is very useful to resolve if an operation would cause
* circular references.
@@ -80,46 +80,46 @@
* the function returns 1 if the ref node is a parent of the cur node.
*/
int
-domIsParent( xmlNodePtr cur, xmlNodePtr ref );
+xpc_domIsParent( xmlNodePtr cur, xmlNodePtr ref );
/**
- * NAME domTestHierarchy
+ * NAME xpc_domTestHierarchy
* TYPE function
*
* tests the general hierachy error
*
* SYNOPSIS
- * if ( domTestHierarchy(cur, ref) ) ...
+ * if ( xpc_domTestHierarchy(cur, ref) ) ...
*
* this function tests the general hierarchy error.
* it tests if the ref node would cause any hierarchical error for
- * cur node. the function evaluates domIsParent() internally.
+ * cur node. the function evaluates xpc_domIsParent() internally.
*
* the function will retrun 1 if there is no hierarchical error found.
* otherwise it returns 0.
*/
int
-domTestHierarchy( xmlNodePtr cur, xmlNodePtr ref );
+xpc_domTestHierarchy( xmlNodePtr cur, xmlNodePtr ref );
/**
-* NAME domTestDocument
+* NAME xpc_domTestDocument
* TYPE function
* SYNOPSIS
-* if ( domTestDocument(cur, ref) )...
+* if ( xpc_domTestDocument(cur, ref) )...
*
-* this function extends the domTestHierarchy() function. It tests if the
+* this function extends the xpc_domTestHierarchy() function. It tests if the
* cur node is a document and if so, it will check if the ref node can be
* inserted. (e.g. Attribute or Element nodes must not be appended to a
* document node)
*/
int
-domTestDocument( xmlNodePtr cur, xmlNodePtr ref );
+xpc_domTestDocument( xmlNodePtr cur, xmlNodePtr ref );
/**
-* NAME domAddNodeToList
+* NAME xpc_domAddNodeToList
* TYPE function
* SYNOPSIS
-* domAddNodeToList( cur, prevNode, nextNode )
+* xpc_domAddNodeToList( cur, prevNode, nextNode )
*
* This function inserts a node between the two nodes prevNode
* and nextNode. prevNode and nextNode MUST be adjacent nodes,
@@ -145,7 +145,7 @@
* the list. otherwise the function returns 0.
*/
int
-domAddNodeToList( xmlNodePtr cur, xmlNodePtr prev, xmlNodePtr next );
+xpc_domAddNodeToList( xmlNodePtr cur, xmlNodePtr prev, xmlNodePtr next );
/**
* part A:
@@ -156,43 +156,43 @@
/* A.1 DOM specified section */
xmlChar *
-domName( xmlNodePtr node );
+xpc_domName( xmlNodePtr node );
void
-domSetName( xmlNodePtr node, xmlChar* name );
+xpc_domSetName( xmlNodePtr node, xmlChar* name );
xmlNodePtr
-domAppendChild( xmlNodePtr self,
+xpc_domAppendChild( xmlNodePtr self,
xmlNodePtr newChild );
xmlNodePtr
-domReplaceChild( xmlNodePtr self,
+xpc_domReplaceChild( xmlNodePtr self,
xmlNodePtr newChlid,
xmlNodePtr oldChild );
xmlNodePtr
-domRemoveChild( xmlNodePtr self,
+xpc_domRemoveChild( xmlNodePtr self,
xmlNodePtr Child );
xmlNodePtr
-domInsertBefore( xmlNodePtr self,
+xpc_domInsertBefore( xmlNodePtr self,
xmlNodePtr newChild,
xmlNodePtr refChild );
xmlNodePtr
-domInsertAfter( xmlNodePtr self,
+xpc_domInsertAfter( xmlNodePtr self,
xmlNodePtr newChild,
xmlNodePtr refChild );
/* A.3 extra functionality not specified in DOM L1/2*/
xmlChar*
-domGetNodeValue( xmlNodePtr self );
+xpc_domGetNodeValue( xmlNodePtr self );
void
-domSetNodeValue( xmlNodePtr self, xmlChar* value );
+xpc_domSetNodeValue( xmlNodePtr self, xmlChar* value );
void
-domSetParentNode( xmlNodePtr self, xmlNodePtr newParent );
+xpc_domSetParentNode( xmlNodePtr self, xmlNodePtr newParent );
xmlNodePtr
-domReplaceNode( xmlNodePtr old, xmlNodePtr new );
+xpc_domReplaceNode( xmlNodePtr old, xmlNodePtr new );
/**
* part B:
@@ -201,10 +201,10 @@
**/
/**
- * NAME domImportNode
+ * NAME xpc_domImportNode
* TYPE function
* SYNOPSIS
- * node = domImportNode( document, node, move);#
+ * node = xpc_domImportNode( document, node, move);#
*
* the function will import a node to the given document. it will work safe
* with namespaces and subtrees.
@@ -217,7 +217,7 @@
* is returned
*/
xmlNodePtr
-domImportNode( xmlDocPtr document, xmlNodePtr node, int move );
+xpc_domImportNode( xmlDocPtr document, xmlNodePtr node, int move );
/**
* part C:
@@ -226,24 +226,24 @@
**/
xmlNodeSetPtr
-domGetElementsByTagName( xmlNodePtr self, xmlChar* name );
+xpc_domGetElementsByTagName( xmlNodePtr self, xmlChar* name );
xmlNodeSetPtr
-domGetElementsByTagNameNS( xmlNodePtr self, xmlChar* nsURI, xmlChar* name );
+xpc_domGetElementsByTagNameNS( xmlNodePtr self, xmlChar* nsURI, xmlChar* name );
xmlNsPtr
-domNewNs ( xmlNodePtr elem , xmlChar *prefix, xmlChar *href );
+xpc_domNewNs ( xmlNodePtr elem , xmlChar *prefix, xmlChar *href );
xmlAttrPtr
-domHasNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *namespace);
+xpc_domHasNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *namespace);
xmlAttrPtr
-domSetAttributeNode( xmlNodePtr node , xmlAttrPtr attr );
+xpc_domSetAttributeNode( xmlNodePtr node , xmlAttrPtr attr );
int
-domNodeNormalize( xmlNodePtr node );
+xpc_domNodeNormalize( xmlNodePtr node );
int
-domNodeNormalizeList( xmlNodePtr nodelist );
+xpc_do...
[truncated message content] |
|
From: Grant M. <gr...@us...> - 2003-05-20 08:50:14
|
Update of /cvsroot/perl-xml/xml-simple
In directory sc8-pr-cvs1:/tmp/cvs-serv9076
Modified Files:
Changes README
Log Message:
- for 2.07 release
Index: Changes
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/Changes,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- Changes 18 May 2003 08:45:59 -0000 1.11
+++ Changes 20 May 2003 08:50:09 -0000 1.12
@@ -1,5 +1,10 @@
Revision history for Perl module XML::Simple
+2.07 May 20 2003
+ - added test to catch old versions of Storable which lack locking support
+ - removed new-style loop which broke on 5.005_03
+ - suppress more uninitialised variable warnings
+
2.06 May 18 2003
- fixed strict mode requiring ForceArray on output (fix from Igor Roman
Marino)
Index: README
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/README,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- README 18 May 2003 08:45:59 -0000 1.11
+++ README 20 May 2003 08:50:09 -0000 1.12
@@ -62,6 +62,10 @@
NEW IN THIS RELEASE
+ - fixed bug which broke compatibility with Perl 5.005_03
+ - fixed test problems with Storable
+
+ New in Version 2.06
- bug fix for strict mode requiring ForceArray on output
New in Version 2.05
|
|
From: Grant M. <gr...@us...> - 2003-05-20 08:50:14
|
Update of /cvsroot/perl-xml/xml-simple/t In directory sc8-pr-cvs1:/tmp/cvs-serv9076/t Modified Files: 0_Config.t Log Message: - for 2.07 release Index: 0_Config.t =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/t/0_Config.t,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- 0_Config.t 18 May 2003 08:43:13 -0000 1.5 +++ 0_Config.t 20 May 2003 08:50:10 -0000 1.6 @@ -7,7 +7,7 @@ # Build up a list of installed modules -my @mod_list = qw(XML::Simple XML::Parser XML::SAX); +my @mod_list = qw(XML::Simple Storable XML::Parser XML::SAX); # If XML::SAX is installed, add a list of installed SAX parsers |
|
From: Grant M. <gr...@us...> - 2003-05-20 08:49:34
|
Update of /cvsroot/perl-xml/xml-simple/t
In directory sc8-pr-cvs1:/tmp/cvs-serv8494/t
Modified Files:
1_XMLin.t 6_ObjIntf.t
Log Message:
- fixed duplicate declaration which caused warnings
Index: 1_XMLin.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/1_XMLin.t,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- 1_XMLin.t 18 May 2003 08:43:13 -0000 1.13
+++ 1_XMLin.t 20 May 2003 08:49:31 -0000 1.14
@@ -25,8 +25,8 @@
$@ = '';
eval "use XML::Simple;";
is($@, '', 'Module compiled OK');
-unless($XML::Simple::VERSION eq '2.06') {
- diag("Warning: XML::Simple::VERSION = $XML::Simple::VERSION (expected 2.06)");
+unless($XML::Simple::VERSION eq '2.07') {
+ diag("Warning: XML::Simple::VERSION = $XML::Simple::VERSION (expected 2.07)");
}
@@ -337,7 +337,7 @@
# Confirm the stringifying references bug is fixed
-my $xml = q(
+$xml = q(
<opt>
<item>
<name><firstname>Bob</firstname></name>
Index: 6_ObjIntf.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/6_ObjIntf.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- 6_ObjIntf.t 18 May 2003 08:43:13 -0000 1.6
+++ 6_ObjIntf.t 20 May 2003 08:49:31 -0000 1.7
@@ -344,7 +344,7 @@
<file name="debug_file">${log_dir}/appname.dbg</file>
</opt>);
-my $opt = $xs1->XMLin($xml);
+$opt = $xs1->XMLin($xml);
is_deeply($opt, {
file => {
config_file => '/etc/appname.conf',
|
|
From: Grant M. <gr...@us...> - 2003-05-20 08:48:11
|
Update of /cvsroot/perl-xml/xml-simple/t
In directory sc8-pr-cvs1:/tmp/cvs-serv7211/t
Modified Files:
3_Storable.t
Log Message:
- added check for old versions of STorable
Index: 3_Storable.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/3_Storable.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- 3_Storable.t 18 May 2003 08:43:13 -0000 1.7
+++ 3_Storable.t 20 May 2003 08:48:08 -0000 1.8
@@ -12,6 +12,10 @@
unless($INC{'Storable.pm'}) {
plan skip_all => 'no Storable.pm';
}
+unless(UNIVERSAL::can(Storable => 'lock_nstore')) {
+ plan skip_all => 'Storable.pm is too old - no file locking support';
+}
+
# Initialise filenames and check they're there
|
|
From: Grant M. <gr...@us...> - 2003-05-20 08:46:17
|
Update of /cvsroot/perl-xml/xml-simple/lib/XML
In directory sc8-pr-cvs1:/tmp/cvs-serv5463/lib/XML
Modified Files:
Simple.pm
Log Message:
- removed new-style loop which broke on 5.005_03
- added comment re old versions of Storable
- deferred to the cargo cult police
- suppressed more uninitialised variable warnings
Index: Simple.pm
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/lib/XML/Simple.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- Simple.pm 18 May 2003 08:40:41 -0000 1.13
+++ Simple.pm 20 May 2003 08:46:12 -0000 1.14
@@ -53,7 +53,7 @@
@ISA = qw(Exporter);
@EXPORT = qw(XMLin XMLout);
@EXPORT_OK = qw(xml_in xml_out);
-$VERSION = '2.06';
+$VERSION = '2.07';
$PREFERRED_PARSER = undef;
my $StrictMode = 0;
@@ -110,8 +110,7 @@
#
sub new {
- my $class = ref($_[0]) || $_[0]; # Works as object or class method
- shift;
+ my $class = shift;
if(@_ % 2) {
croak "Default options must be name=>value pairs (odd number supplied)";
@@ -357,6 +356,8 @@
$cachefile =~ s{(\.xml)?$}{.stor};
require Storable; # We didn't need it until now
+
+ # If the following line fails for you, your Storable.pm is old - upgrade
Storable::lock_nstore($data, $cachefile);
@@ -871,7 +872,9 @@
$attr = {};
}
elsif($self->{opt}->{normalisespace} == 2) {
- $_ = $self->normalise_space($_) foreach (values %$attr);
+ while(my($key, $value) = each %$attr) {
+ $attr->{$key} = $self->normalise_space($value)
+ }
}
@@ -929,7 +932,7 @@
$attr->{$key} = [ $attr->{$key}, $val ];
}
}
- elsif(UNIVERSAL::isa($val, 'ARRAY')) { # Handle anonymous arrays
+ elsif(defined($val) and UNIVERSAL::isa($val, 'ARRAY')) {
$attr->{$key} = [ $val ];
}
else {
@@ -960,7 +963,7 @@
my $count = 0;
if($self->{opt}->{keyattr}) {
while(($key,$val) = each %$attr) {
- if(UNIVERSAL::isa($val, 'ARRAY')) {
+ if(defined($val) and UNIVERSAL::isa($val, 'ARRAY')) {
$attr->{$key} = $self->array_to_hash($key, $val);
}
$count++;
@@ -986,7 +989,10 @@
# Fold hashes containing a single anonymous array up into just the array
- if($count == 1 and UNIVERSAL::isa($attr->{anon}, 'ARRAY')) {
+ if($count == 1
+ and exists $attr->{anon}
+ and UNIVERSAL::isa($attr->{anon}, 'ARRAY')
+ ) {
return($attr->{anon});
}
@@ -1963,7 +1969,7 @@
specify a list of element names which should always be forced into an array
representation, rather than the 'all or nothing' approach above.
-It is also possible (since version 2.06) to include compiled regular
+It is also possible (since version 2.05) to include compiled regular
expressions in the list - any element names which match the pattern will be
forced to arrays. If the list contains only a single regex, then it is not
necessary to enclose it in an arrayref. Eg:
@@ -2793,7 +2799,7 @@
=head1 STATUS
-This version (2.06) is the current stable version.
+This version (2.07) is the current stable version.
=head1 SEE ALSO
|
|
From: Grant M. <gr...@us...> - 2003-05-18 08:46:02
|
Update of /cvsroot/perl-xml/xml-simple
In directory sc8-pr-cvs1:/tmp/cvs-serv3705
Modified Files:
Changes README
Log Message:
- for 2.06 release
Index: Changes
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/Changes,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Changes 16 Apr 2003 10:23:55 -0000 1.10
+++ Changes 18 May 2003 08:45:59 -0000 1.11
@@ -1,5 +1,11 @@
Revision history for Perl module XML::Simple
+2.06 May 18 2003
+ - fixed strict mode requiring ForceArray on output (fix from Igor Roman
+ Marino)
+ - fixed warnings about uninitialised values
+ - minor POD update (link to FAQ)
+
2.05 Apr 16 2003
- fixed warnings when NormaliseSpace undefined (reported by Peter
Scott and others)
Index: README
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/README,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- README 16 Apr 2003 10:23:55 -0000 1.10
+++ README 18 May 2003 08:45:59 -0000 1.11
@@ -56,12 +56,15 @@
STATUS
- This version (2.05) is the current stable release.
+ This version (2.06) is the current stable release.
Please send any feedback to the author: gr...@cp...
NEW IN THIS RELEASE
+ - bug fix for strict mode requiring ForceArray on output
+
+ New in Version 2.05
- fixed warnings when NormaliseSpace undefined (reported by Peter
Scott and others)
- added support for specifying ForceArray using regular expressions
|
Update of /cvsroot/perl-xml/xml-simple/t
In directory sc8-pr-cvs1:/tmp/cvs-serv2803/t
Modified Files:
0_Config.t 1_XMLin.t 3_Storable.t 4_MemShare.t 5_MemCopy.t
6_ObjIntf.t 7_SaxStuff.t 8_Namespaces.t 9_Strict.t
Log Message:
- enable warnings
Index: 0_Config.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/0_Config.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
Index: 1_XMLin.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/1_XMLin.t,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- 1_XMLin.t 16 Apr 2003 10:17:29 -0000 1.12
+++ 1_XMLin.t 18 May 2003 08:43:13 -0000 1.13
@@ -6,6 +6,8 @@
use IO::File;
use File::Spec;
+$^W = 1;
+
# Initialise filenames and check they're there
@@ -15,14 +17,16 @@
plan skip_all => 'Test data missing';
}
-plan tests => 95;
+plan tests => 98;
+my $last_warning = '';
+
$@ = '';
eval "use XML::Simple;";
is($@, '', 'Module compiled OK');
-unless($XML::Simple::VERSION eq '2.05') {
- diag("Warning: XML::Simple::VERSION = $XML::Simple::VERSION (expected 2.05)");
+unless($XML::Simple::VERSION eq '2.06') {
+ diag("Warning: XML::Simple::VERSION = $XML::Simple::VERSION (expected 2.06)");
}
@@ -352,11 +356,23 @@
]
};
+$last_warning = '';
$opt = XMLin($xml, @cont_key);
is_deeply($opt, $target, "did not fold on default key with non-scalar value");
+is($last_warning, '', 'no warning issued');
-$opt = XMLin($xml, keyattr => { item => 'name' }, @cont_key);
-is_deeply($opt, $target, "did not fold on specific key with non-scalar value");
+{
+ local($SIG{__WARN__}) = \&warn_handler;
+
+ $last_warning = '';
+ $opt = XMLin($xml, keyattr => { item => 'name' }, @cont_key);
+ is_deeply($opt, $target, "did not fold on specific key with non-scalar value");
+ isnt($last_warning, '', 'warning issued as expected');
+ like($last_warning,
+ qr{<item> element has non-scalar 'name' key attribute},
+ 'text in warning is correct'
+ );
+}
# Make sure that the root element name is preserved if we ask for it
@@ -1218,3 +1234,7 @@
exit(0);
+
+sub warn_handler {
+ $last_warning = $_[0];
+}
Index: 3_Storable.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/3_Storable.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- 3_Storable.t 10 Apr 2003 10:20:08 -0000 1.6
+++ 3_Storable.t 18 May 2003 08:43:13 -0000 1.7
@@ -5,6 +5,9 @@
use Test::More;
use File::Spec;
+$^W = 1;
+
+
eval { require Storable; };
unless($INC{'Storable.pm'}) {
plan skip_all => 'no Storable.pm';
Index: 4_MemShare.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/4_MemShare.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- 4_MemShare.t 16 Oct 2002 09:43:35 -0000 1.3
+++ 4_MemShare.t 18 May 2003 08:43:13 -0000 1.4
@@ -5,6 +5,9 @@
use Test::More;
use File::Spec;
+$^W = 1;
+
+
# Initialise filenames and check they're there
my $SrcFile = File::Spec->catfile('t', 'desertnet.src');
Index: 5_MemCopy.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/5_MemCopy.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- 5_MemCopy.t 16 Oct 2002 09:43:35 -0000 1.4
+++ 5_MemCopy.t 18 May 2003 08:43:13 -0000 1.5
@@ -5,6 +5,9 @@
use Test::More;
use File::Spec;
+$^W = 1;
+
+
eval { require Storable; };
unless($INC{'Storable.pm'}) {
plan skip_all => 'no Storable.pm';
Index: 6_ObjIntf.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/6_ObjIntf.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- 6_ObjIntf.t 10 Apr 2003 10:20:08 -0000 1.5
+++ 6_ObjIntf.t 18 May 2003 08:43:13 -0000 1.6
@@ -2,6 +2,9 @@
# vim: syntax=perl
use strict;
+
+$^W = 1;
+
use Test::More tests => 33;
##############################################################################
Index: 7_SaxStuff.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/7_SaxStuff.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- 7_SaxStuff.t 16 Oct 2002 09:43:35 -0000 1.2
+++ 7_SaxStuff.t 18 May 2003 08:43:13 -0000 1.3
@@ -6,6 +6,9 @@
use File::Spec;
use IO::File;
+$^W = 1;
+
+
BEGIN {
unshift @INC, File::Spec->catfile('t', 'lib');
Index: 8_Namespaces.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/8_Namespaces.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- 8_Namespaces.t 16 Oct 2002 09:43:35 -0000 1.4
+++ 8_Namespaces.t 18 May 2003 08:43:14 -0000 1.5
@@ -6,6 +6,9 @@
use File::Spec;
use IO::File;
+$^W = 1;
+
+
eval { require XML::SAX; };
if($@) {
plan skip_all => 'no XML::SAX';
Index: 9_Strict.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/9_Strict.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- 9_Strict.t 10 Apr 2003 10:20:10 -0000 1.4
+++ 9_Strict.t 18 May 2003 08:43:14 -0000 1.5
@@ -4,7 +4,9 @@
use strict;
use Test::More;
-plan tests => 37;
+$^W = 1;
+
+plan tests => 38;
##############################################################################
@@ -140,6 +142,7 @@
# Confirm that keyattr cannot be omitted
+$@ = '';
eval {
XMLout($ref, rootname => 'list');
};
@@ -149,6 +152,16 @@
'with the correct error message');
+# Confirm that forcearray can be omitted (only rqd on input)
+
+$@ = '';
+eval {
+ XMLout($ref, keyattr => {x => 'y'});
+};
+
+is($@, '', 'omitting forcearray was not a fatal error on output');
+
+
##############################################################################
# Now repeat all that using the OO syntax
##############################################################################
@@ -160,12 +173,12 @@
my $xs = XML::Simple->new(forcearray => 1, keyattr => {});
$@ = '';
-my $opt = eval {
+$opt = eval {
$xs->XMLin($xml);
};
is($@, '', '$xs->XMLin() did not fail');
-my $keys = join(' ', sort keys %$opt);
+$keys = join(' ', sort keys %$opt);
is($keys, 'name1 name2', 'and managed to produce the expected results');
|
|
From: Grant M. <gr...@us...> - 2003-05-18 08:42:32
|
Update of /cvsroot/perl-xml/xml-simple/t In directory sc8-pr-cvs1:/tmp/cvs-serv2586/t Modified Files: 2_XMLout.t Log Message: - test strict mode bug fix Index: 2_XMLout.t =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/t/2_XMLout.t,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- 2_XMLout.t 16 Apr 2003 10:19:24 -0000 1.7 +++ 2_XMLout.t 18 May 2003 08:42:30 -0000 1.8 @@ -5,7 +5,10 @@ use Test::More; use IO::File; +$^W = 1; + plan tests => 192; + ############################################################################## # S U P P O R T R O U T I N E S |
|
From: Grant M. <gr...@us...> - 2003-05-18 08:40:45
|
Update of /cvsroot/perl-xml/xml-simple/lib/XML
In directory sc8-pr-cvs1:/tmp/cvs-serv2116/lib/XML
Modified Files:
Simple.pm
Log Message:
- fixed strict mode bug where ForceArray was demanded on output
- suppressed warning re uninitialised value
Index: Simple.pm
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/lib/XML/Simple.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- Simple.pm 16 Apr 2003 10:16:28 -0000 1.12
+++ Simple.pm 18 May 2003 08:40:41 -0000 1.13
@@ -53,7 +53,7 @@
@ISA = qw(Exporter);
@EXPORT = qw(XMLin XMLout);
@EXPORT_OK = qw(xml_in xml_out);
-$VERSION = '2.05';
+$VERSION = '2.06';
$PREFERRED_PARSER = undef;
my $StrictMode = 0;
@@ -738,7 +738,7 @@
foreach my $el (keys(%{$opt->{keyattr}})) {
if($opt->{keyattr}->{$el} =~ /^(\+|-)?(.*)$/) {
$opt->{keyattr}->{$el} = [ $2, ($1 ? $1 : '') ];
- if($StrictMode) {
+ if($StrictMode and $dirn eq 'in') {
next if($opt->{forcearray} == 1);
next if(ref($opt->{forcearray}) eq 'HASH'
and $opt->{forcearray}->{$el});
@@ -973,6 +973,7 @@
if($self->{opt}->{grouptags}) {
while(my($key, $val) = each(%$attr)) {
next unless(UNIVERSAL::isa($val, 'HASH') and (keys %$val == 1));
+ next unless(exists($self->{opt}->{grouptags}->{$key}));
my($child_key, $child_val) = %$val;
@@ -1962,7 +1963,7 @@
specify a list of element names which should always be forced into an array
representation, rather than the 'all or nothing' approach above.
-It is also possible (since version 2.05) to include compiled regular
+It is also possible (since version 2.06) to include compiled regular
expressions in the list - any element names which match the pattern will be
forced to arrays. If the list contains only a single regex, then it is not
necessary to enclose it in an arrayref. Eg:
@@ -2792,7 +2793,7 @@
=head1 STATUS
-This version (2.05) is the current stable version.
+This version (2.06) is the current stable version.
=head1 SEE ALSO
@@ -2801,6 +2802,9 @@
To generate documents with namespaces, L<XML::NamespaceSupport> is required.
The optional caching functions require L<Storable>.
+
+Answers to Frequently Asked Questions about XML::Simple are bundled with this
+distribution as: L<XML::Simple::FAQ>
=head1 COPYRIGHT
|
|
From: Ilya M. <m_...@us...> - 2003-04-30 20:47:59
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext In directory sc8-pr-cvs1:/tmp/cvs-serv6392 Modified Files: Changes Log Message: Use proper capitalization Index: Changes =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/Changes,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Changes 30 Apr 2003 20:24:24 -0000 1.8 +++ Changes 30 Apr 2003 20:47:53 -0000 1.9 @@ -4,10 +4,10 @@ 0.03 Thu May 1 2003 -* added optional $context_node argument to findnodes(), find(), and +* Added optional $context_node argument to findnodes(), find(), and findvalue() to simplify temporarily setting the context node. -* fixed bugs in new(), setContextNode(), and register* causing loosing +* Fixed bugs in new(), setContextNode(), and register* causing loosing stored context data passed from a variable if the variable itself gets changed |