summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2011-06-15 14:46:32 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2011-06-15 14:46:32 -0400
commitbf5541fb963bfa01e0d9bdf03e80cf2d2a77bfd5 (patch)
tree2807a890c9fd5c7d3d0610943eaf856cfe2c5422 /doc
parent0366ab745df68660f5966c7fb901766bc2c2d4d4 (diff)
parenteec6ed6c3295755d00abdd40d82b6cfd0a023c2e (diff)
downloadbcfg2-bf5541fb963bfa01e0d9bdf03e80cf2d2a77bfd5.tar.gz
bcfg2-bf5541fb963bfa01e0d9bdf03e80cf2d2a77bfd5.tar.bz2
bcfg2-bf5541fb963bfa01e0d9bdf03e80cf2d2a77bfd5.zip
Merge branch 'work'
Diffstat (limited to 'doc')
-rw-r--r--doc/server/plugins/connectors/properties.txt17
1 files changed, 14 insertions, 3 deletions
diff --git a/doc/server/plugins/connectors/properties.txt b/doc/server/plugins/connectors/properties.txt
index 1cbc4cf65..3329f48bd 100644
--- a/doc/server/plugins/connectors/properties.txt
+++ b/doc/server/plugins/connectors/properties.txt
@@ -38,7 +38,7 @@ Usage
Specific property files can be referred to in
templates as ``metadata.Properties[<filename>]``. The
-data attribute is an LXML element object. (Documented
+``xdata`` attribute is an LXML element object. (Documented
`here <http://codespeak.net/lxml/tutorial.html#the-element-class>`_)
Currently, only one access method is defined for this data, ``Match``.
@@ -56,10 +56,21 @@ more details on how Group and Client tags are parsed.) For instance::
As we formulate more common use cases, we will add them to the
!PropertyFile class as methods. This will simplify templates.
+You can also access the XML data that comprises a property file
+directly in one of several ways:
+
+* ``metadata.Properties['prop-file'].xdata`` is an lxml.etree._Element
+ object representing the top-level element in the file.
+* ``metadata.Properties['prop-file'].data`` is the raw contents of the
+ property file as a string.
+* ``metadata.Properties['prop-file'].entries`` is a list of
+ lxml.etree._Element objects representing the direct children of the
+ top-level element. (I.e., everything directly under the
+ ``<Properties>`` tag.)
+
Accessing Properties contents from TGenshi
==========================================
Access contents of ``Properties/auth.xml``::
-
- ${metadata.Properties['auth.xml'].data.find('file').find('bcfg2.key').text}
+ ${metadata.Properties['auth.xml'].xdata.find('file').find('bcfg2.key').text}