|
From: <vac...@us...> - 2008-12-01 19:41:08
|
Revision: 105
http://xmlwrapp.svn.sourceforge.net/xmlwrapp/?rev=105&view=rev
Author: vaclavslavik
Date: 2008-12-01 19:40:58 +0000 (Mon, 01 Dec 2008)
Log Message:
-----------
Input document to xslt::stylesheet::apply() is now passed as const reference instead of non-const one.
Modified Paths:
--------------
trunk/ChangeLog
trunk/docs/manual/xslt.texi
trunk/docs/manual_xml/xslt.xml
trunk/include/xmlwrapp/document.h
trunk/include/xsltwrapp/stylesheet.h
trunk/src/Makefile.am
trunk/src/libxml/document.cxx
trunk/src/libxslt/stylesheet.cxx
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-11-30 22:22:06 UTC (rev 104)
+++ trunk/ChangeLog 2008-12-01 19:40:58 UTC (rev 105)
@@ -9,6 +9,9 @@
xsltwrapp.pc. Applications that use libxsltwrapp need to be
updated to use the latter (too).
+ Input document to xslt::stylesheet::apply() is now passed as
+ const reference instead of non-const one.
+
Version 0.5.1
Various compilation fixes.
Modified: trunk/docs/manual/xslt.texi
===================================================================
--- trunk/docs/manual/xslt.texi 2008-11-30 22:22:06 UTC (rev 104)
+++ trunk/docs/manual/xslt.texi 2008-12-01 19:40:58 UTC (rev 105)
@@ -60,8 +60,8 @@
@example
-bool xslt::stylesheet::apply (xml::document &doc, xml::document &result);
-bool xslt::stylesheet::apply (xml::document &doc, xml::document &result, const param_type &with_params);
+bool xslt::stylesheet::apply (const xml::document &doc, xml::document &result);
+bool xslt::stylesheet::apply (const xml::document &doc, xml::document &result, const param_type &with_params);
@end example
@@ -81,8 +81,8 @@
@example
-xml::document& xslt::stylesheet::apply (xml::document &doc);
-xml::document& xslt::stylesheet::apply (xml::document &doc, const param_type &with_params);
+xml::document& xslt::stylesheet::apply (const xml::document &doc);
+xml::document& xslt::stylesheet::apply (const xml::document &doc, const param_type &with_params);
@end example
Modified: trunk/docs/manual_xml/xslt.xml
===================================================================
--- trunk/docs/manual_xml/xslt.xml 2008-11-30 22:22:06 UTC (rev 104)
+++ trunk/docs/manual_xml/xslt.xml 2008-12-01 19:40:58 UTC (rev 105)
@@ -66,8 +66,8 @@
<screen>
<![CDATA[
-bool xslt::stylesheet::apply (xml::document &doc, xml::document &result);
-bool xslt::stylesheet::apply (xml::document &doc, xml::document &result, const param_type &with_params);
+bool xslt::stylesheet::apply (const xml::document &doc, xml::document &result);
+bool xslt::stylesheet::apply (const xml::document &doc, xml::document &result, const param_type &with_params);
]]>
</screen>
</section>
@@ -87,8 +87,8 @@
</para>
<screen>
<![CDATA[
-xml::document& xslt::stylesheet::apply (xml::document &doc);
-xml::document& xslt::stylesheet::apply (xml::document &doc, const param_type &with_params);
+xml::document& xslt::stylesheet::apply (const xml::document &doc);
+xml::document& xslt::stylesheet::apply (const xml::document &doc, const param_type &with_params);
]]>
</screen>
</section>
Modified: trunk/include/xmlwrapp/document.h
===================================================================
--- trunk/include/xmlwrapp/document.h 2008-11-30 22:22:06 UTC (rev 104)
+++ trunk/include/xmlwrapp/document.h 2008-12-01 19:40:58 UTC (rev 105)
@@ -537,6 +537,7 @@
void set_doc_data (void *data);
void set_doc_data_from_xslt (void *data, xslt::result *xr);
void* get_doc_data (void);
+ void* get_doc_data_read_only (void) const;
void* release_doc_data (void);
friend class tree_parser;
Modified: trunk/include/xsltwrapp/stylesheet.h
===================================================================
--- trunk/include/xsltwrapp/stylesheet.h 2008-11-30 22:22:06 UTC (rev 104)
+++ trunk/include/xsltwrapp/stylesheet.h 2008-12-01 19:40:58 UTC (rev 105)
@@ -101,7 +101,7 @@
* @author Peter Jones
**/
//####################################################################
- bool apply (xml::document &doc, xml::document &result);
+ bool apply (const xml::document &doc, xml::document &result);
//####################################################################
/**
@@ -116,7 +116,7 @@
* @author Peter Jones
**/
//####################################################################
- bool apply (xml::document &doc, xml::document &result, const param_type &with_params);
+ bool apply (const xml::document &doc, xml::document &result, const param_type &with_params);
//####################################################################
/**
@@ -133,7 +133,7 @@
* @author Peter Jones
**/
//####################################################################
- xml::document& apply (xml::document &doc);
+ xml::document& apply (const xml::document &doc);
//####################################################################
/**
@@ -151,7 +151,7 @@
* @author Peter Jones
**/
//####################################################################
- xml::document& apply (xml::document &doc, const param_type &with_params);
+ xml::document& apply (const xml::document &doc, const param_type &with_params);
//####################################################################
/**
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2008-11-30 22:22:06 UTC (rev 104)
+++ trunk/src/Makefile.am 2008-12-01 19:40:58 UTC (rev 105)
@@ -34,7 +34,7 @@
libxsltwrapp_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBEXSLT_CFLAGS) $(LIBXSLT_CFLAGS)
libxsltwrapp_la_LIBADD = libxmlwrapp.la $(LIBEXSLT_LIBS) $(LIBXSLT_LIBS)
-libxsltwrapp_la_LDFLAGS = -version-info 2:1:0
+libxsltwrapp_la_LDFLAGS = -version-info 3:0:0
libxsltwrapp_la_SOURCES = \
libxslt/init.cxx \
Modified: trunk/src/libxml/document.cxx
===================================================================
--- trunk/src/libxml/document.cxx 2008-11-30 22:22:06 UTC (rev 104)
+++ trunk/src/libxml/document.cxx 2008-12-01 19:40:58 UTC (rev 105)
@@ -340,6 +340,10 @@
return pimpl_->doc_;
}
//####################################################################
+void* xml::document::get_doc_data_read_only (void) const {
+ return pimpl_->doc_;
+}
+//####################################################################
void* xml::document::release_doc_data (void) {
xmlDocPtr xmldoc = pimpl_->doc_;
pimpl_->doc_ = 0;
Modified: trunk/src/libxslt/stylesheet.cxx
===================================================================
--- trunk/src/libxslt/stylesheet.cxx 2008-11-30 22:22:06 UTC (rev 104)
+++ trunk/src/libxslt/stylesheet.cxx 2008-12-01 19:40:58 UTC (rev 105)
@@ -148,8 +148,8 @@
delete pimpl_;
}
//####################################################################
-bool xslt::stylesheet::apply (xml::document &doc, xml::document &result) {
- xmlDocPtr input = static_cast<xmlDocPtr>(doc.get_doc_data());
+bool xslt::stylesheet::apply (const xml::document &doc, xml::document &result) {
+ xmlDocPtr input = static_cast<xmlDocPtr>(doc.get_doc_data_read_only());
xmlDocPtr xmldoc = apply_stylesheet(pimpl_->ss_, input);
if (xmldoc) {
@@ -160,8 +160,8 @@
return false;
}
//####################################################################
-bool xslt::stylesheet::apply (xml::document &doc, xml::document &result, const param_type &with_params) {
- xmlDocPtr input = static_cast<xmlDocPtr>(doc.get_doc_data());
+bool xslt::stylesheet::apply (const xml::document &doc, xml::document &result, const param_type &with_params) {
+ xmlDocPtr input = static_cast<xmlDocPtr>(doc.get_doc_data_read_only());
xmlDocPtr xmldoc = apply_stylesheet(pimpl_->ss_, input, &with_params);
if (xmldoc) {
@@ -172,8 +172,8 @@
return false;
}
//####################################################################
-xml::document& xslt::stylesheet::apply (xml::document &doc) {
- xmlDocPtr input = static_cast<xmlDocPtr>(doc.get_doc_data());
+xml::document& xslt::stylesheet::apply (const xml::document &doc) {
+ xmlDocPtr input = static_cast<xmlDocPtr>(doc.get_doc_data_read_only());
xmlDocPtr xmldoc = apply_stylesheet(pimpl_->ss_, input);
if (xmldoc == 0) {
@@ -185,8 +185,8 @@
return pimpl_->doc_;
}
//####################################################################
-xml::document& xslt::stylesheet::apply (xml::document &doc, const param_type &with_params) {
- xmlDocPtr input = static_cast<xmlDocPtr>(doc.get_doc_data());
+xml::document& xslt::stylesheet::apply (const xml::document &doc, const param_type &with_params) {
+ xmlDocPtr input = static_cast<xmlDocPtr>(doc.get_doc_data_read_only());
xmlDocPtr xmldoc = apply_stylesheet(pimpl_->ss_, input, &with_params);
if (xmldoc == 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|