Added: forrest/site/docs_0_70/cap.html URL: http://svn.apache.org/viewcvs/forrest/site/docs_0_70/cap.html?rev=193078&view=auto ============================================================================== --- forrest/site/docs_0_70/cap.html (added) +++ forrest/site/docs_0_70/cap.html Wed Jun 22 22:36:19 2005 @@ -0,0 +1,382 @@ + + + + + + + +SourceTypeAction (content aware pipelines) (v0.7) + + + + + + + + + +
+
+apache > forrest +
+
+ + + + +
+
+
+
+
+ +
+
+ +   +
+ +
+ +
+Font size: +   +   +   +
+

SourceTypeAction (content aware pipelines)

+
+ This is documentation for current version v0.7 + (More)
+
+ +
+ + +

Introduction

+
+

SourceTypeAction assigns a "type" (a string) to an XML file. This is + done based on information occuring in the header of the XML file, up to the + document (root) element. This type is then returned to the sitemap as a + variable with the name 'sourcetype'. If no matching sourcetype could be be + found, null is returned and thus the contents of the action element will not be + executed.

+

SourceTypeAction works by pull-parsing the document and collecting + information such as the Public Id, the processing instructions, the document + element local name and namespace, and the xsi:schemaLocation and + xsi:noNamespaceSchemaLocation attributes. This information is then compared + with the rules described in the configuration of the SourceTypeAction.

+
+ + +

Configuration

+
+

The action should be declared and configured in the map:actions + section of your sitemap. Example:

+
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+ <map:components>
+  <...>
+  <map:actions>
+   <map:action name="sourcetype"
+      src="org.apache.forrest.sourcetype.SourceTypeAction">
+    <sourcetype name="download-v1.0">
+     <document-declaration
+        public-id="-//Acme//DTD Download Documentation V1.0//EN" />
+    </sourcetype>      
+   </map:action>
+  </map:actions>
+ </map:components>
+ <...>
+</map:sitemap>
+

There are other examples in main/webapp/forrest.xmap +

+

Each sourcetype-tag declares a source type. Inside the sourcetype-tag + a number of rules can be defined, described below. The sourcetypes will be + checked in the same order as they are defined in the configuration, the first + sourcetype of which all rules match will be used.

+

These are the available rules:

+
+ +
document-declaration
+ +
This rule checks the public ID. It takes one attribute + public-id.
+ +
document-element
+ +
This rule checks the local name and/or namespace of the document + element. These are specified with the attributes local-name and + namespace. At least one of these two is required.
+ +
processing-instruction
+ +
This rule checks a processing instruction. It can take two + attributes: target and data. The target attribute is + always required, the data attribute is optional.
+ +
w3c-xml-schema
+ +
This rule checks the value of the xsi:schemaLocation and + xsi:noNamespaceSchemaLocation attributes on the document element. These are + specified with the attributes schema-location and + no-namespace-schema-location.
+ +
+

+ Perhaps you need other methods. Please enhance the source at + main/java/org/apache/forrest/sourcetype + +

+
+ + +

Usage

+
+

The source of which the sourcetype must be defined must be specified + using the 'src' attribute on the map:act element.

+
<map:act type="sourcetype" src="{1}">
+...
+</map:act>
+

See a real-life example in the advanced section of the + Using Forrest + document. +

+
+ +
+
 
+
+ + + Propchange: forrest/site/docs_0_70/cap.html ------------------------------------------------------------------------------ svn:eol-style = native Added: forrest/site/docs_0_70/cap.pdf URL: http://svn.apache.org/viewcvs/forrest/site/docs_0_70/cap.pdf?rev=193078&view=auto ============================================================================== Binary file - no diff available. Propchange: forrest/site/docs_0_70/cap.pdf ------------------------------------------------------------------------------ svn:mime-type = application/pdf Added: forrest/site/docs_0_70/catalog.html URL: http://svn.apache.org/viewcvs/forrest/site/docs_0_70/catalog.html?rev=193078&view=auto ============================================================================== --- forrest/site/docs_0_70/catalog.html (added) +++ forrest/site/docs_0_70/catalog.html Wed Jun 22 22:36:19 2005 @@ -0,0 +1,542 @@ + + + + + + + +Using Catalog Entity Resolver for local DTDs (v0.7) + + + + + + + + + +
+
+apache > forrest +
+
+ + + + +
+
+
+
+
+ +
+
+ +   +
+ +
+ +
+Font size: +   +   +   +
+

Using Catalog Entity Resolver for local DTDs

+
+ This is documentation for current version v0.7 + (More)
+ + + +

Overview

+
+

+ This is a collection of notes for configuring the Catalog Entity + Resolver with your favourite XML tools (validating parsers and + editors). +

+

+ All XML documents declare their ruleset - the Document Type Definition + (DTD). When Forrest processes the documents, it uses the Resolver to + find Forrest's local copies of the DTDs, rather than trundling out + onto the network. +

+

+ Many Java-based XML tools already have an entity resolver, probably + the same one that Forrest uses. Many non-Java tools also have an + entity resolver. To use these tools with documents based on the + Forrest DTDs, you need to configure the tools. +

+
+
Note
+
+ The information provided here is not intended to endorse any + particular tool. +
+
+

+ If you have any other configuration tips for a particular tool, then + please send them to the forrest-dev mailing list. +

+
+ + + +

General configuration notes

+
+

+ The Forrest DTDs and supporting resources are in the Forrest + distribution at main/webapp/resources/schema/ + +

+

+ Usually all that is required is to direct your tool to the "catalog" + supplied by Forrest at either: + $FORREST_HOME/main/webapp/resources/schema/catalog.xcat + (for XML Catalog) or + $FORREST_HOME/main/webapp/resources/schema/catalog + (for TR 9401 Catalog). +

+
+ + + +

Configuring specific tools

+
+ +

Operating system catalog

+

+ Some operating systems already provide a system-wide catalog that + is used by many tools. This is usually located at + /etc/xml/catalog or at + /usr/share/sgml/catalog files. +

+

+ For an XML Catalog, add this line: +

+
+<nextCatalog
+catalog="/usr/local/svn/forrest/main/webapp/resources/schema/catalog.xcat"/>
+        
+

+ For a TR 9401 Catalog, add this line: +

+
+CATALOG \
+"/usr/local/svn/forrest/main/webapp/resources/schema/catalog"
+        
+

+ Actually you probably do not want to touch that system catalog, + so rather create your own catalog file in your home directory + which refers to both the Forrest catalog and your system catalog. +

+ +

xmllint validating parser

+

+ "xmllint" is part of the "libxml2" package. + It is very fast and powerful, with are many facilities. It can + validate whole directories of files at once. + Set the SGML_CATALOG_FILES environment variable. +

+
+export SGML_CATALOG_FILES=$SGML_CATALOG_FILES:\
+$FORREST_HOME/main/webapp/resources/schema/catalog
+xmllint --valid --catalogs --noout mydoc.xml
+        
+ +

Vim

+

+ The following .vimrc entries are useful: +

+
+au FileType xml set efm=%A%f:%l:\ %.%#error:\ %m,%-Z%p^,%-C%.%#
+au FileType xml set makeprg=xmllint\ --noout\ --valid\ --catalogs\ %
+        
+ +

Emacs

+

See + nXML mode + and + FAQ. +

+ +

onsgmls validating parser

+

+ "onsgmls" is part of the "Open SP" package. + You need to also tell it where to find an "SGML declaration". + The easiest way is to create your own little "my-catalog" file, + containing this: +

+
+SGMLDECL "/usr/share/sgml/xml.dcl"
+CATALOG \
+"/usr/local/svn/forrest/main/webapp/resources/schema/catalog"
+        
+

+ Then point the parser at it: +

+
+onsgmls -c path/to/my-catalog -wall -wxml -s mydoc.xml
+        
+ +

jEdit - Open Source programmer's text editor

+
+Select the menu:
+Utilities > Global Options > Plugins:XML > Catalogs
+Select the "+" button, and use the "File System Browser"
+to specify the TR9401 Catalog file:
+"forrest/main/webapp/resources/schema/catalog"
+        
+
+On version 4.2. Select the menu:
+Plugins > Plugins Options > Plugins:XML > Catalogs
+Select the "+" button, and use the "File System Browser"
+to specify the TR9401 Catalog file:
+"forrest/main/webapp/resources/schema/catalog"
+        
+ +

oXygen XML Editor

+
+Select the menu:
+Options > Preferences > XML Catalog
+Specify the XML Catalog file:
+"forrest/main/webapp/resources/schema/catalog.xcat"
+        
+ +

xmlspy

+
+Add the following entry to the file CustomCatalog.xml
+(located in XMLSpy install directory):
+
+<nextCatalog
+catalog="file://localhost/C:/apache/forrest/main/webapp/
+resources/schema/catalog.xcat"/>
+        
+ +

XMLmind XML Editor (XXE)

+ +

XXE v2.5p2 or older

+
+Select the menu:
+Options > Options > Schema > Add File
+Specify the XML Catalog file:
+"forrest/main/webapp/resources/schema/catalog.xcat"
+        
+ +

XXE v2.5p3+

+

XXE supports catalogs by automatic detection via configuration files. + Download the XXE + Forrest Config files from splike.com; this also add support for WYSIWYG + editing of forrest documents. + Note: This configuration suite has recently been added to the + Forrest scratchpad. +

+
+ + + +

Further information and resources

+
+

+ Forrest and Cocoon use the + Catalog + Entity Resolver + that is provided by the + Apache XML Commons + project. The resolver is packaged with the Forrest distribution at + lib/core/xml-commons-resolver-x.y.jar + +

+

+ Other Forrest documentation has some notes about configuring the + entity resolver for your own DTDs. See + XML Validation. +

+

+ Cocoon has extensive documentation about the entity resolver. See + Entity resolution with catalogs. +

+
+ +
+
 
+
+ + + Propchange: forrest/site/docs_0_70/catalog.html ------------------------------------------------------------------------------ svn:eol-style = native Added: forrest/site/docs_0_70/catalog.pdf URL: http://svn.apache.org/viewcvs/forrest/site/docs_0_70/catalog.pdf?rev=193078&view=auto ============================================================================== Binary file - no diff available. Propchange: forrest/site/docs_0_70/catalog.pdf ------------------------------------------------------------------------------ svn:mime-type = application/pdf