You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gr...@apache.org on 2001/01/17 17:02:22 UTC
cvs commit: xml-cocoon/xdocs faq.xml xspprocessor.xml
greenrd 01/01/17 08:02:22
Modified: . changes.xml
src/org/apache/cocoon/processor/xsp XSPPage.java
src/org/apache/cocoon/framework XObject.java
xdocs faq.xml xspprocessor.xml
Added: src/org/apache/cocoon/xml XMLFragment.java
Log:
XMLFragment introduced, XObject deprecated
Revision Changes Path
1.180 +6 -1 xml-cocoon/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/changes.xml,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -r1.179 -r1.180
--- changes.xml 2001/01/16 22:34:58 1.179
+++ changes.xml 2001/01/17 16:02:19 1.180
@@ -4,7 +4,7 @@
<!--
History of Cocoon changes
- $Id: changes.xml,v 1.179 2001/01/16 22:34:58 greenrd Exp $
+ $Id: changes.xml,v 1.180 2001/01/17 16:02:19 greenrd Exp $
-->
<changes title="History of Changes">
@@ -18,6 +18,11 @@
</devs>
<release version="@version@" date="@date@">
+ <action dev="RDG" type="update">
+ Obsolete XObject now replaced by org.apache.cocoon.xml.XMLFragment.
+ This change was necessitated by the move to SAX2 in Cocoon 2.
+ XObject is deprecated and will stop working in Cocoon 2.
+ </action>
<action dev="RDG" type="fix">
Reversed store cleanup algorithm mistake. The store cleanup thread now works exactly as before.
</action>
1.2 +38 -0 xml-cocoon/src/org/apache/cocoon/xml/XMLFragment.java
1.9 +14 -4 xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPPage.java
Index: XSPPage.java
===================================================================
RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPPage.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XSPPage.java 2000/11/20 01:43:56 1.8
+++ XSPPage.java 2001/01/17 16:02:20 1.9
@@ -1,4 +1,4 @@
-/*-- $Id: XSPPage.java,v 1.8 2000/11/20 01:43:56 greenrd Exp $ --
+/*-- $Id: XSPPage.java,v 1.9 2001/01/17 16:02:20 greenrd Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -60,10 +60,11 @@
import org.apache.cocoon.parser.*;
import org.apache.cocoon.producer.*;
import org.apache.cocoon.framework.*;
+import org.apache.cocoon.xml.XMLFragment;
/**
* @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
- * @version $Revision: 1.8 $ $Date: 2000/11/20 01:43:56 $
+ * @version $Revision: 1.9 $ $Date: 2001/01/17 16:02:20 $
*/
public abstract class XSPPage extends AbstractProducer implements Cacheable {
protected Parser xspParser;
@@ -172,8 +173,17 @@
}
// Convertible to DOM
- if (v instanceof XObject){
- DocumentFragment fragment = factory.createDocumentFragment();
+ if (v instanceof XMLFragment) {
+ DocumentFragment fragment = factory.createDocumentFragment ();
+ ((XMLFragment) v).toDOM(fragment);
+ return fragment;
+ }
+
+ // Deprecated version of XMLFragment (see prev)
+ if (v instanceof XObject) {
+ // XXX: Should use logger instead
+ System.err.println ("Warning: XObject is deprecated and WILL NOT WORK in Cocoon 2. Use XMLFragment instead.");
+ DocumentFragment fragment = factory.createDocumentFragment ();
((XObject) v).toDOM(fragment);
return fragment;
}
1.3 +1 -0 xml-cocoon/src/org/apache/cocoon/framework/XObject.java
Index: XObject.java
===================================================================
RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/framework/XObject.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XObject.java 2000/02/13 18:29:23 1.2
+++ XObject.java 2001/01/17 16:02:21 1.3
@@ -59,6 +59,7 @@
* to provide an XML representation of their current state
*
* @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
+ * @deprecated
*/
public interface XObject {
1.45 +1 -1 xml-cocoon/xdocs/faq.xml
Index: faq.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/xdocs/faq.xml,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- faq.xml 2001/01/16 17:11:45 1.44
+++ faq.xml 2001/01/17 16:02:21 1.45
@@ -189,7 +189,7 @@
of this documentation (except insofar as it documents the specification of
<code><xsp:expr></code>) - see the DOM link above, and also the question on
<jump anchor="faq-goodbooks">"good books"</jump>. You can also generate
- <code>org.apache.cocoon.framework.XObject</code>s, and return both DOM and SAX,
+ <code>org.apache.cocoon.xml.XMLFragment</code>s, and return both DOM and SAX,
thus making your code (hopefully) more forward-compatible with Cocoon 2, which will be
SAX-based. (Actually using SAX is not strictly necessary, since DOM can always be
converted to SAX and vice-versa, but you will pay a performance penalty in Cocoon 2
1.11 +1 -1 xml-cocoon/xdocs/xspprocessor.xml
Index: xspprocessor.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/xdocs/xspprocessor.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- xspprocessor.xml 2001/01/17 15:33:05 1.10
+++ xspprocessor.xml 2001/01/17 16:02:21 1.11
@@ -392,7 +392,7 @@
<code>Text</code>. <strong>WARNING:</strong> This means that if you try to
insert some XML as a <code>String</code> using <code><xsp:expr></code>,
it will not work! Instead, you will need to <em>either</em> use
- <code><util:include-expr></code>, <em>or</em> build <code>XObject</code>s
+ <code><util:include-expr></code>, <em>or</em> build <code>XMLFragment</code>s
or <code>org.w3c.dom.Node</code>s instead - please read the
<link href="faqs.html#faq-xspinsertxml">FAQ</link> on this before asking
questions about it.