This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
expression/vhosts/dbxmltest/create_test_dbxml.py

29 lines
798 B
Python
Executable File

#!/usr/bin/python
# -*- coding: utf-8 -*-
import dbxml
books = {
'short' : '<short />',
'oui oui' : '<book><title>Oui oui à la plage</title></book>',
'article' : '''<?xml version="1.0"?>
<article xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
<title>This is the article title</title>
<body>This is the article body.&#13;
Just for testing.</body>
</article>''',
'article2' : '''<?xml version="1.0"?>
<article xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
<title>Another article</title>
<body>Bla bla bla.</body>
</article>''',
}
manager = dbxml.XmlManager()
updateContext = manager.createUpdateContext()
container = manager.createContainer("test.dbxml")
for name in books.keys():
container.putDocument(name, books[name], updateContext)