cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject cvs commit: cocoon-2.1/src/documentation/xdocs/userdocs/generators xpathdirectory-generator.xml
Date Thu, 03 Jul 2003 00:03:55 GMT
joerg       2003/07/02 17:03:55

  Added:       src/documentation/xdocs/userdocs/generators
  initial import: additional configuration, extended DTD + example for XPathDirectoryGenerator
  Revision  Changes    Path
  1.1                  cocoon-2.1/src/documentation/xdocs/userdocs/generators/xpathdirectory-generator.xml
  Index: xpathdirectory-generator.xml
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "document-v10.dtd">
      <title>XPath Directory Generator</title>
      <type>Technical document</type>
        <person name="Jörg Heinicke" email=""/>
      <abstract>This document describes the XPath Directory Generator of Cocoon.</abstract>
      <s1 title="XPath Directory Generator">
        <p>Generates an XML directory listing performing XPath queries on XML files.</p>
          <li>Name: xpathdirectory</li>
          <li>Class: org.apache.cocoon.generation.XPathDirectoryGenerator</li>
          <li>Cacheable: yes</li>
        <p>The XPath Directory Generator provides all the functionality of the
          <link href="directory-generator.html">Directory Generator</link>. Additionaly
it is possible
          to get XML snippets out of the XML files the Directory Generator finds.</p>
      <s1 title="Additional Configuration">
    <map:generate type="xpathdirectory" src="the/requested/directory">
      <map:parameter name="xpath" value="/article/title|/article/abstract"/>
      <map:parameter name="xmlFiles" value="\.x.*$"/>
        <p>The XPath Directory Generator has two additional parameters, both are optional.</p>
          <li>xpath: Sets the XPath the XPath Directory Generator should use for queries
on XML files.
              If you don't set this parameter it will behave like the Directory Generator.</li>
          <li>xmlFiles: The xml files pattern. Specifies the files that should be handled
as XML
              files. Only on the files matching this pattern an XPath query will be tried.
The XPath
              Directory Generator does not fail on files that are no XML files or that are
              well-formed or not valid. All Exceptions on parsing the files will be caught
              ignored. But of course useless parsing and throwing and catching exceptions
is very
              time consuming, so you should not make the pattern to generic.<br/>
              If you specify an empty pattern all files will be handled as XML files. The
              pattern when not specifying this parameter is <code>\.xml$</code>,
so that all files
              ending <code>.xml</code> are handled as XML files.<br/>
              The pattern is a regular expression as described in the API docs of the
              <link href="">
              Apache RegExp project</link>.</li>
      <s1 title="Extended DTD">
    <!ELEMENT directory (directory|file)*>
    <!ATTLIST directory
      name         CDATA #REQUIRED
      lastModified CDATA #REQUIRED
      date         CDATA #REQUIRED
      size         CDATA #REQUIRED
      requested    CDATA #IMPLIED
      sort         CDATA #IMPLIED
      reverse      CDATA #IMPLIED>
    <!ELEMENT file (xpath?)>
    <!ATTLIST file
      name         CDATA #REQUIRED
      lastModified CDATA #REQUIRED
      date         CDATA #REQUIRED
      size         CDATA #REQUIRED>
    <!ELEMENT xpath #ALL>
    <!ATTLIST xpath
      query        CDATA #REQUIRED>
      <s1 title="Example">
        <p>The current XPath Directory Generator may generate following xml:</p>
  <dir:directory xmlns:dir=""
      name="articles" lastModified="1057183738609" date="03.07.03 00:08" size="0"
      requested="true" sort="name" reverse="false">
    <dir:directory name="images" lastModified="1057183738609" date="03.07.03 00:08" size="0"/>
    <dir:file name="article1.xml" lastModified="1057183738609" date="03.07.03 00:08" size="123">
      <dir:xpath query="/article/title">
        <title>My first article!</title>
    <dir:file name="article2.html" lastModified="1057183738609" date="03.07.03 00:08" size="345"/>
    <dir:file name="article2.xml" lastModified="1057183738609" date="03.07.03 00:08" size="234">
      <dir:xpath query="/article/title">
        <title>My second article!</title>

View raw message