sylvain 2003/03/08 06:15:46
Modified: src/blocks/html/java/org/apache/cocoon/generation
HTMLGenerator.java
src/java/org/apache/cocoon/xml/dom DOMStreamer.java
src/webapp sitemap.xmap
src/webapp/samples/catalog sitemap.xmap
src/webapp/samples/i18n sitemap.xmap
src/webapp/samples/xmlform sitemap.xmap
Log:
- Fix again DOMStreamer
- Start to fix the samples (mind reading matthew ?)
Revision Changes Path
1.7 +2 -2
xml-cocoon2/src/blocks/html/java/org/apache/cocoon/generation/HTMLGenerator.java
Index: HTMLGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/blocks/html/java/org/apache/cocoon/generation/HTMLGenerator.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- HTMLGenerator.java 3 Mar 2003 22:44:10 -0000 1.6
+++ HTMLGenerator.java 8 Mar 2003 14:15:45 -0000 1.7
@@ -337,7 +337,7 @@
}
} else {
DOMStreamer streamer = new
DOMStreamer(this.contentHandler,this.lexicalHandler);
- streamer.setNormalizeNamespacesOn(false);
+ streamer.setNormalizeNamespaces(false);
streamer.stream(doc);
}
} catch (IOException e){
1.12 +18 -13 xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DOMStreamer.java
Index: DOMStreamer.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/xml/dom/DOMStreamer.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- DOMStreamer.java 8 Mar 2003 10:29:30 -0000 1.11
+++ DOMStreamer.java 8 Mar 2003 14:15:45 -0000 1.12
@@ -75,7 +75,7 @@
* events from a W3C DOM Document.
*
* <p>The DOMStreamer uses a different strategy based on the value of the
- * normalizeNamespacesOn property:
+ * normalizeNamespaces property:
* <ul>
* <li>if true (the default), the DOMStreamer will normalize namespace
* declarations (i.e. add missing xmlns attributes or correct them). See
@@ -91,7 +91,7 @@
public class DOMStreamer implements XMLProducer {
/** Indicates whether namespace normalization should happen. */
- protected boolean normalizeNamespacesOn = true;
+ protected boolean normalizeNamespaces = true;
/** DOMStreamer used in case of namespace normalization. */
protected NamespaceNormalizingDOMStreamer namespaceNormalizingDOMStreamer = new
NamespaceNormalizingDOMStreamer();
@@ -169,24 +169,24 @@
* Start the production of SAX events.
*/
public void stream(Node node) throws SAXException {
- if (normalizeNamespacesOn)
+ if (normalizeNamespaces)
namespaceNormalizingDOMStreamer.stream(node);
else
defaultDOMStreamer.stream(node);
}
- public boolean isNormalizeNamespacesOn() {
- return normalizeNamespacesOn;
+ public boolean isNormalizeNamespaces() {
+ return normalizeNamespaces;
}
- public void setNormalizeNamespacesOn(boolean normalizeNamespacesOn) {
- this.normalizeNamespacesOn = normalizeNamespacesOn;
+ public void setNormalizeNamespaces(boolean normalizeNamespaces) {
+ this.normalizeNamespaces = normalizeNamespaces;
}
public void recycle() {
defaultDOMStreamer.recycle();
namespaceNormalizingDOMStreamer.recycle();
- normalizeNamespacesOn = true;
+ normalizeNamespaces = true;
}
/**
@@ -247,8 +247,11 @@
*/
protected void stream(Node pos) throws SAXException {
- // (SW) we stream a fragment, and not a complete document
- //contentHandler.startDocument();
+ // Start document only if we're streaming a document
+ boolean isDoc = (pos.getNodeType() == Node.DOCUMENT_NODE);
+ if (isDoc) {
+ contentHandler.startDocument();
+ }
Node top = pos;
@@ -281,8 +284,10 @@
pos = nextNode;
}
- // (SW) we stream a fragment, and not a complete document
- //contentHandler.endDocument();
+
+ if (isDoc) {
+ contentHandler.endDocument();
+ }
}
private final void dispatachChars(Node node) throws SAXException {
1.92 +7 -0 xml-cocoon2/src/webapp/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/webapp/sitemap.xmap,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- sitemap.xmap 1 Mar 2003 15:44:06 -0000 1.91
+++ sitemap.xmap 8 Mar 2003 14:15:46 -0000 1.92
@@ -433,6 +433,13 @@
</map:match>
<!--+
+ | "Old" location of the documentation, should be replaced in samples by
"documentation".
+ +-->
+ <map:match pattern="documents/**">
+ <map:mount src="documentation/" uri-prefix="documents"/>
+ </map:match>
+
+ <!--+
| Mount everything else by calling the sitemap.xmap file located
| in the requested folder.
+-->
1.2 +6 -6 xml-cocoon2/src/webapp/samples/catalog/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/catalog/sitemap.xmap,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sitemap.xmap 20 Feb 2003 18:18:44 -0000 1.1
+++ sitemap.xmap 8 Mar 2003 14:15:46 -0000 1.2
@@ -28,24 +28,24 @@
<!-- Catalog entity resolver =========================== -->
<map:match pattern="catalog-demo">
- <map:generate src="catalog/catalog-demo.xml"/>
- <map:transform src="catalog/style.xsl"/>
+ <map:generate src="catalog-demo.xml"/>
+ <map:transform src="style.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="entity-test.html">
<map:generate src="catalog-test.xml"/>
- <map:transform src="catalog/style.xsl"/>
+ <map:transform src="style.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="sdocbook-demo.html">
- <map:read src="catalog/sdocbook-demo.html"/>
+ <map:read src="sdocbook-demo.html"/>
</map:match>
<map:match pattern="sdocbook-demo">
- <map:generate src="catalog/article.xml"/>
- <map:transform src="catalog/sdocbook2body.xsl"/>
+ <map:generate src="article.xml"/>
+ <map:transform src="sdocbook2body.xsl"/>
<map:serialize type="html"/>
</map:match>
1.8 +1 -1 xml-cocoon2/src/webapp/samples/i18n/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/i18n/sitemap.xmap,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- sitemap.xmap 19 Feb 2003 07:19:10 -0000 1.7
+++ sitemap.xmap 8 Mar 2003 14:15:46 -0000 1.8
@@ -70,7 +70,7 @@
<!-- Default pipeline -->
<map:match pattern="">
- <map:redirect-to uri="cocoon:/simple.xml"/>
+ <map:redirect-to uri="simple.xml"/>
</map:match>
<!-- Generate static output (simple.xml) -->
1.16 +3 -0 xml-cocoon2/src/webapp/samples/xmlform/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/xmlform/sitemap.xmap,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- sitemap.xmap 23 Feb 2003 19:21:41 -0000 1.15
+++ sitemap.xmap 8 Mar 2003 14:15:46 -0000 1.16
@@ -3,6 +3,9 @@
<!-- =========================== Components ================================ -->
<map:components>
+ <map:transformers default="xslt">
+ <map:transformer name="xmlform"
src="org.apache.cocoon.transformation.XMLFormTransformer"
logger="xmlform.sitemap.transformer"/>
+ </map:transformers>
<map:actions>
<map:action name="WizardAction"
src="org.apache.cocoon.samples.xmlform.WizardAction"
logger="xmlform.sitemap.action.wizard"/>
<map:action name="UsageFeedbackAction"
src="org.apache.cocoon.samples.xmlform.UsageFeedbackAction"
logger="xmlform.sitemap.action.UsageFeedback"/>