[Zope3-checkins] CVS: zopeproducts/xml_examples - README.txt:1.1 __init__.py:1.1 apple.pt:1.1 configure.zcml:1.1 pear.pt:1.1

Philipp von Weitershausen philikon@philikon.de
Fri, 11 Apr 2003 04:12:09 -0400


Update of /cvs-repository/zopeproducts/xml_examples
In directory cvs.zope.org:/tmp/cvs-serv18805/xml_examples

Added Files:
	README.txt __init__.py apple.pt configure.zcml pear.pt 
Log Message:
Added example product for Zope3's XML Architecture.


=== Added File zopeproducts/xml_examples/README.txt ===

Zope3 XML Examples

  Installation

    In order to use these examples, you will have to include the package in your
    products.zcml file.

  Views

    Create an XML Document called 'apple.xml' or similar and edit its contents to
    the following::

      <fruit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://xml.zope.org/zopeproducts/xml_examples/apple">
      </fruit>

    Then point your browser at the URL of this XML document. You will see the
    view for apples. If you change the schema declaration to
    http://xml.zope.org/zopeproducts/xml_examples/pear and view the object, you
    will see the view for pears.


=== Added File zopeproducts/xml_examples/__init__.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""
$Id: __init__.py,v 1.1 2003/04/11 08:12:08 philikon Exp $
"""


=== Added File zopeproducts/xml_examples/apple.pt ===
<html>
<body>
This is an XML Apple at <p tal:content="context/@@absolute_url"></p>.
</body>
</html>


=== Added File zopeproducts/xml_examples/configure.zcml ===
<zopeConfigure
   xmlns="http://namespaces.zope.org/zope"
   xmlns:browser="http://namespaces.zope.org/browser"
   xmlns:zopexml="http://namespaces.zope.org/zope-xml">

<!-- First, we define two schema interfaces. They don't have to exist at their
     specified URIs for this application (they have to for more advanced
     uses) -->

<zopexml:schemaInterface
    uri="http://xml.zope.org/zopeproducts/xml_examples/apple" />

<zopexml:schemaInterface
    uri="http://xml.zope.org/zopeproducts/xml_examples/pear" />

<!-- Then we define a view for each one -->

<browser:page
    name="apple.html"
    for="http://xml.zope.org/zopeproducts/xml_examples/apple"
    template="apple.pt"
    permission="zope.View" />

<browser:page
    name="pear.html"
    for="http://xml.zope.org/zopeproducts/xml_examples/pear"
    template="pear.pt"
    permission="zope.View" />

<!-- Now we set the views to the default views -->

<browser:defaultView
    for="http://xml.zope.org/zopeproducts/xml_examples/apple"
    name="apple.html" />

<browser:defaultView
    for="http://xml.zope.org/zopeproducts/xml_examples/pear"
    name="pear.html" />

</zopeConfigure>


=== Added File zopeproducts/xml_examples/pear.pt ===
<html>
<body>
This is an XML Pear at <p tal:content="context/@@absolute_url"></p>
Hmmm, juicy.
</body>
</html>