You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by cr...@apache.org on 2009/06/01 17:15:30 UTC
svn commit: r780675 - in /forrest/trunk:
main/fresh-site/src/documentation/content/xdocs/
main/fresh-site/src/documentation/content/xdocs/samples-b/ main/webapp/
site-author/
Author: crossley
Date: Mon Jun 1 15:15:27 2009
New Revision: 780675
URL: http://svn.apache.org/viewvc?rev=780675&view=rev
Log:
Demonstration of using xml source documents without declaring a DTD
Issue: FOR-1173
Added:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd-xinclude.xml (with props)
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd.xml (with props)
Modified:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site.xml
forrest/trunk/main/webapp/forrest.xmap
forrest/trunk/site-author/status.xml
Added: forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd-xinclude.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd-xinclude.xml?rev=780675&view=auto
==============================================================================
--- forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd-xinclude.xml (added)
+++ forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd-xinclude.xml Mon Jun 1 15:15:27 2009
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<p>
+ This paragraph is included using <a href="site:xinclude">XInclude</a>.
+</p>
Propchange: forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd-xinclude.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd.xml?rev=780675&view=auto
==============================================================================
--- forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd.xml (added)
+++ forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd.xml Mon Jun 1 15:15:27 2009
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<?schema apache.org/forrest/schema/xdoc/document/2.0?>
+<document xmlns:xi="http://www.w3.org/2001/XInclude">
+ <header>
+ <title>Process xml source documents without DTD declaration</title>
+ </header>
+ <body>
+ <p>
+ The xml source documents that have a Document Type Declaration using
+ a Public Identifier are automatically handled by the <code>forrest.xmap</code>
+ sitemap using the <a href="ext:forrest/cap">SourceTypeAction (Content Aware Pipelines)</a>.
+ </p>
+ <p>
+ Using a DTD is not always desirable, so another mechanism is needed to
+ detect the content type. SourceTypeAction can instead detect an xml
+ "Processing Instruction".
+ </p>
+ <p>
+ The source for this current document starts like this ...
+ </p>
+ <source>
+<![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<?schema apache.org/forrest/schema/xdoc/document/2.0?>
+<document>
+ <header>
+ ...]]></source>
+ <p>
+ Note that there is no space before the closing of the processing-instruction.
+ </p>
+ <p>
+ Similarly, a howto document is declared like this ...
+ </p>
+ <source>
+<![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<?schema apache.org/forrest/schema/xdoc/howto/2.0?>
+<howto>
+ <header>
+ ...]]></source>
+ <p>
+ Such documents are not validated by 'forrest validate-xdocs'. Instead see
+ <a href="ext:forrest/dev/debug-validation">Using Cocoon Validation Transformers</a>.
+ </p>
+ <p>
+ See further notes at Issue
+ <a href="https://issues.apache.org/jira/browse/FOR-1173">FOR-1173</a>.
+ </p>
+ <xi:include href="cocoon://samples-b/no-dtd-xinclude.xml"/>
+ </body>
+</document>
Propchange: forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/no-dtd.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site.xml?rev=780675&r1=780674&r2=780675&view=diff
==============================================================================
--- forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site.xml (original)
+++ forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site.xml Mon Jun 1 15:15:27 2009
@@ -72,6 +72,8 @@
<xml-entities label="XML entities" href="xml-entities.html"
description="Using XML entities for character replacements"/>
<xi:include href="site-xinclude.xml"/>
+ <no-dtd label="No DTD" href="no-dtd.html"
+ description="Process xml source documents without DTD declaration"/>
<faq label="FAQ" href="faq.html" description="Frequently Asked Questions"/>
<locationmap label="Locationmap" href="locationmap/index.html"
description="Locationmaps allow the user URL space to be different from the storage URL Space"/>
@@ -114,9 +116,13 @@
<linking href="docs/linking.html"/>
<validation href="docs/validation.html"/>
<webapp href="docs/your-project.html#webapp"/>
+ <cap href="docs/cap.html"/>
<dtd-docs href="docs/dtd-docs.html"/>
<new_content_type href="docs/your-project.html#adding_new_content_type"/>
<buildPlugin href="docs/howto/howto-buildPlugin.html"/>
+ <dev href="howto-dev.html">
+ <debug-validation href="#debug-validation"/>
+ </dev>
</forrest>
<forrest-zone href="http://forrest.zones.apache.org/"/>
<cocoon href="http://cocoon.apache.org/"/>
Modified: forrest/trunk/main/webapp/forrest.xmap
URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/forrest.xmap?rev=780675&r1=780674&r2=780675&view=diff
==============================================================================
--- forrest/trunk/main/webapp/forrest.xmap (original)
+++ forrest/trunk/main/webapp/forrest.xmap Mon Jun 1 15:15:27 2009
@@ -86,15 +86,31 @@
<sourcetype name="document-v20">
<document-declaration public-id="-//APACHE//DTD Documentation V2.0//EN" />
</sourcetype>
+ <sourcetype name="p-document-v20">
+ <processing-instruction target="schema"
+ data="apache.org/forrest/schema/xdoc/document/2.0"/>
+ </sourcetype>
<sourcetype name="todo-v20">
<document-declaration public-id="-//APACHE//DTD Todo V2.0//EN" />
</sourcetype>
+ <sourcetype name="p-todo-v20">
+ <processing-instruction target="schema"
+ data="apache.org/forrest/schema/xdoc/todo/2.0"/>
+ </sourcetype>
<sourcetype name="changes-v20">
<document-declaration public-id="-//APACHE//DTD Changes V2.0//EN" />
</sourcetype>
+ <sourcetype name="p-changes-v20">
+ <processing-instruction target="schema"
+ data="apache.org/forrest/schema/xdoc/changes/2.0"/>
+ </sourcetype>
<sourcetype name="howto-v20">
<document-declaration public-id="-//APACHE//DTD How-to V2.0//EN" />
</sourcetype>
+ <sourcetype name="p-howto-v20">
+ <processing-instruction target="schema"
+ data="apache.org/forrest/schema/xdoc/howto/2.0"/>
+ </sourcetype>
</map:action>
</map:actions>
<map:selectors default="parameter">
@@ -122,6 +138,9 @@
<map:when test="document-v20">
<map:transform src="{lm:transform.docv20.docv13}" />
</map:when>
+ <map:when test="p-document-v20">
+ <map:transform src="{lm:transform.docv20.docv13}" />
+ </map:when>
<map:when test="howto-v10">
<map:transform src="{lm:transform.howto.document}" />
</map:when>
@@ -138,6 +157,10 @@
<map:transform src="{lm:transform.howto.document}" />
<map:transform src="{lm:transform.docv20.docv13}" />
</map:when>
+ <map:when test="p-howto-v20">
+ <map:transform src="{lm:transform.howto.document}" />
+ <map:transform src="{lm:transform.docv20.docv13}" />
+ </map:when>
<map:when test="todo-v10">
<map:transform src="{lm:transform.todo.document}" />
</map:when>
@@ -153,6 +176,9 @@
<map:when test="todo-v20">
<map:transform src="{lm:transform.todo.document}" />
</map:when>
+ <map:when test="p-todo-v20">
+ <map:transform src="{lm:transform.todo.document}" />
+ </map:when>
<map:when test="changes-v10">
<map:transform src="{lm:transform.changesv10.changesv11}" />
<map:transform src="{lm:transform.changesv.document}" />
@@ -169,6 +195,9 @@
<map:when test="changes-v20">
<map:transform src="{lm:transform.changesv.document}" />
</map:when>
+ <map:when test="p-changes-v20">
+ <map:transform src="{lm:transform.changesv.document}" />
+ </map:when>
<map:otherwise />
</map:select>
</map:act>
Modified: forrest/trunk/site-author/status.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/site-author/status.xml?rev=780675&r1=780674&r2=780675&view=diff
==============================================================================
--- forrest/trunk/site-author/status.xml (original)
+++ forrest/trunk/site-author/status.xml Mon Jun 1 15:15:27 2009
@@ -155,6 +155,10 @@
</action>
<!-- 2009-06 -->
+ <action context="code" type="add" dev="DC" fixes-bug="FOR-1173" importance="high">
+ Added a demonstration of using xml source documents without declaring a
+ DTD. See example "no-dtd" in the 'forrest seed sample' site.
+ </action>
<action context="code" type="add" dev="DC" fixes-bug="FOR-1172" importance="high">
Added the ability to use RELAXNG to validate intermediate xml.
Do 'localhost:8888/index.validation.xml' for example.