Author: crossley
Date: Thu Aug 7 01:21:24 2008
New Revision: 683540
URL: http://svn.apache.org/viewvc?rev=683540&view=rev
Log:
Add an example of using XInclude. Thanks to Carlos Tejo for the basic example.
Issue: FOR-814
Added:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-explanation.xml
(with props)
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec2.xml
(with props)
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec3.xml
(with props)
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec4.txt
(with props)
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude.xml
(with props)
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site-xinclude.xml
(with props)
Modified:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site.xml
forrest/trunk/site-author/status.xml
Added:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-explanation.xml
URL:
http://svn.apache.org/viewvc/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-explanation.xml?rev=683540&view=auto
==============================================================================
---
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-explanation.xml
(added)
+++
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-explanation.xml
Thu Aug 7 01:21:24 2008
@@ -0,0 +1,52 @@
+<?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.
+-->
+<section>
+ <title>Section 1</title>
+ <p>
+ For example, in the
+ <code>src/documentation/content/xdocs/samples-b</code> directory,
+ place the various files that are to be included,
+ and create a top-level XML file
+ (<a href="xinclude.xml"><code>samples-b/xinclude.xml</code></a>)
+ that combines them:
+ </p>
+ <source><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN"
"http://forrest.apache.org/dtd/document-v20.dtd">
+<document xmlns:xi="http://www.w3.org/2001/XInclude">
+ <header>
+ <title>XInclude Example</title>
+ </header>
+ <body>
+...
+ [the Introduction section was excluded from this source listing for brevity]
+...
+ <xi:include href="cocoon://samples-b/xinclude-explanation.xml"/>
+ <xi:include href="cocoon://samples-b/xinclude-input-sec2.xml"/>
+ <section>
+ <title>Section 3</title>
+ <xi:include
href="cocoon://samples-b/xinclude-input-sec3.xml#xpointer(/section/p)"/>
+ </section>
+ <section>
+ <title>Section 4</title>
+ <source><xi:include parse="text"
href="cocoon://samples-b/xinclude-input-sec4.txt"/></source>
+ </section>
+ </body>
+</document>]]>
+ </source>
+</section>
Propchange:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-explanation.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec2.xml
URL:
http://svn.apache.org/viewvc/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec2.xml?rev=683540&view=auto
==============================================================================
---
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec2.xml
(added)
+++
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec2.xml
Thu Aug 7 01:21:24 2008
@@ -0,0 +1,23 @@
+<?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.
+-->
+<section>
+ <title>Section 2</title>
+ <p>
+ Section 2 added from another XML file using xinclude.
+ </p>
+</section>
Propchange:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec2.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec3.xml
URL:
http://svn.apache.org/viewvc/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec3.xml?rev=683540&view=auto
==============================================================================
---
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec3.xml
(added)
+++
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec3.xml
Thu Aug 7 01:21:24 2008
@@ -0,0 +1,29 @@
+<?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.
+-->
+<section>
+ <title>Section 3 - not used</title>
+ <p>
+ First paragraph of Section 3 added from another XML file using xinclude
and xpointer.
+ </p>
+ <source>
+ Not used.
+ </source>
+ <p>
+ Second paragraph of Section 3 added from that same other XML file using
xinclude and xpointer. Note that the "source" element between the two "p"
elements was not used.
+ </p>
+</section>
Propchange:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec3.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec4.txt
URL:
http://svn.apache.org/viewvc/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec4.txt?rev=683540&view=auto
==============================================================================
---
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec4.txt
(added)
+++
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec4.txt
Thu Aug 7 01:21:24 2008
@@ -0,0 +1,3 @@
+This is plain text.
+
+It was included from a separate text file using xinclude.
Propchange:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude-input-sec4.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude.xml
URL:
http://svn.apache.org/viewvc/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude.xml?rev=683540&view=auto
==============================================================================
---
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude.xml
(added)
+++
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude.xml
Thu Aug 7 01:21:24 2008
@@ -0,0 +1,57 @@
+<?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.
+-->
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN"
"http://forrest.apache.org/dtd/document-v20.dtd">
+<document xmlns:xi="http://www.w3.org/2001/XInclude">
+ <header>
+ <title>XInclude Example</title>
+ </header>
+ <body>
+ <section>
+ <title>Introduction</title>
+ <p>
+ One xml file can include content from other xml files using
+ <a href="http://www.w3.org/TR/xinclude/">XInclude</a> "XML Inclusions".
+ </p>
+ <p>
+ To understand how this is handled internally, see the
+ <code>main/webapp/sitemap.xmap</code> and search for xinclude.
+ It uses the <a
href="http://cocoon.apache.org/2.1/userdocs/xinclude-transformer.html">Apache
Cocoon XInclude Transformer</a>.
+ </p>
+ <p>
+ The following sections are included from other files.
+ Section 1 (the whole section) is included from the
xinclude-explanation.xml file.
+ Section 2 (the whole section) is included from the
xinclude-input-sec2.xml file.
+ Section 3 (just the "p" elements) are included from the
xinclude-input-sec3.xml file using "xpointer".
+ Section 4 (just the text) is included from the xinclude-input-sec4.txt
file.
+ </p>
+ <p>
+ Using XInclude in the "site.xml" configuration is also demonstrated.
+ </p>
+ </section>
+ <xi:include href="cocoon://samples-b/xinclude-explanation.xml"/>
+ <xi:include href="cocoon://samples-b/xinclude-input-sec2.xml"/>
+ <section>
+ <title>Section 3</title>
+ <xi:include
href="cocoon://samples-b/xinclude-input-sec3.xml#xpointer(/section/p)"/>
+ </section>
+ <section>
+ <title>Section 4</title>
+ <source><xi:include parse="text"
href="cocoon://samples-b/xinclude-input-sec4.txt"/></source>
+ </section>
+ </body>
+</document>
Propchange:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/xinclude.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site-xinclude.xml
URL:
http://svn.apache.org/viewvc/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site-xinclude.xml?rev=683540&view=auto
==============================================================================
---
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site-xinclude.xml
(added)
+++
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site-xinclude.xml
Thu Aug 7 01:21:24 2008
@@ -0,0 +1,18 @@
+<?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.
+-->
+<xinclude label="XInclude" href="xinclude.html" description="Use XInclude to
add pieces of xml from other files"/>
Propchange:
forrest/trunk/main/fresh-site/src/documentation/content/xdocs/site-xinclude.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=683540&r1=683539&r2=683540&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 Thu
Aug 7 01:21:24 2008
@@ -36,8 +36,10 @@
always use index.html when you request http://yourHost/
See FAQ: "How can I use a start-up-page other than index.html?"
-->
-<site label="MyProj" href="" xmlns="http://apache.org/forrest/linkmap/1.0"
- tab="">
+<site label="MyProj" href="" tab=""
+ xmlns="http://apache.org/forrest/linkmap/1.0"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ >
<about label="About">
<index label="Index" href="index.html" description="Welcome to MyProj"/>
<linkmap label="Documentation ToC" href="linkmap.html" description="Table
of Contents for this example site"/>
@@ -69,6 +71,7 @@
<custom-example href="custom.html" description="A custom XML file"/>
<xml-entities label="XML entities" href="xml-entities.html"
description="Using XML entities for character replacements"/>
+ <xi:include href="site-xinclude.xml"/>
<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"/>
Modified: forrest/trunk/site-author/status.xml
URL:
http://svn.apache.org/viewvc/forrest/trunk/site-author/status.xml?rev=683540&r1=683539&r2=683540&view=diff
==============================================================================
--- forrest/trunk/site-author/status.xml (original)
+++ forrest/trunk/site-author/status.xml Thu Aug 7 01:21:24 2008
@@ -152,6 +152,9 @@
<link href="site:upgrading_09">upgrading to v0.9</link>
</action>
<!-- 2008-08 -->
+ <action context="docs" type="add" dev="DC" fixes-bug="FOR-814"
due-to="Carlos Tejo">
+ Added example of using XInclude to the 'forrest seed sample' site.
+ </action>
<action context="code" type="update" dev="DC" fixes-bug="FOR-1032">
Added ability to use XInclude to the document-v20 xdoc DTD.
See an example in a 'forrest seed sample' site.