diff --git a/libs/odf/GPL-LICENSE-2.txt b/libs/odf/GPL-LICENSE-2.txt
deleted file mode 100644
index d511905..0000000
--- a/libs/odf/GPL-LICENSE-2.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/libs/odf/__init__.py b/libs/odf/__init__.py
deleted file mode 100644
index 17c80e0..0000000
--- a/libs/odf/__init__.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2007 Søren Roug, European Environment Agency
-#
-# This is free software. You may redistribute it under the terms
-# of the Apache license and the GNU General Public License Version
-# 2 or at your option any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
diff --git a/libs/odf/anim.py b/libs/odf/anim.py
deleted file mode 100644
index 27dca36..0000000
--- a/libs/odf/anim.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import ANIMNS
-from element import Element
-
-
-# Autogenerated
-def Animate(**args):
- return Element(qname = (ANIMNS,'animate'), **args)
-
-def Animatecolor(**args):
- return Element(qname = (ANIMNS,'animateColor'), **args)
-
-def Animatemotion(**args):
- return Element(qname = (ANIMNS,'animateMotion'), **args)
-
-def Animatetransform(**args):
- return Element(qname = (ANIMNS,'animateTransform'), **args)
-
-def Audio(**args):
- return Element(qname = (ANIMNS,'audio'), **args)
-
-def Command(**args):
- return Element(qname = (ANIMNS,'command'), **args)
-
-def Iterate(**args):
- return Element(qname = (ANIMNS,'iterate'), **args)
-
-def Par(**args):
- return Element(qname = (ANIMNS,'par'), **args)
-
-def Param(**args):
- return Element(qname = (ANIMNS,'param'), **args)
-
-def Seq(**args):
- return Element(qname = (ANIMNS,'seq'), **args)
-
-def Set(**args):
- return Element(qname = (ANIMNS,'set'), **args)
-
-def Transitionfilter(**args):
- return Element(qname = (ANIMNS,'transitionFilter'), **args)
-
diff --git a/libs/odf/attrconverters.py b/libs/odf/attrconverters.py
deleted file mode 100644
index cbdd8f3..0000000
--- a/libs/odf/attrconverters.py
+++ /dev/null
@@ -1,1612 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2013 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-import sys, os.path
-sys.path.append(os.path.dirname(__file__))
-from namespaces import *
-import re, types
-
-pattern_color = re.compile(r'#[0-9a-fA-F]{6}')
-pattern_vector3D = re.compile(r'\([ ]*-?([0-9]+(\.[0-9]*)?|\.[0-9]+)([ ]+-?([0-9]+(\.[0-9]*)?|\.[0-9]+)){2}[ ]*\)')
-
-def make_NCName(arg):
- for c in (':',' '):
- arg = arg.replace(c,"_%x_" % ord(c))
- return arg
-
-def cnv_angle(attribute, arg, element):
- if sys.version_info[0]==2:
- return unicode(arg)
- else:
- return str(arg)
-
-def cnv_anyURI(attribute, arg, element):
- return str(arg)
-
-def cnv_boolean(attribute, arg, element):
- """ XML Schema Part 2: Datatypes Second Edition
- An instance of a datatype that is defined as boolean can have the
- following legal literals {true, false, 1, 0}
- """
- if str(arg).lower() in ("0","false","no"):
- return "false"
- if str(arg).lower() in ("1","true","yes"):
- return "true"
- raise ValueError( "'%s' not allowed as Boolean value for %s" % (str(arg), attribute[1]))
-
-# Potentially accept color values
-def cnv_color(attribute, arg, element):
- """ A RGB color in conformance with §5.9.11 of [XSL], that is a RGB color in notation “#rrggbb”, where
- rr, gg and bb are 8-bit hexadecimal digits.
- """
- return str(arg)
-
-def cnv_configtype(attribute, arg, element):
- if str(arg) not in ("boolean", "short", "int", "long",
- "double", "string", "datetime", "base64Binary"):
- raise ValueError( "'%s' not allowed" % str(arg))
- return str(arg)
-
-def cnv_data_source_has_labels(attribute, arg, element):
- if str(arg) not in ("none","row","column","both"):
- raise ValueError( "'%s' not allowed" % str(arg))
- return str(arg)
-
-# Understand different date formats
-def cnv_date(attribute, arg, element):
- """ A dateOrDateTime value is either an [xmlschema-2] date value or an [xmlschema-2] dateTime
- value.
- """
- return str(arg)
-
-def cnv_dateTime(attribute, arg, element):
- """ A dateOrDateTime value is either an [xmlschema-2] date value or an [xmlschema-2] dateTime
- value.
- """
- return str(arg)
-
-def cnv_double(attribute, arg, element):
- return str(arg)
-
-def cnv_draw_aspect(attribute, arg, element):
- if str(arg) not in ("content", "thumbnail", "icon", "print-view"):
- raise ValueError( "'%s' not allowed" % str(arg))
- return str(arg)
-
-def cnv_duration(attribute, arg, element):
- return str(arg)
-
-def cnv_family(attribute, arg, element):
- """ A style family """
- if str(arg) not in ("text", "paragraph", "section", "ruby", "table", "table-column", "table-row", "table-cell",
- "graphic", "presentation", "drawing-page", "chart"):
- raise ValueError( "'%s' not allowed" % str(arg))
- return str(arg)
-
-def __save_prefix(attribute, arg, element):
- prefix = arg.split(':',1)[0]
- if prefix == arg:
- return str(arg)
- namespace = element.get_knownns(prefix)
- if namespace is None:
- #raise ValueError( "'%s' is an unknown prefix" % str(prefix))
- return str(arg)
- p = element.get_nsprefix(namespace)
- return str(arg)
-
-def cnv_formula(attribute, arg, element):
- """ A string containing a formula. Formulas do not have a predefined syntax, but the string should
- begin with a namespace prefix, followed by a “:” (COLON, U+003A) separator, followed by the text
- of the formula. The namespace bound to the prefix determines the syntax and semantics of the
- formula.
- """
- return __save_prefix(attribute, arg, element)
-
-def cnv_ID(attribute, arg, element):
- return str(arg)
-
-def cnv_IDREF(attribute, arg, element):
- return str(arg)
-
-def cnv_integer(attribute, arg, element):
- return str(arg)
-
-pattern_language = re.compile(r'[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*')
-
-def cnv_language(attribute, arg, element):
- global pattern_language
- if not pattern_language.match(arg):
- raise ValueError( "'%s' is not a valid language token" % arg)
- return arg
-
-def cnv_legend_position(attribute, arg, element):
- if str(arg) not in ("start", "end", "top", "bottom", "top-start", "bottom-start", "top-end", "bottom-end"):
- raise ValueError( "'%s' not allowed" % str(arg))
- return str(arg)
-
-pattern_length = re.compile(r'-?([0-9]+(\.[0-9]*)?|\.[0-9]+)((cm)|(mm)|(in)|(pt)|(pc)|(px))')
-
-def cnv_length(attribute, arg, element):
- """ A (positive or negative) physical length, consisting of magnitude and unit, in conformance with the
- Units of Measure defined in §5.9.13 of [XSL].
- """
- global pattern_length
- if not pattern_length.match(arg):
- raise ValueError( "'%s' is not a valid length" % arg)
- return arg
-
-def cnv_lengthorpercent(attribute, arg, element):
- failed = False
- try: return cnv_length(attribute, arg, element)
- except: failed = True
- try: return cnv_percent(attribute, arg, element)
- except: failed = True
- if failed:
- raise ValueError( "'%s' is not a valid length or percent" % arg)
- return arg
-
-def cnv_list_linkage_type(attribute, arg, element):
- if arg not in ('selection','selection-indices'):
- raise ValueError( "'%s' is not either 'selection' or 'selection-indices'" % arg)
- return str(arg)
-
-def cnv_metavaluetype(attribute, arg, element):
- if str(arg) not in ("float", "date", "time", "boolean", "string"):
- raise ValueError( "'%s' not allowed" % str(arg))
- return str(arg)
-
-def cnv_major_minor(attribute, arg, element):
- if arg not in ('major','minor'):
- raise ValueError( "'%s' is not either 'minor' or 'major'" % arg)
- return str(arg)
-
-pattern_namespacedToken = re.compile(r'[0-9a-zA-Z_]+:[0-9a-zA-Z._\-]+')
-
-def cnv_namespacedToken(attribute, arg, element):
- global pattern_namespacedToken
-
- if not pattern_namespacedToken.match(arg):
- raise ValueError( "'%s' is not a valid namespaced token" % arg)
- return __save_prefix(attribute, arg, element)
-
-def cnv_NCName(attribute, arg, element):
- """ NCName is defined in http://www.w3.org/TR/REC-xml-names/#NT-NCName
- Essentially an XML name minus ':'
- """
- if (sys.version_info[0]==3 and isinstance(arg, str)) or (sys.version_info[0]==2 and type(arg) in types.StringTypes):
- return make_NCName(arg)
- else:
- return arg.getAttrNS(STYLENS, 'name')
-
-# This function takes either an instance of a style (preferred)
-# or a text string naming the style. If it is a text string, then it must
-# already have been converted to an NCName
-# The text-string argument is mainly for when we build a structure from XML
-def cnv_StyleNameRef(attribute, arg, element):
- try:
- return arg.getAttrNS(STYLENS, 'name')
- except:
- return arg
-
-# This function takes either an instance of a style (preferred)
-# or a text string naming the style. If it is a text string, then it must
-# already have been converted to an NCName
-# The text-string argument is mainly for when we build a structure from XML
-def cnv_DrawNameRef(attribute, arg, element):
- try:
- return arg.getAttrNS(DRAWNS, 'name')
- except:
- return arg
-
-# Must accept list of Style objects
-def cnv_NCNames(attribute, arg, element):
- return ' '.join(arg)
-
-def cnv_nonNegativeInteger(attribute, arg, element):
- return str(arg)
-
-pattern_percent = re.compile(r'-?([0-9]+(\.[0-9]*)?|\.[0-9]+)%')
-
-def cnv_percent(attribute, arg, element):
- global pattern_percent
- if not pattern_percent.match(arg):
- raise ValueError( "'%s' is not a valid length" % arg)
- return arg
-
-# Real one doesn't allow floating point values
-pattern_points = re.compile(r'-?[0-9]+,-?[0-9]+([ ]+-?[0-9]+,-?[0-9]+)*')
-#pattern_points = re.compile(r'-?[0-9.]+,-?[0-9.]+([ ]+-?[0-9.]+,-?[0-9.]+)*')
-def cnv_points(attribute, arg, element):
- global pattern_points
- if (sys.version_info[0]==3 and isinstance(arg, str)) or (sys.version_info[0]==2 and type(arg) in types.StringTypes):
- if not pattern_points.match(arg):
- raise ValueError( "x,y are separated by a comma and the points are separated by white spaces")
- return arg
- else:
- try:
- strarg = ' '.join([ "%d,%d" % p for p in arg])
- except:
- raise ValueError( "Points must be string or [(0,0),(1,1)] - not %s" % arg)
- return strarg
-
-def cnv_positiveInteger(attribute, arg, element):
- return str(arg)
-
-def cnv_rowOrCol(attribute, arg, element):
- if str(arg) not in ("row","column"):
- raise ValueError( "'%s' not allowed" % str(arg))
- return str(arg)
-
-def cnv_string(attribute, arg, element):
- if sys.version_info[0]==2:
- return unicode(arg)
- else:
- return str(arg)
-
-def cnv_stroke_linecap(attribute, arg, element):
- if str(arg) not in ("butt", "square", "round"):
- raise ValueError( "'%s' not allowed" % str(arg))
- return str(arg)
-
-def cnv_textnoteclass(attribute, arg, element):
- if str(arg) not in ("footnote", "endnote"):
- raise ValueError( "'%s' not allowed" % str(arg))
- return str(arg)
-
-# Understand different time formats
-def cnv_time(attribute, arg, element):
- return str(arg)
-
-def cnv_token(attribute, arg, element):
- return str(arg)
-
-pattern_viewbox = re.compile(r'-?[0-9]+([ ]+-?[0-9]+){3}$')
-
-def cnv_viewbox(attribute, arg, element):
- global pattern_viewbox
- if not pattern_viewbox.match(arg):
- raise ValueError( "viewBox must be four integers separated by whitespaces")
- return arg
-
-def cnv_xlinkshow(attribute, arg, element):
- if str(arg) not in ("new", "replace", "embed"):
- raise ValueError( "'%s' not allowed" % str(arg))
- return str(arg)
-
-def cnv_xlinktype(attribute, arg, element):
- if arg != "simple":
- raise ValueError( "Value of '%s' must be 'simple'" % attribute[1])
- return arg
-
-
-attrconverters = {
- ((ANIMNS,u'audio-level'), None): cnv_double,
- ((ANIMNS,u'color-interpolation'), None): cnv_string,
- ((ANIMNS,u'color-interpolation-direction'), None): cnv_string,
- ((ANIMNS,u'command'), None): cnv_string,
- ((ANIMNS,u'formula'), None): cnv_string,
- ((ANIMNS,u'id'), None): cnv_ID,
- ((ANIMNS,u'iterate-interval'), None): cnv_duration,
- ((ANIMNS,u'iterate-type'), None): cnv_string,
- ((ANIMNS,u'name'), None): cnv_string,
- ((ANIMNS,u'sub-item'), None): cnv_string,
- ((ANIMNS,u'value'), None): cnv_string,
-# ((DBNS,u'type'), None): cnv_namespacedToken,
- ((CHARTNS,u'angle-offset'), None): cnv_angle,
- ((CHARTNS,u'automatic-content'), None): cnv_boolean,
- ((CHARTNS,u'auto-position'), None): cnv_boolean,
- ((CHARTNS,u'auto-size'), None): cnv_boolean,
- ((CHARTNS,u'axis-label-position'), None): cnv_string, # Multi-value
- ((CHARTNS,u'axis-position'), None): cnv_string, # Multi-value
- ((CHARTNS,u'attached-axis'), None): cnv_string,
- ((CHARTNS,u'class'), (CHARTNS,u'grid')): cnv_major_minor,
- ((CHARTNS,u'class'), None): cnv_namespacedToken,
- ((CHARTNS,u'column-mapping'), None): cnv_string,
- ((CHARTNS,u'connect-bars'), None): cnv_boolean,
- ((CHARTNS,u'data-label-number'), None): cnv_string,
- ((CHARTNS,u'data-label-symbol'), None): cnv_boolean,
- ((CHARTNS,u'data-label-text'), None): cnv_boolean,
- ((CHARTNS,u'data-source-has-labels'), None): cnv_data_source_has_labels,
- ((CHARTNS,u'deep'), None): cnv_boolean,
- ((CHARTNS,u'dimension'), None): cnv_string,
- ((CHARTNS,u'display-equation'), None): cnv_boolean,
- ((CHARTNS,u'display-label'), None): cnv_boolean,
- ((CHARTNS,u'display-r-square'), None): cnv_boolean,
- ((CHARTNS,u'error-category'), None): cnv_string,
- ((CHARTNS,u'error-lower-indicator'), None): cnv_boolean,
- ((CHARTNS,u'error-lower-limit'), None): cnv_string,
- ((CHARTNS,u'error-margin'), None): cnv_string,
- ((CHARTNS,u'error-percentage'), None): cnv_string,
- ((CHARTNS,u'error-lower-range'), None): cnv_string,
- ((CHARTNS,u'error-upper-indicator'), None): cnv_boolean,
- ((CHARTNS,u'error-upper-limit'), None): cnv_string,
- ((CHARTNS,u'error-upper-range'), None): cnv_string,
- ((CHARTNS,u'gap-width'), None): cnv_string,
- ((CHARTNS,u'group-bars-per-axis'), None): cnv_boolean,
- ((CHARTNS,u'hole-size'), None): cnv_percent,
- ((CHARTNS,u'include-hidden-cells'), None): cnv_boolean,
- ((CHARTNS,u'interpolation'), None): cnv_string,
- ((CHARTNS,u'interval-major'), None): cnv_string,
- ((CHARTNS,u'interval-minor-divisor'), None): cnv_string,
- ((CHARTNS,u'japanese-candle-stick'), None): cnv_boolean,
- ((CHARTNS,u'label-arrangement'), None): cnv_string,
- ((CHARTNS,u'label-cell-address'), None): cnv_string,
- ((CHARTNS,u'label-position'), None): cnv_string, # Multi-value
- ((CHARTNS,u'label-position-negative'), None): cnv_string, # Multi-value
- ((CHARTNS,u'legend-align'), None): cnv_string,
- ((CHARTNS,u'legend-position'), None): cnv_legend_position,
- ((CHARTNS,u'lines'), None): cnv_boolean,
- ((CHARTNS,u'link-data-style-to-source'), None): cnv_boolean,
- ((CHARTNS,u'logarithmic'), None): cnv_boolean,
- ((CHARTNS,u'maximum'), None): cnv_string,
- ((CHARTNS,u'mean-value'), None): cnv_boolean,
- ((CHARTNS,u'minimum'), None): cnv_string,
- ((CHARTNS,u'name'), None): cnv_string,
- ((CHARTNS,u'origin'), None): cnv_string,
- ((CHARTNS,u'overlap'), None): cnv_string,
- ((CHARTNS,u'percentage'), None): cnv_boolean,
- ((CHARTNS,u'pie-offset'), None): cnv_string,
- ((CHARTNS,u'regression-type'), None): cnv_string,
- ((CHARTNS,u'repeated'), None): cnv_nonNegativeInteger,
- ((CHARTNS,u'reverse-direction'), None): cnv_boolean,
- ((CHARTNS,u'right-angled-axes'), None): cnv_boolean,
- ((CHARTNS,u'row-mapping'), None): cnv_string,
- ((CHARTNS,u'scale-text'), None): cnv_boolean,
- ((CHARTNS,u'series-source'), None): cnv_string,
- ((CHARTNS,u'solid-type'), None): cnv_string,
- ((CHARTNS,u'sort-by-x-values'), None): cnv_boolean,
- ((CHARTNS,u'spline-order'), None): cnv_string,
- ((CHARTNS,u'spline-resolution'), None): cnv_string,
- ((CHARTNS,u'stacked'), None): cnv_boolean,
- ((CHARTNS,u'style-name'), None): cnv_StyleNameRef,
- ((CHARTNS,u'symbol-height'), None): cnv_string,
- ((CHARTNS,u'symbol-name'), None): cnv_string,
- ((CHARTNS,u'symbol-type'), None): cnv_string,
- ((CHARTNS,u'symbol-width'), None): cnv_string,
- ((CHARTNS,u'text-overlap'), None): cnv_boolean,
- ((CHARTNS,u'three-dimensional'), None): cnv_boolean,
- ((CHARTNS,u'tick-mark-position'), None): cnv_string, # Multi-value
- ((CHARTNS,u'tick-marks-major-inner'), None): cnv_boolean,
- ((CHARTNS,u'tick-marks-major-outer'), None): cnv_boolean,
- ((CHARTNS,u'tick-marks-minor-inner'), None): cnv_boolean,
- ((CHARTNS,u'tick-marks-minor-outer'), None): cnv_boolean,
- ((CHARTNS,u'treat-empty-cells'), None): cnv_string, # Multi-value
- ((CHARTNS,u'values-cell-range-address'), None): cnv_string,
- ((CHARTNS,u'vertical'), None): cnv_boolean,
- ((CHARTNS,u'visible'), None): cnv_boolean,
- ((CONFIGNS,u'name'), None): cnv_formula,
- ((CONFIGNS,u'type'), None): cnv_configtype,
- ((DR3DNS,u'ambient-color'), None): cnv_string,
- ((DR3DNS,u'back-scale'), None): cnv_string,
- ((DR3DNS,u'backface-culling'), None): cnv_string,
- ((DR3DNS,u'center'), None): cnv_string,
- ((DR3DNS,u'close-back'), None): cnv_boolean,
- ((DR3DNS,u'close-front'), None): cnv_boolean,
- ((DR3DNS,u'depth'), None): cnv_length,
- ((DR3DNS,u'diffuse-color'), None): cnv_string,
- ((DR3DNS,u'direction'), None): cnv_string,
- ((DR3DNS,u'distance'), None): cnv_length,
- ((DR3DNS,u'edge-rounding'), None): cnv_string,
- ((DR3DNS,u'edge-rounding-mode'), None): cnv_string,
- ((DR3DNS,u'emissive-color'), None): cnv_string,
- ((DR3DNS,u'enabled'), None): cnv_boolean,
- ((DR3DNS,u'end-angle'), None): cnv_string,
- ((DR3DNS,u'focal-length'), None): cnv_length,
- ((DR3DNS,u'horizontal-segments'), None): cnv_string,
- ((DR3DNS,u'lighting-mode'), None): cnv_boolean,
- ((DR3DNS,u'max-edge'), None): cnv_string,
- ((DR3DNS,u'min-edge'), None): cnv_string,
- ((DR3DNS,u'normals-direction'), None): cnv_string,
- ((DR3DNS,u'normals-kind'), None): cnv_string,
- ((DR3DNS,u'projection'), None): cnv_string,
- ((DR3DNS,u'shade-mode'), None): cnv_string,
- ((DR3DNS,u'shadow'), None): cnv_string,
- ((DR3DNS,u'shadow-slant'), None): cnv_nonNegativeInteger,
- ((DR3DNS,u'shininess'), None): cnv_string,
- ((DR3DNS,u'size'), None): cnv_string,
- ((DR3DNS,u'specular'), None): cnv_boolean,
- ((DR3DNS,u'specular-color'), None): cnv_string,
- ((DR3DNS,u'texture-filter'), None): cnv_string,
- ((DR3DNS,u'texture-generation-mode-x'), None): cnv_string,
- ((DR3DNS,u'texture-generation-mode-y'), None): cnv_string,
- ((DR3DNS,u'texture-kind'), None): cnv_string,
- ((DR3DNS,u'texture-mode'), None): cnv_string,
- ((DR3DNS,u'transform'), None): cnv_string,
- ((DR3DNS,u'vertical-segments'), None): cnv_string,
- ((DR3DNS,u'vpn'), None): cnv_string,
- ((DR3DNS,u'vrp'), None): cnv_string,
- ((DR3DNS,u'vup'), None): cnv_string,
- ((DRAWNS,u'align'), None): cnv_string,
- ((DRAWNS,u'angle'), None): cnv_integer,
- ((DRAWNS,u'archive'), None): cnv_string,
- ((DRAWNS,u'auto-grow-height'), None): cnv_boolean,
- ((DRAWNS,u'auto-grow-width'), None): cnv_boolean,
- ((DRAWNS,u'background-size'), None): cnv_string,
- ((DRAWNS,u'blue'), None): cnv_string,
- ((DRAWNS,u'border'), None): cnv_string,
- ((DRAWNS,u'caption-angle'), None): cnv_string,
- ((DRAWNS,u'caption-angle-type'), None): cnv_string,
- ((DRAWNS,u'caption-escape'), None): cnv_string,
- ((DRAWNS,u'caption-escape-direction'), None): cnv_string,
- ((DRAWNS,u'caption-fit-line-length'), None): cnv_boolean,
- ((DRAWNS,u'caption-gap'), None): cnv_string,
- ((DRAWNS,u'caption-line-length'), None): cnv_length,
- ((DRAWNS,u'caption-point-x'), None): cnv_string,
- ((DRAWNS,u'caption-point-y'), None): cnv_string,
- ((DRAWNS,u'caption-id'), None): cnv_IDREF,
- ((DRAWNS,u'caption-type'), None): cnv_string,
- ((DRAWNS,u'chain-next-name'), None): cnv_string,
- ((DRAWNS,u'class-id'), None): cnv_string,
- ((DRAWNS,u'class-names'), None): cnv_NCNames,
- ((DRAWNS,u'code'), None): cnv_string,
- ((DRAWNS,u'color'), None): cnv_string,
- ((DRAWNS,u'color-inversion'), None): cnv_boolean,
- ((DRAWNS,u'color-mode'), None): cnv_string,
- ((DRAWNS,u'concave'), None): cnv_string,
- ((DRAWNS,u'concentric-gradient-fill-allowed'), None): cnv_boolean,
- ((DRAWNS,u'contrast'), None): cnv_string,
- ((DRAWNS,u'control'), None): cnv_IDREF,
- ((DRAWNS,u'copy-of'), None): cnv_string,
- ((DRAWNS,u'corner-radius'), None): cnv_length,
- ((DRAWNS,u'corners'), None): cnv_positiveInteger,
- ((DRAWNS,u'cx'), None): cnv_string,
- ((DRAWNS,u'cy'), None): cnv_string,
- ((DRAWNS,u'data'), None): cnv_string,
- ((DRAWNS,u'decimal-places'), None): cnv_string,
- ((DRAWNS,u'display'), None): cnv_string,
- ((DRAWNS,u'display-name'), None): cnv_string,
- ((DRAWNS,u'distance'), None): cnv_lengthorpercent,
- ((DRAWNS,u'dots1'), None): cnv_integer,
- ((DRAWNS,u'dots1-length'), None): cnv_lengthorpercent,
- ((DRAWNS,u'dots2'), None): cnv_integer,
- ((DRAWNS,u'dots2-length'), None): cnv_lengthorpercent,
- ((DRAWNS,u'draw-aspect'), None): cnv_draw_aspect,
- ((DRAWNS,u'end-angle'), None): cnv_angle,
- ((DRAWNS,u'end'), None): cnv_string,
- ((DRAWNS,u'end-color'), None): cnv_string,
- ((DRAWNS,u'end-glue-point'), None): cnv_nonNegativeInteger,
- ((DRAWNS,u'end-guide'), None): cnv_length,
- ((DRAWNS,u'end-intensity'), None): cnv_string,
- ((DRAWNS,u'end-line-spacing-horizontal'), None): cnv_string,
- ((DRAWNS,u'end-line-spacing-vertical'), None): cnv_string,
- ((DRAWNS,u'end-shape'), None): cnv_IDREF,
- ((DRAWNS,u'engine'), None): cnv_namespacedToken,
- ((DRAWNS,u'enhanced-path'), None): cnv_string,
- ((DRAWNS,u'escape-direction'), None): cnv_string,
- ((DRAWNS,u'extrusion-allowed'), None): cnv_boolean,
- ((DRAWNS,u'extrusion-brightness'), None): cnv_string,
- ((DRAWNS,u'extrusion'), None): cnv_boolean,
- ((DRAWNS,u'extrusion-color'), None): cnv_boolean,
- ((DRAWNS,u'extrusion-depth'), None): cnv_double,
- ((DRAWNS,u'extrusion-diffusion'), None): cnv_string,
- ((DRAWNS,u'extrusion-first-light-direction'), None): cnv_string,
- ((DRAWNS,u'extrusion-first-light-harsh'), None): cnv_boolean,
- ((DRAWNS,u'extrusion-first-light-level'), None): cnv_string,
- ((DRAWNS,u'extrusion-light-face'), None): cnv_boolean,
- ((DRAWNS,u'extrusion-metal'), None): cnv_boolean,
- ((DRAWNS,u'extrusion-number-of-line-segments'), None): cnv_integer,
- ((DRAWNS,u'extrusion-origin'), None): cnv_double,
- ((DRAWNS,u'extrusion-rotation-angle'), None): cnv_double,
- ((DRAWNS,u'extrusion-rotation-center'), None): cnv_string,
- ((DRAWNS,u'extrusion-second-light-direction'), None): cnv_string,
- ((DRAWNS,u'extrusion-second-light-harsh'), None): cnv_boolean,
- ((DRAWNS,u'extrusion-second-light-level'), None): cnv_string,
- ((DRAWNS,u'extrusion-shininess'), None): cnv_string,
- ((DRAWNS,u'extrusion-skew'), None): cnv_double,
- ((DRAWNS,u'extrusion-specularity'), None): cnv_string,
- ((DRAWNS,u'extrusion-viewpoint'), None): cnv_string,
- ((DRAWNS,u'fill'), None): cnv_string,
- ((DRAWNS,u'fill-color'), None): cnv_string,
- ((DRAWNS,u'fill-gradient-name'), None): cnv_string,
- ((DRAWNS,u'fill-hatch-name'), None): cnv_string,
- ((DRAWNS,u'fill-hatch-solid'), None): cnv_boolean,
- ((DRAWNS,u'fill-image-height'), None): cnv_lengthorpercent,
- ((DRAWNS,u'fill-image-name'), None): cnv_DrawNameRef,
- ((DRAWNS,u'fill-image-ref-point'), None): cnv_string,
- ((DRAWNS,u'fill-image-ref-point-x'), None): cnv_string,
- ((DRAWNS,u'fill-image-ref-point-y'), None): cnv_string,
- ((DRAWNS,u'fill-image-width'), None): cnv_lengthorpercent,
- ((DRAWNS,u'filter-name'), None): cnv_string,
- ((DRAWNS,u'fit-to-contour'), None): cnv_boolean,
- ((DRAWNS,u'fit-to-size'), None): cnv_string, # ODF 1.2 says boolean
- ((DRAWNS,u'formula'), None): cnv_string,
- ((DRAWNS,u'frame-display-border'), None): cnv_boolean,
- ((DRAWNS,u'frame-display-scrollbar'), None): cnv_boolean,
- ((DRAWNS,u'frame-margin-horizontal'), None): cnv_string,
- ((DRAWNS,u'frame-margin-vertical'), None): cnv_string,
- ((DRAWNS,u'frame-name'), None): cnv_string,
- ((DRAWNS,u'gamma'), None): cnv_string,
- ((DRAWNS,u'glue-point-leaving-directions'), None): cnv_string,
- ((DRAWNS,u'glue-point-type'), None): cnv_string,
- ((DRAWNS,u'glue-points'), None): cnv_string,
- ((DRAWNS,u'gradient-step-count'), None): cnv_string,
- ((DRAWNS,u'green'), None): cnv_string,
- ((DRAWNS,u'guide-distance'), None): cnv_string,
- ((DRAWNS,u'guide-overhang'), None): cnv_length,
- ((DRAWNS,u'handle-mirror-horizontal'), None): cnv_boolean,
- ((DRAWNS,u'handle-mirror-vertical'), None): cnv_boolean,
- ((DRAWNS,u'handle-polar'), None): cnv_string,
- ((DRAWNS,u'handle-position'), None): cnv_string,
- ((DRAWNS,u'handle-radius-range-maximum'), None): cnv_string,
- ((DRAWNS,u'handle-radius-range-minimum'), None): cnv_string,
- ((DRAWNS,u'handle-range-x-maximum'), None): cnv_string,
- ((DRAWNS,u'handle-range-x-minimum'), None): cnv_string,
- ((DRAWNS,u'handle-range-y-maximum'), None): cnv_string,
- ((DRAWNS,u'handle-range-y-minimum'), None): cnv_string,
- ((DRAWNS,u'handle-switched'), None): cnv_boolean,
-# ((DRAWNS,u'id'), None): cnv_ID,
-# ((DRAWNS,u'id'), None): cnv_nonNegativeInteger, # ?? line 6581 in RNG
- ((DRAWNS,u'id'), None): cnv_string,
- ((DRAWNS,u'image-opacity'), None): cnv_string,
- ((DRAWNS,u'kind'), None): cnv_string,
- ((DRAWNS,u'layer'), None): cnv_string,
- ((DRAWNS,u'line-distance'), None): cnv_string,
- ((DRAWNS,u'line-skew'), None): cnv_string,
- ((DRAWNS,u'luminance'), None): cnv_string,
- ((DRAWNS,u'marker-end-center'), None): cnv_boolean,
- ((DRAWNS,u'marker-end'), None): cnv_string,
- ((DRAWNS,u'marker-end-width'), None): cnv_length,
- ((DRAWNS,u'marker-start-center'), None): cnv_boolean,
- ((DRAWNS,u'marker-start'), None): cnv_string,
- ((DRAWNS,u'marker-start-width'), None): cnv_length,
- ((DRAWNS,u'master-page-name'), None): cnv_StyleNameRef,
- ((DRAWNS,u'may-script'), None): cnv_boolean,
- ((DRAWNS,u'measure-align'), None): cnv_string,
- ((DRAWNS,u'measure-vertical-align'), None): cnv_string,
- ((DRAWNS,u'mime-type'), None): cnv_string,
- ((DRAWNS,u'mirror-horizontal'), None): cnv_boolean,
- ((DRAWNS,u'mirror-vertical'), None): cnv_boolean,
- ((DRAWNS,u'modifiers'), None): cnv_string,
- ((DRAWNS,u'name'), None): cnv_NCName,
-# ((DRAWNS,u'name'), None): cnv_string,
- ((DRAWNS,u'nav-order'), None): cnv_IDREF,
- ((DRAWNS,u'nohref'), None): cnv_string,
- ((DRAWNS,u'notify-on-update-of-ranges'), None): cnv_string,
- ((DRAWNS,u'object'), None): cnv_string,
- ((DRAWNS,u'ole-draw-aspect'), None): cnv_string,
- ((DRAWNS,u'opacity'), None): cnv_string,
- ((DRAWNS,u'opacity-name'), None): cnv_string,
- ((DRAWNS,u'page-number'), None): cnv_positiveInteger,
- ((DRAWNS,u'parallel'), None): cnv_boolean,
- ((DRAWNS,u'path-stretchpoint-x'), None): cnv_double,
- ((DRAWNS,u'path-stretchpoint-y'), None): cnv_double,
- ((DRAWNS,u'placing'), None): cnv_string,
- ((DRAWNS,u'points'), None): cnv_points,
- ((DRAWNS,u'protected'), None): cnv_boolean,
- ((DRAWNS,u'recreate-on-edit'), None): cnv_boolean,
- ((DRAWNS,u'red'), None): cnv_string,
- ((DRAWNS,u'rotation'), None): cnv_integer,
- ((DRAWNS,u'secondary-fill-color'), None): cnv_string,
- ((DRAWNS,u'shadow'), None): cnv_string,
- ((DRAWNS,u'shadow-color'), None): cnv_string,
- ((DRAWNS,u'shadow-offset-x'), None): cnv_length,
- ((DRAWNS,u'shadow-offset-y'), None): cnv_length,
- ((DRAWNS,u'shadow-opacity'), None): cnv_string,
- ((DRAWNS,u'shape-id'), None): cnv_IDREF,
- ((DRAWNS,u'sharpness'), None): cnv_string,
- ((DRAWNS,u'show-unit'), None): cnv_boolean,
- ((DRAWNS,u'start-angle'), None): cnv_angle,
- ((DRAWNS,u'start'), None): cnv_string,
- ((DRAWNS,u'start-color'), None): cnv_string,
- ((DRAWNS,u'start-glue-point'), None): cnv_nonNegativeInteger,
- ((DRAWNS,u'start-guide'), None): cnv_length,
- ((DRAWNS,u'start-intensity'), None): cnv_string,
- ((DRAWNS,u'start-line-spacing-horizontal'), None): cnv_string,
- ((DRAWNS,u'start-line-spacing-vertical'), None): cnv_string,
- ((DRAWNS,u'start-shape'), None): cnv_IDREF,
- ((DRAWNS,u'stroke'), None): cnv_string,
- ((DRAWNS,u'stroke-dash'), None): cnv_string,
- ((DRAWNS,u'stroke-dash-names'), None): cnv_string,
- ((DRAWNS,u'stroke-linejoin'), None): cnv_string,
- ((DRAWNS,u'style'), None): cnv_string,
- ((DRAWNS,u'style-name'), None): cnv_StyleNameRef,
- ((DRAWNS,u'symbol-color'), None): cnv_string,
- ((DRAWNS,u'text-areas'), None): cnv_string,
- ((DRAWNS,u'text-path-allowed'), None): cnv_boolean,
- ((DRAWNS,u'text-path'), None): cnv_boolean,
- ((DRAWNS,u'text-path-mode'), None): cnv_string,
- ((DRAWNS,u'text-path-same-letter-heights'), None): cnv_boolean,
- ((DRAWNS,u'text-path-scale'), None): cnv_string,
- ((DRAWNS,u'text-rotate-angle'), None): cnv_double,
- ((DRAWNS,u'text-style-name'), None): cnv_StyleNameRef,
- ((DRAWNS,u'textarea-horizontal-align'), None): cnv_string,
- ((DRAWNS,u'textarea-vertical-align'), None): cnv_string,
- ((DRAWNS,u'tile-repeat-offset'), None): cnv_string,
- ((DRAWNS,u'transform'), None): cnv_string,
- ((DRAWNS,u'type'), None): cnv_string,
- ((DRAWNS,u'unit'), None): cnv_string,
- ((DRAWNS,u'value'), None): cnv_string,
- ((DRAWNS,u'visible-area-height'), None): cnv_string,
- ((DRAWNS,u'visible-area-left'), None): cnv_string,
- ((DRAWNS,u'visible-area-top'), None): cnv_string,
- ((DRAWNS,u'visible-area-width'), None): cnv_string,
- ((DRAWNS,u'wrap-influence-on-position'), None): cnv_string,
- ((DRAWNS,u'z-index'), None): cnv_nonNegativeInteger,
- ((FONS,u'background-color'), None): cnv_string,
- ((FONS,u'border-bottom'), None): cnv_string,
- ((FONS,u'border'), None): cnv_string,
- ((FONS,u'border-left'), None): cnv_string,
- ((FONS,u'border-right'), None): cnv_string,
- ((FONS,u'border-top'), None): cnv_string,
- ((FONS,u'break-after'), None): cnv_string,
- ((FONS,u'break-before'), None): cnv_string,
- ((FONS,u'clip'), None): cnv_string,
- ((FONS,u'color'), None): cnv_string,
- ((FONS,u'column-count'), None): cnv_positiveInteger,
- ((FONS,u'column-gap'), None): cnv_length,
- ((FONS,u'country'), None): cnv_token,
- ((FONS,u'end-indent'), None): cnv_length,
- ((FONS,u'font-family'), None): cnv_string,
- ((FONS,u'font-size'), None): cnv_string,
- ((FONS,u'font-style'), None): cnv_string,
- ((FONS,u'font-variant'), None): cnv_string,
- ((FONS,u'font-weight'), None): cnv_string,
- ((FONS,u'height'), None): cnv_string,
- ((FONS,u'hyphenate'), None): cnv_boolean,
- ((FONS,u'hyphenation-keep'), None): cnv_string,
- ((FONS,u'hyphenation-ladder-count'), None): cnv_string,
- ((FONS,u'hyphenation-push-char-count'), None): cnv_string,
- ((FONS,u'hyphenation-remain-char-count'), None): cnv_string,
- ((FONS,u'keep-together'), None): cnv_string,
- ((FONS,u'keep-with-next'), None): cnv_string,
- ((FONS,u'language'), None): cnv_token,
- ((FONS,u'letter-spacing'), None): cnv_string,
- ((FONS,u'line-height'), None): cnv_string,
- ((FONS,u'margin-bottom'), None): cnv_string,
- ((FONS,u'margin'), None): cnv_string,
- ((FONS,u'margin-left'), None): cnv_string,
- ((FONS,u'margin-right'), None): cnv_string,
- ((FONS,u'margin-top'), None): cnv_string,
- ((FONS,u'max-height'), None): cnv_string,
- ((FONS,u'max-width'), None): cnv_string,
- ((FONS,u'min-height'), None): cnv_length,
- ((FONS,u'min-width'), None): cnv_string,
- ((FONS,u'orphans'), None): cnv_string,
- ((FONS,u'padding-bottom'), None): cnv_string,
- ((FONS,u'padding'), None): cnv_string,
- ((FONS,u'padding-left'), None): cnv_string,
- ((FONS,u'padding-right'), None): cnv_string,
- ((FONS,u'padding-top'), None): cnv_string,
- ((FONS,u'page-height'), None): cnv_length,
- ((FONS,u'page-width'), None): cnv_length,
- ((FONS,u'script'), None): cnv_token,
- ((FONS,u'space-after'), None): cnv_length,
- ((FONS,u'space-before'), None): cnv_length,
- ((FONS,u'start-indent'), None): cnv_length,
- ((FONS,u'text-align'), None): cnv_string,
- ((FONS,u'text-align-last'), None): cnv_string,
- ((FONS,u'text-indent'), None): cnv_string,
- ((FONS,u'text-shadow'), None): cnv_string,
- ((FONS,u'text-transform'), None): cnv_string,
- ((FONS,u'widows'), None): cnv_string,
- ((FONS,u'width'), None): cnv_string,
- ((FONS,u'wrap-option'), None): cnv_string,
- ((FORMNS,u'allow-deletes'), None): cnv_boolean,
- ((FORMNS,u'allow-inserts'), None): cnv_boolean,
- ((FORMNS,u'allow-updates'), None): cnv_boolean,
- ((FORMNS,u'apply-design-mode'), None): cnv_boolean,
- ((FORMNS,u'apply-filter'), None): cnv_boolean,
- ((FORMNS,u'auto-complete'), None): cnv_boolean,
- ((FORMNS,u'automatic-focus'), None): cnv_boolean,
- ((FORMNS,u'bound-column'), None): cnv_string,
- ((FORMNS,u'button-type'), None): cnv_string,
- ((FORMNS,u'command'), None): cnv_string,
- ((FORMNS,u'command-type'), None): cnv_string,
- ((FORMNS,u'control-implementation'), None): cnv_namespacedToken,
- ((FORMNS,u'convert-empty-to-null'), None): cnv_boolean,
- ((FORMNS,u'current-selected'), None): cnv_boolean,
- ((FORMNS,u'current-state'), None): cnv_string,
-# ((FORMNS,u'current-value'), None): cnv_date,
-# ((FORMNS,u'current-value'), None): cnv_double,
- ((FORMNS,u'current-value'), None): cnv_string,
-# ((FORMNS,u'current-value'), None): cnv_time,
- ((FORMNS,u'data-field'), None): cnv_string,
- ((FORMNS,u'datasource'), None): cnv_string,
- ((FORMNS,u'default-button'), None): cnv_boolean,
- ((FORMNS,u'delay-for-repeat'), None): cnv_duration,
- ((FORMNS,u'detail-fields'), None): cnv_string,
- ((FORMNS,u'disabled'), None): cnv_boolean,
- ((FORMNS,u'dropdown'), None): cnv_boolean,
- ((FORMNS,u'echo-char'), None): cnv_string,
- ((FORMNS,u'enctype'), None): cnv_string,
- ((FORMNS,u'escape-processing'), None): cnv_boolean,
- ((FORMNS,u'filter'), None): cnv_string,
- ((FORMNS,u'focus-on-click'), None): cnv_boolean,
- ((FORMNS,u'for'), None): cnv_string,
- ((FORMNS,u'id'), None): cnv_ID,
- ((FORMNS,u'ignore-result'), None): cnv_boolean,
- ((FORMNS,u'image-align'), None): cnv_string,
- ((FORMNS,u'image-data'), None): cnv_anyURI,
- ((FORMNS,u'image-position'), None): cnv_string,
- ((FORMNS,u'is-tristate'), None): cnv_boolean,
- ((FORMNS,u'label'), None): cnv_string,
- ((FORMNS,u'linked-cell'), None): cnv_string,
- ((FORMNS,u'list-linkage-type'), None): cnv_list_linkage_type,
- ((FORMNS,u'list-source'), None): cnv_string,
- ((FORMNS,u'list-source-type'), None): cnv_string,
- ((FORMNS,u'master-fields'), None): cnv_string,
- ((FORMNS,u'max-length'), None): cnv_nonNegativeInteger,
-# ((FORMNS,u'max-value'), None): cnv_date,
-# ((FORMNS,u'max-value'), None): cnv_double,
- ((FORMNS,u'max-value'), None): cnv_string,
-# ((FORMNS,u'max-value'), None): cnv_time,
- ((FORMNS,u'method'), None): cnv_string,
-# ((FORMNS,u'min-value'), None): cnv_date,
-# ((FORMNS,u'min-value'), None): cnv_double,
- ((FORMNS,u'min-value'), None): cnv_string,
-# ((FORMNS,u'min-value'), None): cnv_time,
- ((FORMNS,u'multi-line'), None): cnv_boolean,
- ((FORMNS,u'multiple'), None): cnv_boolean,
- ((FORMNS,u'name'), None): cnv_string,
- ((FORMNS,u'navigation-mode'), None): cnv_string,
- ((FORMNS,u'order'), None): cnv_string,
- ((FORMNS,u'orientation'), None): cnv_string,
- ((FORMNS,u'page-step-size'), None): cnv_positiveInteger,
- ((FORMNS,u'printable'), None): cnv_boolean,
- ((FORMNS,u'property-name'), None): cnv_string,
- ((FORMNS,u'readonly'), None): cnv_boolean,
- ((FORMNS,u'repeat'), None): cnv_boolean,
- ((FORMNS,u'selected'), None): cnv_boolean,
- ((FORMNS,u'size'), None): cnv_nonNegativeInteger,
- ((FORMNS,u'source-cell-range'), None): cnv_string,
- ((FORMNS,u'spin-button'), None): cnv_boolean,
- ((FORMNS,u'state'), None): cnv_string,
- ((FORMNS,u'step-size'), None): cnv_positiveInteger,
- ((FORMNS,u'tab-cycle'), None): cnv_string,
- ((FORMNS,u'tab-index'), None): cnv_nonNegativeInteger,
- ((FORMNS,u'tab-stop'), None): cnv_boolean,
- ((FORMNS,u'text-style-name'), None): cnv_StyleNameRef,
- ((FORMNS,u'title'), None): cnv_string,
- ((FORMNS,u'toggle'), None): cnv_boolean,
- ((FORMNS,u'validation'), None): cnv_boolean,
-# ((FORMNS,u'value'), None): cnv_date,
-# ((FORMNS,u'value'), None): cnv_double,
- ((FORMNS,u'value'), None): cnv_string,
-# ((FORMNS,u'value'), None): cnv_time,
- ((FORMNS,u'visual-effect'), None): cnv_string,
- ((FORMNS,u'xforms-list-source'), None): cnv_string,
- ((FORMNS,u'xforms-submission'), None): cnv_string,
- ((GRDDLNS,u'transformation'), None): cnv_string,
- ((MANIFESTNS,u'algorithm-name'), None): cnv_string,
- ((MANIFESTNS,u'checksum'), None): cnv_string,
- ((MANIFESTNS,u'checksum-type'), None): cnv_string,
- ((MANIFESTNS,u'full-path'), None): cnv_string,
- ((MANIFESTNS,u'initialisation-vector'), None): cnv_string,
- ((MANIFESTNS,u'iteration-count'), None): cnv_nonNegativeInteger,
- ((MANIFESTNS,u'key-derivation-name'), None): cnv_string,
- ((MANIFESTNS,u'media-type'), None): cnv_string,
- ((MANIFESTNS,u'preferred-view-mode'), None): cnv_string,
- ((MANIFESTNS,u'salt'), None): cnv_string,
- ((MANIFESTNS,u'size'), None): cnv_nonNegativeInteger,
- ((MANIFESTNS,u'version'), None): cnv_string,
- ((METANS,u'cell-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'character-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'date'), None): cnv_dateTime,
- ((METANS,u'delay'), None): cnv_duration,
- ((METANS,u'draw-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'frame-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'image-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'name'), None): cnv_string,
- ((METANS,u'non-whitespace-character-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'object-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'ole-object-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'page-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'paragraph-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'row-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'sentence-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'syllable-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'table-count'), None): cnv_nonNegativeInteger,
- ((METANS,u'value-type'), None): cnv_metavaluetype,
- ((METANS,u'word-count'), None): cnv_nonNegativeInteger,
- ((NUMBERNS,u'automatic-order'), None): cnv_boolean,
- ((NUMBERNS,u'calendar'), None): cnv_string,
- ((NUMBERNS,u'country'), None): cnv_token,
- ((NUMBERNS,u'decimal-places'), None): cnv_integer,
- ((NUMBERNS,u'decimal-replacement'), None): cnv_string,
- ((NUMBERNS,u'denominator-value'), None): cnv_integer,
- ((NUMBERNS,u'display-factor'), None): cnv_double,
- ((NUMBERNS,u'format-source'), None): cnv_string,
- ((NUMBERNS,u'grouping'), None): cnv_boolean,
- ((NUMBERNS,u'language'), None): cnv_token,
- ((NUMBERNS,u'min-denominator-digits'), None): cnv_integer,
- ((NUMBERNS,u'min-exponent-digits'), None): cnv_integer,
- ((NUMBERNS,u'min-integer-digits'), None): cnv_integer,
- ((NUMBERNS,u'min-numerator-digits'), None): cnv_integer,
- ((NUMBERNS,u'position'), None): cnv_integer,
- ((NUMBERNS,u'possessive-form'), None): cnv_boolean,
- ((NUMBERNS,u'rfc-language-tag'), None): cnv_language,
- ((NUMBERNS,u'script'), None): cnv_token,
- ((NUMBERNS,u'style'), None): cnv_string,
- ((NUMBERNS,u'textual'), None): cnv_boolean,
- ((NUMBERNS,u'title'), None): cnv_string,
- ((NUMBERNS,u'transliteration-country'), None): cnv_token,
- ((NUMBERNS,u'transliteration-format'), None): cnv_string,
- ((NUMBERNS,u'transliteration-language'), None): cnv_token,
- ((NUMBERNS,u'transliteration-style'), None): cnv_string,
- ((NUMBERNS,u'truncate-on-overflow'), None): cnv_boolean,
- ((OFFICENS,u'automatic-update'), None): cnv_boolean,
- ((OFFICENS,u'boolean-value'), None): cnv_boolean,
- ((OFFICENS,u'conversion-mode'), None): cnv_string,
- ((OFFICENS,u'currency'), None): cnv_string,
- ((OFFICENS,u'date-value'), None): cnv_dateTime,
- ((OFFICENS,u'dde-application'), None): cnv_string,
- ((OFFICENS,u'dde-item'), None): cnv_string,
- ((OFFICENS,u'dde-topic'), None): cnv_string,
- ((OFFICENS,u'display'), None): cnv_boolean,
- ((OFFICENS,u'mimetype'), None): cnv_string,
- ((OFFICENS,u'name'), None): cnv_string,
- ((OFFICENS,u'process-content'), None): cnv_boolean,
- ((OFFICENS,u'server-map'), None): cnv_boolean,
- ((OFFICENS,u'string-value'), None): cnv_string,
- ((OFFICENS,u'target-frame'), None): cnv_string,
- ((OFFICENS,u'target-frame-name'), None): cnv_string,
- ((OFFICENS,u'time-value'), None): cnv_duration,
- ((OFFICENS,u'title'), None): cnv_string,
- ((OFFICENS,u'value'), None): cnv_double,
- ((OFFICENS,u'value-type'), None): cnv_string,
- ((OFFICENS,u'version'), None): cnv_string,
- ((PRESENTATIONNS,u'action'), None): cnv_string,
- ((PRESENTATIONNS,u'animations'), None): cnv_string,
- ((PRESENTATIONNS,u'background-objects-visible'), None): cnv_boolean,
- ((PRESENTATIONNS,u'background-visible'), None): cnv_boolean,
- ((PRESENTATIONNS,u'class'), None): cnv_string,
- ((PRESENTATIONNS,u'class-names'), None): cnv_NCNames,
- ((PRESENTATIONNS,u'delay'), None): cnv_duration,
- ((PRESENTATIONNS,u'direction'), None): cnv_string,
- ((PRESENTATIONNS,u'display-date-time'), None): cnv_boolean,
- ((PRESENTATIONNS,u'display-footer'), None): cnv_boolean,
- ((PRESENTATIONNS,u'display-header'), None): cnv_boolean,
- ((PRESENTATIONNS,u'display-page-number'), None): cnv_boolean,
- ((PRESENTATIONNS,u'duration'), None): cnv_string,
- ((PRESENTATIONNS,u'effect'), None): cnv_string,
- ((PRESENTATIONNS,u'endless'), None): cnv_boolean,
- ((PRESENTATIONNS,u'force-manual'), None): cnv_boolean,
- ((PRESENTATIONNS,u'full-screen'), None): cnv_boolean,
- ((PRESENTATIONNS,u'group-id'), None): cnv_string,
- ((PRESENTATIONNS,u'master-element'), None): cnv_IDREF,
- ((PRESENTATIONNS,u'mouse-as-pen'), None): cnv_boolean,
- ((PRESENTATIONNS,u'mouse-visible'), None): cnv_boolean,
- ((PRESENTATIONNS,u'name'), None): cnv_string,
- ((PRESENTATIONNS,u'node-type'), None): cnv_string,
- ((PRESENTATIONNS,u'object'), None): cnv_string,
- ((PRESENTATIONNS,u'pages'), None): cnv_string,
- ((PRESENTATIONNS,u'path-id'), None): cnv_string,
- ((PRESENTATIONNS,u'pause'), None): cnv_duration,
- ((PRESENTATIONNS,u'placeholder'), None): cnv_boolean,
- ((PRESENTATIONNS,u'play-full'), None): cnv_boolean,
- ((PRESENTATIONNS,u'presentation-page-layout-name'), None): cnv_StyleNameRef,
- ((PRESENTATIONNS,u'preset-class'), None): cnv_string,
- ((PRESENTATIONNS,u'preset-id'), None): cnv_string,
- ((PRESENTATIONNS,u'preset-sub-type'), None): cnv_string,
- ((PRESENTATIONNS,u'show'), None): cnv_string,
- ((PRESENTATIONNS,u'show-end-of-presentation-slide'), None): cnv_boolean,
- ((PRESENTATIONNS,u'show-logo'), None): cnv_boolean,
- ((PRESENTATIONNS,u'source'), None): cnv_string,
- ((PRESENTATIONNS,u'speed'), None): cnv_string,
- ((PRESENTATIONNS,u'start-page'), None): cnv_string,
- ((PRESENTATIONNS,u'start-scale'), None): cnv_string,
- ((PRESENTATIONNS,u'start-with-navigator'), None): cnv_boolean,
- ((PRESENTATIONNS,u'stay-on-top'), None): cnv_boolean,
- ((PRESENTATIONNS,u'style-name'), None): cnv_StyleNameRef,
- ((PRESENTATIONNS,u'transition-on-click'), None): cnv_string,
- ((PRESENTATIONNS,u'transition-speed'), None): cnv_string,
- ((PRESENTATIONNS,u'transition-style'), None): cnv_string,
- ((PRESENTATIONNS,u'transition-type'), None): cnv_string,
- ((PRESENTATIONNS,u'use-date-time-name'), None): cnv_string,
- ((PRESENTATIONNS,u'use-footer-name'), None): cnv_string,
- ((PRESENTATIONNS,u'use-header-name'), None): cnv_string,
- ((PRESENTATIONNS,u'user-transformed'), None): cnv_boolean,
- ((PRESENTATIONNS,u'verb'), None): cnv_nonNegativeInteger,
- ((PRESENTATIONNS,u'visibility'), None): cnv_string,
- ((SCRIPTNS,u'event-name'), None): cnv_formula,
- ((SCRIPTNS,u'language'), None): cnv_formula,
- ((SCRIPTNS,u'macro-name'), None): cnv_string,
- ((SMILNS,u'accelerate'), None): cnv_double,
- ((SMILNS,u'accumulate'), None): cnv_string,
- ((SMILNS,u'additive'), None): cnv_string,
- ((SMILNS,u'attributeName'), None): cnv_string,
- ((SMILNS,u'autoReverse'), None): cnv_boolean,
- ((SMILNS,u'begin'), None): cnv_string,
- ((SMILNS,u'by'), None): cnv_string,
- ((SMILNS,u'calcMode'), None): cnv_string,
- ((SMILNS,u'decelerate'), None): cnv_double,
- ((SMILNS,u'direction'), None): cnv_string,
- ((SMILNS,u'dur'), None): cnv_string,
- ((SMILNS,u'end'), None): cnv_string,
- ((SMILNS,u'endsync'), None): cnv_string,
- ((SMILNS,u'fadeColor'), None): cnv_string,
- ((SMILNS,u'fill'), None): cnv_string,
- ((SMILNS,u'fillDefault'), None): cnv_string,
- ((SMILNS,u'from'), None): cnv_string,
- ((SMILNS,u'keySplines'), None): cnv_string,
- ((SMILNS,u'keyTimes'), None): cnv_string,
- ((SMILNS,u'mode'), None): cnv_string,
- ((SMILNS,u'repeatCount'), None): cnv_nonNegativeInteger,
- ((SMILNS,u'repeatDur'), None): cnv_string,
- ((SMILNS,u'restart'), None): cnv_string,
- ((SMILNS,u'restartDefault'), None): cnv_string,
- ((SMILNS,u'subtype'), None): cnv_string,
- ((SMILNS,u'targetElement'), None): cnv_IDREF,
- ((SMILNS,u'to'), None): cnv_string,
- ((SMILNS,u'type'), None): cnv_string,
- ((SMILNS,u'values'), None): cnv_string,
- ((STYLENS,u'adjustment'), None): cnv_string,
- ((STYLENS,u'apply-style-name'), None): cnv_StyleNameRef,
- ((STYLENS,u'auto-text-indent'), None): cnv_boolean,
- ((STYLENS,u'auto-update'), None): cnv_boolean,
- ((STYLENS,u'background-transparency'), None): cnv_string,
- ((STYLENS,u'base-cell-address'), None): cnv_string,
- ((STYLENS,u'border-line-width-bottom'), None): cnv_string,
- ((STYLENS,u'border-line-width'), None): cnv_string,
- ((STYLENS,u'border-line-width-left'), None): cnv_string,
- ((STYLENS,u'border-line-width-right'), None): cnv_string,
- ((STYLENS,u'border-line-width-top'), None): cnv_string,
- ((STYLENS,u'cell-protect'), None): cnv_string,
- ((STYLENS,u'char'), None): cnv_string,
- ((STYLENS,u'class'), None): cnv_string,
- ((STYLENS,u'color'), None): cnv_string,
- ((STYLENS,u'column-width'), None): cnv_string,
- ((STYLENS,u'condition'), None): cnv_string,
- ((STYLENS,u'country-asian'), None): cnv_string,
- ((STYLENS,u'country-complex'), None): cnv_string,
- ((STYLENS,u'data-style-name'), None): cnv_StyleNameRef,
- ((STYLENS,u'decimal-places'), None): cnv_string,
- ((STYLENS,u'default-outline-level'), None): cnv_positiveInteger,
- ((STYLENS,u'diagonal-bl-tr'), None): cnv_string,
- ((STYLENS,u'diagonal-bl-tr-widths'), None): cnv_string,
- ((STYLENS,u'diagonal-tl-br'), None): cnv_string,
- ((STYLENS,u'diagonal-tl-br-widths'), None): cnv_string,
- ((STYLENS,u'direction'), None): cnv_string,
- ((STYLENS,u'display'), None): cnv_boolean,
- ((STYLENS,u'display-name'), None): cnv_string,
- ((STYLENS,u'distance-after-sep'), None): cnv_length,
- ((STYLENS,u'distance-before-sep'), None): cnv_length,
- ((STYLENS,u'distance'), None): cnv_length,
- ((STYLENS,u'dynamic-spacing'), None): cnv_boolean,
- ((STYLENS,u'editable'), None): cnv_boolean,
- ((STYLENS,u'family'), None): cnv_family,
- ((STYLENS,u'filter-name'), None): cnv_string,
- ((STYLENS,u'first-page-number'), None): cnv_string,
- ((STYLENS,u'flow-with-text'), None): cnv_boolean,
- ((STYLENS,u'font-adornments'), None): cnv_string,
- ((STYLENS,u'font-charset'), None): cnv_string,
- ((STYLENS,u'font-charset-asian'), None): cnv_string,
- ((STYLENS,u'font-charset-complex'), None): cnv_string,
- ((STYLENS,u'font-family-asian'), None): cnv_string,
- ((STYLENS,u'font-family-complex'), None): cnv_string,
- ((STYLENS,u'font-family-generic-asian'), None): cnv_string,
- ((STYLENS,u'font-family-generic'), None): cnv_string,
- ((STYLENS,u'font-family-generic-complex'), None): cnv_string,
- ((STYLENS,u'font-independent-line-spacing'), None): cnv_boolean,
- ((STYLENS,u'font-name-asian'), None): cnv_string,
- ((STYLENS,u'font-name'), None): cnv_string,
- ((STYLENS,u'font-name-complex'), None): cnv_string,
- ((STYLENS,u'font-pitch-asian'), None): cnv_string,
- ((STYLENS,u'font-pitch'), None): cnv_string,
- ((STYLENS,u'font-pitch-complex'), None): cnv_string,
- ((STYLENS,u'font-relief'), None): cnv_string,
- ((STYLENS,u'font-size-asian'), None): cnv_string,
- ((STYLENS,u'font-size-complex'), None): cnv_string,
- ((STYLENS,u'font-size-rel-asian'), None): cnv_length,
- ((STYLENS,u'font-size-rel'), None): cnv_length,
- ((STYLENS,u'font-size-rel-complex'), None): cnv_length,
- ((STYLENS,u'font-style-asian'), None): cnv_string,
- ((STYLENS,u'font-style-complex'), None): cnv_string,
- ((STYLENS,u'font-style-name-asian'), None): cnv_string,
- ((STYLENS,u'font-style-name'), None): cnv_string,
- ((STYLENS,u'font-style-name-complex'), None): cnv_string,
- ((STYLENS,u'font-weight-asian'), None): cnv_string,
- ((STYLENS,u'font-weight-complex'), None): cnv_string,
- ((STYLENS,u'footnote-max-height'), None): cnv_length,
- ((STYLENS,u'glyph-orientation-vertical'), None): cnv_string,
- ((STYLENS,u'height'), None): cnv_string,
- ((STYLENS,u'horizontal-pos'), None): cnv_string,
- ((STYLENS,u'horizontal-rel'), None): cnv_string,
- ((STYLENS,u'join-border'), None): cnv_boolean,
- ((STYLENS,u'justify-single-word'), None): cnv_boolean,
- ((STYLENS,u'language-asian'), None): cnv_string,
- ((STYLENS,u'language-complex'), None): cnv_string,
- ((STYLENS,u'layout-grid-base-height'), None): cnv_length,
- ((STYLENS,u'layout-grid-base-width'), None): cnv_length,
- ((STYLENS,u'layout-grid-color'), None): cnv_string,
- ((STYLENS,u'layout-grid-display'), None): cnv_boolean,
- ((STYLENS,u'layout-grid-lines'), None): cnv_string,
- ((STYLENS,u'layout-grid-mode'), None): cnv_string,
- ((STYLENS,u'layout-grid-print'), None): cnv_boolean,
- ((STYLENS,u'layout-grid-ruby-below'), None): cnv_boolean,
- ((STYLENS,u'layout-grid-ruby-height'), None): cnv_length,
- ((STYLENS,u'layout-grid-snap-to'), None): cnv_boolean,
- ((STYLENS,u'layout-grid-standard-mode'), None): cnv_boolean,
- ((STYLENS,u'leader-char'), None): cnv_string,
- ((STYLENS,u'leader-color'), None): cnv_string,
- ((STYLENS,u'leader-style'), None): cnv_string,
- ((STYLENS,u'leader-text'), None): cnv_string,
- ((STYLENS,u'leader-text-style'), None): cnv_StyleNameRef,
- ((STYLENS,u'leader-type'), None): cnv_string,
- ((STYLENS,u'leader-width'), None): cnv_string,
- ((STYLENS,u'legend-expansion-aspect-ratio'), None): cnv_double,
- ((STYLENS,u'legend-expansion'), None): cnv_string,
- ((STYLENS,u'length'), None): cnv_positiveInteger,
- ((STYLENS,u'letter-kerning'), None): cnv_boolean,
- ((STYLENS,u'line-break'), None): cnv_string,
- ((STYLENS,u'line-height-at-least'), None): cnv_string,
- ((STYLENS,u'line-spacing'), None): cnv_length,
- ((STYLENS,u'line-style'), None): cnv_string,
- ((STYLENS,u'lines'), None): cnv_positiveInteger,
- ((STYLENS,u'list-level'), None): cnv_positiveInteger,
- ((STYLENS,u'list-style-name'), None): cnv_StyleNameRef,
- ((STYLENS,u'master-page-name'), None): cnv_StyleNameRef,
- ((STYLENS,u'may-break-between-rows'), None): cnv_boolean,
- ((STYLENS,u'min-row-height'), None): cnv_string,
- ((STYLENS,u'mirror'), None): cnv_string,
- ((STYLENS,u'name'), None): cnv_NCName,
- ((STYLENS,u'name'), (STYLENS,u'font-face')): cnv_string,
- ((STYLENS,u'next-style-name'), None): cnv_StyleNameRef,
- ((STYLENS,u'num-format'), None): cnv_string,
- ((STYLENS,u'num-letter-sync'), None): cnv_boolean,
- ((STYLENS,u'num-prefix'), None): cnv_string,
- ((STYLENS,u'num-suffix'), None): cnv_string,
- ((STYLENS,u'number-wrapped-paragraphs'), None): cnv_string,
- ((STYLENS,u'overflow-behavior'), None): cnv_string,
- ((STYLENS,u'page-layout-name'), None): cnv_StyleNameRef,
- ((STYLENS,u'page-number'), None): cnv_string,
- ((STYLENS,u'page-usage'), None): cnv_string,
- ((STYLENS,u'paper-tray-name'), None): cnv_string,
- ((STYLENS,u'parent-style-name'), None): cnv_StyleNameRef,
- ((STYLENS,u'percentage-data-style-name'), None): cnv_StyleNameRef,
- ((STYLENS,u'position'), (STYLENS,u'tab-stop')): cnv_length,
- ((STYLENS,u'position'), None): cnv_string,
- ((STYLENS,u'print'), None): cnv_string,
- ((STYLENS,u'print-content'), None): cnv_boolean,
- ((STYLENS,u'print-orientation'), None): cnv_string,
- ((STYLENS,u'print-page-order'), None): cnv_string,
- ((STYLENS,u'protect'), (STYLENS,u'section-properties')): cnv_boolean,
- ((STYLENS,u'protect'), (STYLENS,u'graphic-properties')): cnv_string,
-# ((STYLENS,u'protect'), None): cnv_boolean,
- ((STYLENS,u'punctuation-wrap'), None): cnv_string,
- ((STYLENS,u'register-true'), None): cnv_boolean,
- ((STYLENS,u'register-truth-ref-style-name'), None): cnv_string,
- ((STYLENS,u'rel-column-width'), None): cnv_string,
- ((STYLENS,u'rel-height'), None): cnv_string,
- ((STYLENS,u'rel-width'), None): cnv_string,
- ((STYLENS,u'repeat'), None): cnv_string,
- ((STYLENS,u'repeat-content'), None): cnv_boolean,
- ((STYLENS,u'rfc-language-tag'), None): cnv_language,
- ((STYLENS,u'rfc-language-tag-asian'), None): cnv_language,
- ((STYLENS,u'rfc-language-tag-complex'), None): cnv_language,
- ((STYLENS,u'rotation-align'), None): cnv_string,
- ((STYLENS,u'rotation-angle'), None): cnv_string,
- ((STYLENS,u'row-height'), None): cnv_string,
- ((STYLENS,u'ruby-align'), None): cnv_string,
- ((STYLENS,u'ruby-position'), None): cnv_string,
- ((STYLENS,u'run-through'), None): cnv_string,
- ((STYLENS,u'scale-to'), None): cnv_string,
- ((STYLENS,u'scale-to-pages'), None): cnv_string,
- ((STYLENS,u'script-asian'), None): cnv_string,
- ((STYLENS,u'script-complex'), None): cnv_string,
- ((STYLENS,u'script-type'), None): cnv_string,
- ((STYLENS,u'shadow'), None): cnv_string,
- ((STYLENS,u'shrink-to-fit'), None): cnv_boolean,
- ((STYLENS,u'snap-to-layout-grid'), None): cnv_boolean,
- ((STYLENS,u'style'), None): cnv_string,
- ((STYLENS,u'style-name'), None): cnv_StyleNameRef,
- ((STYLENS,u'tab-stop-distance'), None): cnv_string,
- ((STYLENS,u'table-centering'), None): cnv_string,
- ((STYLENS,u'text-align-source'), None): cnv_string,
- ((STYLENS,u'text-autospace'), None): cnv_string,
- ((STYLENS,u'text-blinking'), None): cnv_boolean,
- ((STYLENS,u'text-combine'), None): cnv_string,
- ((STYLENS,u'text-combine-end-char'), None): cnv_string,
- ((STYLENS,u'text-combine-start-char'), None): cnv_string,
- ((STYLENS,u'text-emphasize'), None): cnv_string,
- ((STYLENS,u'text-line-through-color'), None): cnv_string,
- ((STYLENS,u'text-line-through-mode'), None): cnv_string,
- ((STYLENS,u'text-line-through-style'), None): cnv_string,
- ((STYLENS,u'text-line-through-text'), None): cnv_string,
- ((STYLENS,u'text-line-through-text-style'), None): cnv_string,
- ((STYLENS,u'text-line-through-type'), None): cnv_string,
- ((STYLENS,u'text-line-through-width'), None): cnv_string,
- ((STYLENS,u'text-outline'), None): cnv_boolean,
- ((STYLENS,u'text-overline-color'), None): cnv_string,
- ((STYLENS,u'text-overline-mode'), None): cnv_string,
- ((STYLENS,u'text-overline-style'), None): cnv_string,
- ((STYLENS,u'text-overline-type'), None): cnv_string,
- ((STYLENS,u'text-overline-width'), None): cnv_string,
- ((STYLENS,u'text-position'), None): cnv_string,
- ((STYLENS,u'text-rotation-angle'), None): cnv_string,
- ((STYLENS,u'text-rotation-scale'), None): cnv_string,
- ((STYLENS,u'text-scale'), None): cnv_string,
- ((STYLENS,u'text-underline-color'), None): cnv_string,
- ((STYLENS,u'text-underline-mode'), None): cnv_string,
- ((STYLENS,u'text-underline-style'), None): cnv_string,
- ((STYLENS,u'text-underline-type'), None): cnv_string,
- ((STYLENS,u'text-underline-width'), None): cnv_string,
- ((STYLENS,u'type'), None): cnv_string,
- ((STYLENS,u'use-optimal-column-width'), None): cnv_boolean,
- ((STYLENS,u'use-optimal-row-height'), None): cnv_boolean,
- ((STYLENS,u'use-window-font-color'), None): cnv_boolean,
- ((STYLENS,u'vertical-align'), None): cnv_string,
- ((STYLENS,u'vertical-pos'), None): cnv_string,
- ((STYLENS,u'vertical-rel'), None): cnv_string,
- ((STYLENS,u'volatile'), None): cnv_boolean,
- ((STYLENS,u'width'), None): cnv_string,
- ((STYLENS,u'wrap'), None): cnv_string,
- ((STYLENS,u'wrap-contour'), None): cnv_boolean,
- ((STYLENS,u'wrap-contour-mode'), None): cnv_string,
- ((STYLENS,u'wrap-dynamic-threshold'), None): cnv_length,
- ((STYLENS,u'writing-mode-automatic'), None): cnv_boolean,
- ((STYLENS,u'writing-mode'), None): cnv_string,
- ((SVGNS,u'accent-height'), None): cnv_integer,
- ((SVGNS,u'alphabetic'), None): cnv_integer,
- ((SVGNS,u'ascent'), None): cnv_integer,
- ((SVGNS,u'bbox'), None): cnv_string,
- ((SVGNS,u'cap-height'), None): cnv_integer,
- ((SVGNS,u'cx'), None): cnv_string,
- ((SVGNS,u'cy'), None): cnv_string,
- ((SVGNS,u'd'), None): cnv_string,
- ((SVGNS,u'descent'), None): cnv_integer,
- ((SVGNS,u'fill-rule'), None): cnv_string,
- ((SVGNS,u'font-family'), None): cnv_string,
- ((SVGNS,u'font-size'), None): cnv_string,
- ((SVGNS,u'font-stretch'), None): cnv_string,
- ((SVGNS,u'font-style'), None): cnv_string,
- ((SVGNS,u'font-variant'), None): cnv_string,
- ((SVGNS,u'font-weight'), None): cnv_string,
- ((SVGNS,u'fx'), None): cnv_string,
- ((SVGNS,u'fy'), None): cnv_string,
- ((SVGNS,u'gradientTransform'), None): cnv_string,
- ((SVGNS,u'gradientUnits'), None): cnv_string,
- ((SVGNS,u'hanging'), None): cnv_integer,
- ((SVGNS,u'height'), None): cnv_length,
- ((SVGNS,u'ideographic'), None): cnv_integer,
- ((SVGNS,u'mathematical'), None): cnv_integer,
- ((SVGNS,u'name'), None): cnv_string,
- ((SVGNS,u'offset'), None): cnv_string,
- ((SVGNS,u'origin'), None): cnv_string,
- ((SVGNS,u'overline-position'), None): cnv_integer,
- ((SVGNS,u'overline-thickness'), None): cnv_integer,
- ((SVGNS,u'panose-1'), None): cnv_string,
- ((SVGNS,u'path'), None): cnv_string,
- ((SVGNS,u'r'), None): cnv_length,
- ((SVGNS,u'rx'), None): cnv_length,
- ((SVGNS,u'ry'), None): cnv_length,
- ((SVGNS,u'slope'), None): cnv_integer,
- ((SVGNS,u'spreadMethod'), None): cnv_string,
- ((SVGNS,u'stemh'), None): cnv_integer,
- ((SVGNS,u'stemv'), None): cnv_integer,
- ((SVGNS,u'stop-color'), None): cnv_string,
- ((SVGNS,u'stop-opacity'), None): cnv_double,
- ((SVGNS,u'strikethrough-position'), None): cnv_integer,
- ((SVGNS,u'strikethrough-thickness'), None): cnv_integer,
- ((SVGNS,u'string'), None): cnv_string,
- ((SVGNS,u'stroke-color'), None): cnv_string,
- ((SVGNS,u'stroke-linecap'), None): cnv_stroke_linecap,
- ((SVGNS,u'stroke-opacity'), None): cnv_string,
- ((SVGNS,u'stroke-width'), None): cnv_length,
- ((SVGNS,u'type'), None): cnv_string,
- ((SVGNS,u'underline-position'), None): cnv_integer,
- ((SVGNS,u'underline-thickness'), None): cnv_integer,
- ((SVGNS,u'unicode-range'), None): cnv_string,
- ((SVGNS,u'units-per-em'), None): cnv_integer,
- ((SVGNS,u'v-alphabetic'), None): cnv_integer,
- ((SVGNS,u'v-hanging'), None): cnv_integer,
- ((SVGNS,u'v-ideographic'), None): cnv_integer,
- ((SVGNS,u'v-mathematical'), None): cnv_integer,
- ((SVGNS,u'viewBox'), None): cnv_viewbox,
- ((SVGNS,u'width'), None): cnv_length,
- ((SVGNS,u'widths'), None): cnv_string,
- ((SVGNS,u'x'), None): cnv_length,
- ((SVGNS,u'x-height'), None): cnv_integer,
- ((SVGNS,u'x1'), None): cnv_lengthorpercent,
- ((SVGNS,u'x2'), None): cnv_lengthorpercent,
- ((SVGNS,u'y'), None): cnv_length,
- ((SVGNS,u'y1'), None): cnv_lengthorpercent,
- ((SVGNS,u'y2'), None): cnv_lengthorpercent,
- ((TABLENS,u'acceptance-state'), None): cnv_string,
- ((TABLENS,u'add-empty-lines'), None): cnv_boolean,
- ((TABLENS,u'algorithm'), None): cnv_formula,
- ((TABLENS,u'align'), None): cnv_string,
- ((TABLENS,u'allow-empty-cell'), None): cnv_boolean,
- ((TABLENS,u'application-data'), None): cnv_string,
- ((TABLENS,u'automatic-find-labels'), None): cnv_boolean,
- ((TABLENS,u'base-cell-address'), None): cnv_string,
- ((TABLENS,u'bind-styles-to-content'), None): cnv_boolean,
- ((TABLENS,u'border-color'), None): cnv_string,
- ((TABLENS,u'border-model'), None): cnv_string,
- ((TABLENS,u'buttons'), None): cnv_string,
- ((TABLENS,u'buttons'), None): cnv_string,
- ((TABLENS,u'case-sensitive'), None): cnv_boolean,
- ((TABLENS,u'case-sensitive'), None): cnv_string,
- ((TABLENS,u'cell-address'), None): cnv_string,
- ((TABLENS,u'cell-range-address'), None): cnv_string,
- ((TABLENS,u'cell-range-address'), None): cnv_string,
- ((TABLENS,u'cell-range'), None): cnv_string,
- ((TABLENS,u'column'), None): cnv_integer,
- ((TABLENS,u'comment'), None): cnv_string,
- ((TABLENS,u'condition'), None): cnv_formula,
- ((TABLENS,u'condition-source'), None): cnv_string,
- ((TABLENS,u'condition-source-range-address'), None): cnv_string,
- ((TABLENS,u'contains-error'), None): cnv_boolean,
- ((TABLENS,u'contains-header'), None): cnv_boolean,
- ((TABLENS,u'content-validation-name'), None): cnv_string,
- ((TABLENS,u'copy-back'), None): cnv_boolean,
- ((TABLENS,u'copy-formulas'), None): cnv_boolean,
- ((TABLENS,u'copy-styles'), None): cnv_boolean,
- ((TABLENS,u'count'), None): cnv_positiveInteger,
- ((TABLENS,u'country'), None): cnv_token,
- ((TABLENS,u'data-cell-range-address'), None): cnv_string,
- ((TABLENS,u'data-field'), None): cnv_string,
- ((TABLENS,u'data-type'), None): cnv_string,
- ((TABLENS,u'database-name'), None): cnv_string,
- ((TABLENS,u'database-table-name'), None): cnv_string,
- ((TABLENS,u'date-end'), None): cnv_string,
- ((TABLENS,u'date-start'), None): cnv_string,
- ((TABLENS,u'date-value'), None): cnv_date,
- ((TABLENS,u'default-cell-style-name'), None): cnv_StyleNameRef,
- ((TABLENS,u'direction'), None): cnv_string,
- ((TABLENS,u'display-border'), None): cnv_boolean,
- ((TABLENS,u'display'), None): cnv_boolean,
- ((TABLENS,u'display-duplicates'), None): cnv_boolean,
- ((TABLENS,u'display-filter-buttons'), None): cnv_boolean,
- ((TABLENS,u'display-list'), None): cnv_string,
- ((TABLENS,u'display-member-mode'), None): cnv_string,
- ((TABLENS,u'drill-down-on-double-click'), None): cnv_boolean,
- ((TABLENS,u'embedded-number-behavior'), None): cnv_string,
- ((TABLENS,u'enabled'), None): cnv_boolean,
- ((TABLENS,u'end-cell-address'), None): cnv_string,
- ((TABLENS,u'end'), None): cnv_string,
- ((TABLENS,u'end-column'), None): cnv_integer,
- ((TABLENS,u'end-position'), None): cnv_integer,
- ((TABLENS,u'end-row'), None): cnv_integer,
- ((TABLENS,u'end-table'), None): cnv_integer,
- ((TABLENS,u'end-x'), None): cnv_length,
- ((TABLENS,u'end-y'), None): cnv_length,
- ((TABLENS,u'execute'), None): cnv_boolean,
- ((TABLENS,u'expression'), None): cnv_formula,
- ((TABLENS,u'field-name'), None): cnv_string,
- ((TABLENS,u'field-number'), None): cnv_nonNegativeInteger,
- ((TABLENS,u'field-number'), None): cnv_string,
- ((TABLENS,u'filter-name'), None): cnv_string,
- ((TABLENS,u'filter-options'), None): cnv_string,
- ((TABLENS,u'first-row-end-column'), None): cnv_rowOrCol,
- ((TABLENS,u'first-row-start-column'), None): cnv_rowOrCol,
- ((TABLENS,u'formula'), None): cnv_formula,
- ((TABLENS,u'function'), None): cnv_string,
- ((TABLENS,u'function'), None): cnv_string,
- ((TABLENS,u'grand-total'), None): cnv_string,
- ((TABLENS,u'group-by-field-number'), None): cnv_nonNegativeInteger,
- ((TABLENS,u'grouped-by'), None): cnv_string,
- ((TABLENS,u'has-persistent-data'), None): cnv_boolean,
- ((TABLENS,u'id'), None): cnv_string,
- ((TABLENS,u'identify-categories'), None): cnv_boolean,
- ((TABLENS,u'ignore-empty-rows'), None): cnv_boolean,
- ((TABLENS,u'index'), None): cnv_nonNegativeInteger,
- ((TABLENS,u'is-active'), None): cnv_boolean,
- ((TABLENS,u'is-data-layout-field'), None): cnv_string,
- ((TABLENS,u'is-selection'), None): cnv_boolean,
- ((TABLENS,u'is-sub-table'), None): cnv_boolean,
- ((TABLENS,u'label-cell-range-address'), None): cnv_string,
- ((TABLENS,u'language'), None): cnv_token,
- ((TABLENS,u'language'), None): cnv_token,
- ((TABLENS,u'last-column-spanned'), None): cnv_positiveInteger,
- ((TABLENS,u'last-row-end-column'), None): cnv_rowOrCol,
- ((TABLENS,u'last-row-spanned'), None): cnv_positiveInteger,
- ((TABLENS,u'last-row-start-column'), None): cnv_rowOrCol,
- ((TABLENS,u'layout-mode'), None): cnv_string,
- ((TABLENS,u'link-to-source-data'), None): cnv_boolean,
- ((TABLENS,u'marked-invalid'), None): cnv_boolean,
- ((TABLENS,u'matrix-covered'), None): cnv_boolean,
- ((TABLENS,u'maximum-difference'), None): cnv_double,
- ((TABLENS,u'member-count'), None): cnv_nonNegativeInteger,
- ((TABLENS,u'member-name'), None): cnv_string,
- ((TABLENS,u'member-type'), None): cnv_string,
- ((TABLENS,u'message-type'), None): cnv_string,
- ((TABLENS,u'mode'), None): cnv_string,
- ((TABLENS,u'multi-deletion-spanned'), None): cnv_integer,
- ((TABLENS,u'name'), None): cnv_string,
- ((TABLENS,u'name'), None): cnv_string,
- ((TABLENS,u'null-year'), None): cnv_positiveInteger,
- ((TABLENS,u'number-columns-repeated'), None): cnv_positiveInteger,
- ((TABLENS,u'number-columns-spanned'), None): cnv_positiveInteger,
- ((TABLENS,u'number-matrix-columns-spanned'), None): cnv_positiveInteger,
- ((TABLENS,u'number-matrix-rows-spanned'), None): cnv_positiveInteger,
- ((TABLENS,u'number-rows-repeated'), None): cnv_positiveInteger,
- ((TABLENS,u'number-rows-spanned'), None): cnv_positiveInteger,
- ((TABLENS,u'object-name'), None): cnv_string,
- ((TABLENS,u'on-update-keep-size'), None): cnv_boolean,
- ((TABLENS,u'on-update-keep-styles'), None): cnv_boolean,
- ((TABLENS,u'operator'), None): cnv_string,
- ((TABLENS,u'operator'), None): cnv_string,
- ((TABLENS,u'order'), None): cnv_string,
- ((TABLENS,u'orientation'), None): cnv_string,
- ((TABLENS,u'orientation'), None): cnv_string,
- ((TABLENS,u'page-breaks-on-group-change'), None): cnv_boolean,
- ((TABLENS,u'paragraph-style-name'), None): cnv_StyleNameRef,
- ((TABLENS,u'parse-sql-statement'), None): cnv_boolean,
- ((TABLENS,u'password'), None): cnv_string,
- ((TABLENS,u'position'), None): cnv_integer,
- ((TABLENS,u'precision-as-shown'), None): cnv_boolean,
- ((TABLENS,u'print'), None): cnv_boolean,
- ((TABLENS,u'print-ranges'), None): cnv_string,
- ((TABLENS,u'protect'), None): cnv_boolean,
- ((TABLENS,u'protected'), None): cnv_boolean,
- ((TABLENS,u'protection-key'), None): cnv_string,
- ((TABLENS,u'protection-key-digest-algorithm'), None): cnv_anyURI,
- ((TABLENS,u'query-name'), None): cnv_string,
- ((TABLENS,u'range-usable-as'), None): cnv_string,
- ((TABLENS,u'rfc-language-tag'), None): cnv_language,
- ((TABLENS,u'refresh-delay'), None): cnv_boolean,
- ((TABLENS,u'refresh-delay'), None): cnv_duration,
- ((TABLENS,u'rejecting-change-id'), None): cnv_string,
- ((TABLENS,u'row'), None): cnv_integer,
- ((TABLENS,u'scenario-ranges'), None): cnv_string,
- ((TABLENS,u'script'), None): cnv_string,
- ((TABLENS,u'search-criteria-must-apply-to-whole-cell'), None): cnv_boolean,
- ((TABLENS,u'selected-page'), None): cnv_string,
- ((TABLENS,u'show-details'), None): cnv_boolean,
- ((TABLENS,u'show-empty'), None): cnv_boolean,
- ((TABLENS,u'show-empty'), None): cnv_string,
- ((TABLENS,u'show-filter-button'), None): cnv_boolean,
- ((TABLENS,u'sort-mode'), None): cnv_string,
- ((TABLENS,u'source-cell-range-addresses'), None): cnv_string,
- ((TABLENS,u'source-cell-range-addresses'), None): cnv_string,
- ((TABLENS,u'source-field-name'), None): cnv_string,
- ((TABLENS,u'source-field-name'), None): cnv_string,
- ((TABLENS,u'source-name'), None): cnv_string,
- ((TABLENS,u'sql-statement'), None): cnv_string,
- ((TABLENS,u'start'), None): cnv_string,
- ((TABLENS,u'start-column'), None): cnv_integer,
- ((TABLENS,u'start-position'), None): cnv_integer,
- ((TABLENS,u'start-row'), None): cnv_integer,
- ((TABLENS,u'start-table'), None): cnv_integer,
- ((TABLENS,u'status'), None): cnv_string,
- ((TABLENS,u'step'), None): cnv_double,
- ((TABLENS,u'steps'), None): cnv_positiveInteger,
- ((TABLENS,u'structure-protected'), None): cnv_boolean,
- ((TABLENS,u'style-name'), None): cnv_StyleNameRef,
- ((TABLENS,u'table-background'), None): cnv_boolean,
- ((TABLENS,u'table'), None): cnv_integer,
- ((TABLENS,u'table-name'), None): cnv_string,
- ((TABLENS,u'target-cell-address'), None): cnv_string,
- ((TABLENS,u'target-cell-address'), None): cnv_string,
- ((TABLENS,u'target-range-address'), None): cnv_string,
- ((TABLENS,u'target-range-address'), None): cnv_string,
- ((TABLENS,u'template-name'), None): cnv_string,
- ((TABLENS,u'title'), None): cnv_string,
- ((TABLENS,u'track-changes'), None): cnv_boolean,
- ((TABLENS,u'type'), None): cnv_string,
- ((TABLENS,u'use-banding-columns-styles'), None): cnv_boolean,
- ((TABLENS,u'use-banding-rows-styles'), None): cnv_boolean,
- ((TABLENS,u'use-first-column-styles'), None): cnv_boolean,
- ((TABLENS,u'use-first-row-styles'), None): cnv_boolean,
- ((TABLENS,u'use-labels'), None): cnv_string,
- ((TABLENS,u'use-last-column-styles'), None): cnv_boolean,
- ((TABLENS,u'use-last-row-styles'), None): cnv_boolean,
- ((TABLENS,u'use-regular-expressions'), None): cnv_boolean,
- ((TABLENS,u'use-wildcards'), None): cnv_boolean,
- ((TABLENS,u'used-hierarchy'), None): cnv_integer,
- ((TABLENS,u'user-name'), None): cnv_string,
- ((TABLENS,u'value'), None): cnv_string,
- ((TABLENS,u'value'), None): cnv_string,
- ((TABLENS,u'value-type'), None): cnv_string,
- ((TABLENS,u'visibility'), None): cnv_string,
- ((TEXTNS,u'active'), None): cnv_boolean,
- ((TEXTNS,u'address'), None): cnv_string,
- ((TEXTNS,u'alphabetical-separators'), None): cnv_boolean,
- ((TEXTNS,u'anchor-page-number'), None): cnv_positiveInteger,
- ((TEXTNS,u'anchor-type'), None): cnv_string,
- ((TEXTNS,u'animation'), None): cnv_string,
- ((TEXTNS,u'animation-delay'), None): cnv_string,
- ((TEXTNS,u'animation-direction'), None): cnv_string,
- ((TEXTNS,u'animation-repeat'), None): cnv_string,
- ((TEXTNS,u'animation-start-inside'), None): cnv_boolean,
- ((TEXTNS,u'animation-steps'), None): cnv_length,
- ((TEXTNS,u'animation-stop-inside'), None): cnv_boolean,
- ((TEXTNS,u'annote'), None): cnv_string,
- ((TEXTNS,u'author'), None): cnv_string,
- ((TEXTNS,u'bibliography-data-field'), None): cnv_string,
- ((TEXTNS,u'bibliography-type'), None): cnv_string,
- ((TEXTNS,u'booktitle'), None): cnv_string,
- ((TEXTNS,u'bullet-char'), None): cnv_string,
- ((TEXTNS,u'bullet-relative-size'), None): cnv_string,
- ((TEXTNS,u'c'), None): cnv_nonNegativeInteger,
- ((TEXTNS,u'capitalize-entries'), None): cnv_boolean,
- ((TEXTNS,u'caption-sequence-format'), None): cnv_string,
- ((TEXTNS,u'caption-sequence-name'), None): cnv_string,
- ((TEXTNS,u'change-id'), None): cnv_IDREF,
- ((TEXTNS,u'chapter'), None): cnv_string,
- ((TEXTNS,u'citation-body-style-name'), None): cnv_StyleNameRef,
- ((TEXTNS,u'citation-style-name'), None): cnv_StyleNameRef,
- ((TEXTNS,u'class-names'), None): cnv_NCNames,
- ((TEXTNS,u'column-name'), None): cnv_string,
- ((TEXTNS,u'combine-entries'), None): cnv_boolean,
- ((TEXTNS,u'combine-entries-with-dash'), None): cnv_boolean,
- ((TEXTNS,u'combine-entries-with-pp'), None): cnv_boolean,
- ((TEXTNS,u'comma-separated'), None): cnv_boolean,
- ((TEXTNS,u'cond-style-name'), None): cnv_StyleNameRef,
- ((TEXTNS,u'condition'), None): cnv_formula,
- ((TEXTNS,u'connection-name'), None): cnv_string,
- ((TEXTNS,u'consecutive-numbering'), None): cnv_boolean,
- ((TEXTNS,u'continue-list'), None): cnv_IDREF,
- ((TEXTNS,u'continue-numbering'), None): cnv_boolean,
- ((TEXTNS,u'copy-outline-levels'), None): cnv_boolean,
- ((TEXTNS,u'count-empty-lines'), None): cnv_boolean,
- ((TEXTNS,u'count-in-text-boxes'), None): cnv_boolean,
- ((TEXTNS,u'current-value'), None): cnv_boolean,
- ((TEXTNS,u'custom1'), None): cnv_string,
- ((TEXTNS,u'custom2'), None): cnv_string,
- ((TEXTNS,u'custom3'), None): cnv_string,
- ((TEXTNS,u'custom4'), None): cnv_string,
- ((TEXTNS,u'custom5'), None): cnv_string,
- ((TEXTNS,u'database-name'), None): cnv_string,
- ((TEXTNS,u'date-adjust'), None): cnv_duration,
- ((TEXTNS,u'date-value'), None): cnv_date,
-# ((TEXTNS,u'date-value'), None): cnv_dateTime,
- ((TEXTNS,u'default-style-name'), None): cnv_StyleNameRef,
- ((TEXTNS,u'description'), None): cnv_string,
- ((TEXTNS,u'display'), None): cnv_string,
- ((TEXTNS,u'display-levels'), None): cnv_positiveInteger,
- ((TEXTNS,u'display-outline-level'), None): cnv_nonNegativeInteger,
- ((TEXTNS,u'dont-balance-text-columns'), None): cnv_boolean,
- ((TEXTNS,u'duration'), None): cnv_duration,
- ((TEXTNS,u'edition'), None): cnv_string,
- ((TEXTNS,u'editor'), None): cnv_string,
- ((TEXTNS,u'filter-name'), None): cnv_string,
- ((TEXTNS,u'fixed'), None): cnv_boolean,
- ((TEXTNS,u'footnotes-position'), None): cnv_string,
- ((TEXTNS,u'formula'), None): cnv_formula,
- ((TEXTNS,u'global'), None): cnv_boolean,
- ((TEXTNS,u'howpublished'), None): cnv_string,
- ((TEXTNS,u'id'), None): cnv_ID,
-# ((TEXTNS,u'id'), None): cnv_string,
- ((TEXTNS,u'identifier'), None): cnv_string,
- ((TEXTNS,u'ignore-case'), None): cnv_boolean,
- ((TEXTNS,u'increment'), None): cnv_nonNegativeInteger,
- ((TEXTNS,u'index-name'), None): cnv_string,
- ((TEXTNS,u'index-scope'), None): cnv_string,
- ((TEXTNS,u'institution'), None): cnv_string,
- ((TEXTNS,u'is-hidden'), None): cnv_boolean,
- ((TEXTNS,u'is-list-header'), None): cnv_boolean,
- ((TEXTNS,u'isbn'), None): cnv_string,
- ((TEXTNS,u'issn'), None): cnv_string,
- ((TEXTNS,u'issn'), None): cnv_string,
- ((TEXTNS,u'journal'), None): cnv_string,
- ((TEXTNS,u'key'), None): cnv_string,
- ((TEXTNS,u'key1'), None): cnv_string,
- ((TEXTNS,u'key1-phonetic'), None): cnv_string,
- ((TEXTNS,u'key2'), None): cnv_string,
- ((TEXTNS,u'key2-phonetic'), None): cnv_string,
- ((TEXTNS,u'kind'), None): cnv_string,
- ((TEXTNS,u'label'), None): cnv_string,
- ((TEXTNS,u'label-followed-by'), None): cnv_string,
- ((TEXTNS,u'level'), None): cnv_positiveInteger,
- ((TEXTNS,u'line-break'), None): cnv_boolean,
- ((TEXTNS,u'line-number'), None): cnv_string,
- ((TEXTNS,u'list-id'), None): cnv_NCName,
- ((TEXTNS,u'list-level-position-and-space-mode'), None): cnv_string,
- ((TEXTNS,u'list-tab-stop-position'), None): cnv_length,
- ((TEXTNS,u'main-entry'), None): cnv_boolean,
- ((TEXTNS,u'main-entry-style-name'), None): cnv_StyleNameRef,
- ((TEXTNS,u'master-page-name'), None): cnv_StyleNameRef,
- ((TEXTNS,u'min-label-distance'), None): cnv_string,
- ((TEXTNS,u'min-label-width'), None): cnv_string,
- ((TEXTNS,u'month'), None): cnv_string,
- ((TEXTNS,u'name'), None): cnv_string,
- ((TEXTNS,u'note-class'), None): cnv_textnoteclass,
- ((TEXTNS,u'note'), None): cnv_string,
- ((TEXTNS,u'number'), None): cnv_string,
- ((TEXTNS,u'number-lines'), None): cnv_boolean,
- ((TEXTNS,u'number-position'), None): cnv_string,
- ((TEXTNS,u'numbered-entries'), None): cnv_boolean,
- ((TEXTNS,u'offset'), None): cnv_string,
- ((TEXTNS,u'organizations'), None): cnv_string,
- ((TEXTNS,u'outline-level'), None): cnv_string,
- ((TEXTNS,u'page-adjust'), None): cnv_integer,
- ((TEXTNS,u'pages'), None): cnv_string,
- ((TEXTNS,u'placeholder-type'), None): cnv_string,
- ((TEXTNS,u'prefix'), None): cnv_string,
- ((TEXTNS,u'protected'), None): cnv_boolean,
- ((TEXTNS,u'protection-key'), None): cnv_string,
- ((TEXTNS,u'protection-key-digest-algorithm'), None): cnv_anyURI,
- ((TEXTNS,u'publisher'), None): cnv_string,
- ((TEXTNS,u'ref-name'), None): cnv_string,
- ((TEXTNS,u'reference-format'), None): cnv_string,
- ((TEXTNS,u'relative-tab-stop-position'), None): cnv_boolean,
- ((TEXTNS,u'report-type'), None): cnv_string,
- ((TEXTNS,u'restart-numbering'), None): cnv_boolean,
- ((TEXTNS,u'restart-on-page'), None): cnv_boolean,
- ((TEXTNS,u'row-number'), None): cnv_nonNegativeInteger,
- ((TEXTNS,u'school'), None): cnv_string,
- ((TEXTNS,u'section-name'), None): cnv_string,
- ((TEXTNS,u'select-page'), None): cnv_string,
- ((TEXTNS,u'separation-character'), None): cnv_string,
- ((TEXTNS,u'series'), None): cnv_string,
- ((TEXTNS,u'sort-algorithm'), None): cnv_string,
- ((TEXTNS,u'sort-ascending'), None): cnv_boolean,
- ((TEXTNS,u'sort-by-position'), None): cnv_boolean,
- ((TEXTNS,u'space-before'), None): cnv_string,
- ((TEXTNS,u'start-numbering-at'), None): cnv_string,
- ((TEXTNS,u'start-value'), None): cnv_nonNegativeInteger,
- ((TEXTNS,u'start-value'), None): cnv_positiveInteger,
- ((TEXTNS,u'string-value'), None): cnv_string,
- ((TEXTNS,u'string-value-if-false'), None): cnv_string,
- ((TEXTNS,u'string-value-if-true'), None): cnv_string,
- ((TEXTNS,u'string-value-phonetic'), None): cnv_string,
- ((TEXTNS,u'style-name'), None): cnv_StyleNameRef,
- ((TEXTNS,u'style-override'), None): cnv_StyleNameRef,
- ((TEXTNS,u'suffix'), None): cnv_string,
- ((TEXTNS,u'tab-ref'), None): cnv_nonNegativeInteger,
- ((TEXTNS,u'table-name'), None): cnv_string,
- ((TEXTNS,u'table-type'), None): cnv_string,
- ((TEXTNS,u'time-adjust'), None): cnv_duration,
- ((TEXTNS,u'time-value'), None): cnv_dateTime,
- ((TEXTNS,u'time-value'), None): cnv_time,
- ((TEXTNS,u'title'), None): cnv_string,
- ((TEXTNS,u'track-changes'), None): cnv_boolean,
- ((TEXTNS,u'url'), None): cnv_string,
- ((TEXTNS,u'use-caption'), None): cnv_boolean,
- ((TEXTNS,u'use-chart-objects'), None): cnv_boolean,
- ((TEXTNS,u'use-draw-objects'), None): cnv_boolean,
- ((TEXTNS,u'use-floating-frames'), None): cnv_boolean,
- ((TEXTNS,u'use-graphics'), None): cnv_boolean,
- ((TEXTNS,u'use-index-marks'), None): cnv_boolean,
- ((TEXTNS,u'use-index-source-styles'), None): cnv_boolean,
- ((TEXTNS,u'use-keys-as-entries'), None): cnv_boolean,
- ((TEXTNS,u'use-math-objects'), None): cnv_boolean,
- ((TEXTNS,u'use-objects'), None): cnv_boolean,
- ((TEXTNS,u'use-other-objects'), None): cnv_boolean,
- ((TEXTNS,u'use-outline-level'), None): cnv_boolean,
- ((TEXTNS,u'use-soft-page-breaks'), None): cnv_boolean,
- ((TEXTNS,u'use-spreadsheet-objects'), None): cnv_boolean,
- ((TEXTNS,u'use-tables'), None): cnv_boolean,
- ((TEXTNS,u'value'), None): cnv_nonNegativeInteger,
- ((TEXTNS,u'visited-style-name'), None): cnv_StyleNameRef,
- ((TEXTNS,u'volume'), None): cnv_string,
- ((TEXTNS,u'year'), None): cnv_string,
- ((XFORMSNS,u'bind'), None): cnv_string,
- ((XHTMLNS,u'about'), None): cnv_anyURI,
- ((XHTMLNS,u'content'), None): cnv_string,
- ((XHTMLNS,u'datatype'), None): cnv_anyURI,
- ((XHTMLNS,u'property'), None): cnv_anyURI,
- ((XLINKNS,u'actuate'), None): cnv_string,
- ((XLINKNS,u'href'), None): cnv_anyURI,
- ((XLINKNS,u'show'), None): cnv_xlinkshow,
- ((XLINKNS,u'title'), None): cnv_string,
- ((XLINKNS,u'type'), None): cnv_xlinktype,
- ((XMLNS,u'id'), None): cnv_NCName,
-}
-
-class AttrConverters:
- def convert(self, attribute, value, element):
- """ Based on the element, figures out how to check/convert the attribute value
- All values are converted to string
- """
- conversion = attrconverters.get((attribute, element.qname), None)
- if conversion is not None:
- return conversion(attribute, value, element)
- else:
- conversion = attrconverters.get((attribute, None), None)
- if conversion is not None:
- return conversion(attribute, value, element)
- if sys.version_info[0]==2:
- return unicode(value)
- else:
- return str(value)
-
diff --git a/libs/odf/chart.py b/libs/odf/chart.py
deleted file mode 100644
index b05dcce..0000000
--- a/libs/odf/chart.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2013 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-from __future__ import absolute_import
-from .namespaces import CHARTNS
-from .element import Element
-
-# Autogenerated
-def Axis(**args):
- return Element(qname = (CHARTNS,'axis'), **args)
-
-def Categories(**args):
- return Element(qname = (CHARTNS,'categories'), **args)
-
-def Chart(**args):
- return Element(qname = (CHARTNS,'chart'), **args)
-
-def DataLabel(**args):
- return Element(qname = (CHARTNS,'data-label'), **args)
-
-def DataPoint(**args):
- return Element(qname = (CHARTNS,'data-point'), **args)
-
-def Domain(**args):
- return Element(qname = (CHARTNS,'domain'), **args)
-
-def Equation(**args):
- return Element(qname = (CHARTNS,'equation'), **args)
-
-def ErrorIndicator(**args):
- return Element(qname = (CHARTNS,'error-indicator'), **args)
-
-def Floor(**args):
- return Element(qname = (CHARTNS,'floor'), **args)
-
-def Footer(**args):
- return Element(qname = (CHARTNS,'footer'), **args)
-
-def Grid(**args):
- return Element(qname = (CHARTNS,'grid'), **args)
-
-def LabelSeparator(**args):
- return Element(qname = (CHARTNS,'label-separator'), **args)
-
-def Legend(**args):
- return Element(qname = (CHARTNS,'legend'), **args)
-
-def MeanValue(**args):
- return Element(qname = (CHARTNS,'mean-value'), **args)
-
-def PlotArea(**args):
- return Element(qname = (CHARTNS,'plot-area'), **args)
-
-def RegressionCurve(**args):
- return Element(qname = (CHARTNS,'regression-curve'), **args)
-
-def Series(**args):
- return Element(qname = (CHARTNS,'series'), **args)
-
-def StockGainMarker(**args):
- return Element(qname = (CHARTNS,'stock-gain-marker'), **args)
-
-def StockLossMarker(**args):
- return Element(qname = (CHARTNS,'stock-loss-marker'), **args)
-
-def StockRangeLine(**args):
- return Element(qname = (CHARTNS,'stock-range-line'), **args)
-
-def Subtitle(**args):
- return Element(qname = (CHARTNS,'subtitle'), **args)
-
-def SymbolImage(**args):
- return Element(qname = (CHARTNS,'symbol-image'), **args)
-
-def Title(**args):
- return Element(qname = (CHARTNS,'title'), **args)
-
-def Wall(**args):
- return Element(qname = (CHARTNS,'wall'), **args)
-
diff --git a/libs/odf/config.py b/libs/odf/config.py
deleted file mode 100644
index f33f361..0000000
--- a/libs/odf/config.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import CONFIGNS
-from element import Element
-
-# Autogenerated
-def ConfigItem(**args):
- return Element(qname = (CONFIGNS, 'config-item'), **args)
-
-def ConfigItemMapEntry(**args):
- return Element(qname = (CONFIGNS,'config-item-map-entry'), **args)
-
-def ConfigItemMapIndexed(**args):
- return Element(qname = (CONFIGNS,'config-item-map-indexed'), **args)
-
-def ConfigItemMapNamed(**args):
- return Element(qname = (CONFIGNS,'config-item-map-named'), **args)
-
-def ConfigItemSet(**args):
- return Element(qname = (CONFIGNS, 'config-item-set'), **args)
-
diff --git a/libs/odf/dc.py b/libs/odf/dc.py
deleted file mode 100644
index 7c96776..0000000
--- a/libs/odf/dc.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import DCNS
-from element import Element
-
-# Autogenerated
-def Creator(**args):
- return Element(qname = (DCNS,'creator'), **args)
-
-def Date(**args):
- return Element(qname = (DCNS,'date'), **args)
-
-def Description(**args):
- return Element(qname = (DCNS,'description'), **args)
-
-def Language(**args):
- return Element(qname = (DCNS,'language'), **args)
-
-def Subject(**args):
- return Element(qname = (DCNS,'subject'), **args)
-
-def Title(**args):
- return Element(qname = (DCNS,'title'), **args)
-
-# The following complete the Dublin Core elements, but there is no
-# guarantee a compliant implementation of OpenDocument will preserve
-# these elements
-
-#def Contributor(**args):
-# return Element(qname = (DCNS,'contributor'), **args)
-
-#def Coverage(**args):
-# return Element(qname = (DCNS,'coverage'), **args)
-
-#def Format(**args):
-# return Element(qname = (DCNS,'format'), **args)
-
-#def Identifier(**args):
-# return Element(qname = (DCNS,'identifier'), **args)
-
-#def Publisher(**args):
-# return Element(qname = (DCNS,'publisher'), **args)
-
-#def Relation(**args):
-# return Element(qname = (DCNS,'relation'), **args)
-
-#def Rights(**args):
-# return Element(qname = (DCNS,'rights'), **args)
-
-#def Source(**args):
-# return Element(qname = (DCNS,'source'), **args)
-
-#def Type(**args):
-# return Element(qname = (DCNS,'type'), **args)
diff --git a/libs/odf/dr3d.py b/libs/odf/dr3d.py
deleted file mode 100644
index 989e114..0000000
--- a/libs/odf/dr3d.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-import sys, os.path
-sys.path.append(os.path.dirname(__file__))
-
-from namespaces import DR3DNS
-from element import Element
-from draw import StyleRefElement
-
-# Autogenerated
-def Cube(**args):
- return StyleRefElement(qname = (DR3DNS,'cube'), **args)
-
-def Extrude(**args):
- return StyleRefElement(qname = (DR3DNS,'extrude'), **args)
-
-def Light(Element):
- return StyleRefElement(qname = (DR3DNS,'light'), **args)
-
-def Rotate(**args):
- return StyleRefElement(qname = (DR3DNS,'rotate'), **args)
-
-def Scene(**args):
- return StyleRefElement(qname = (DR3DNS,'scene'), **args)
-
-def Sphere(**args):
- return StyleRefElement(qname = (DR3DNS,'sphere'), **args)
-
diff --git a/libs/odf/draw.py b/libs/odf/draw.py
deleted file mode 100644
index 122d40f..0000000
--- a/libs/odf/draw.py
+++ /dev/null
@@ -1,188 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-import sys, os.path
-sys.path.append(os.path.dirname(__file__))
-from namespaces import DRAWNS, STYLENS, PRESENTATIONNS
-from element import Element
-
-def StyleRefElement(stylename=None, classnames=None, **args):
- qattrs = {}
- if stylename is not None:
- f = stylename.getAttrNS(STYLENS, 'family')
- if f == 'graphic':
- qattrs[(DRAWNS,u'style-name')]= stylename
- elif f == 'presentation':
- qattrs[(PRESENTATIONNS,u'style-name')]= stylename
- else:
- raise ValueError( "Style's family must be either 'graphic' or 'presentation'")
- if classnames is not None:
- f = classnames[0].getAttrNS(STYLENS, 'family')
- if f == 'graphic':
- qattrs[(DRAWNS,u'class-names')]= classnames
- elif f == 'presentation':
- qattrs[(PRESENTATIONNS,u'class-names')]= classnames
- else:
- raise ValueError( "Style's family must be either 'graphic' or 'presentation'")
- return Element(qattributes=qattrs, **args)
-
-def DrawElement(name=None, **args):
- e = Element(name=name, **args)
- if 'displayname' not in args:
- e.setAttrNS(DRAWNS,'display-name', name)
- return e
-
-# Autogenerated
-def A(**args):
- args.setdefault('type', 'simple')
- return Element(qname = (DRAWNS,'a'), **args)
-
-def Applet(**args):
- return Element(qname = (DRAWNS,'applet'), **args)
-
-def AreaCircle(**args):
- return Element(qname = (DRAWNS,'area-circle'), **args)
-
-def AreaPolygon(**args):
- return Element(qname = (DRAWNS,'area-polygon'), **args)
-
-def AreaRectangle(**args):
- return Element(qname = (DRAWNS,'area-rectangle'), **args)
-
-def Caption(**args):
- return StyleRefElement(qname = (DRAWNS,'caption'), **args)
-
-def Circle(**args):
- return StyleRefElement(qname = (DRAWNS,'circle'), **args)
-
-def Connector(**args):
- return StyleRefElement(qname = (DRAWNS,'connector'), **args)
-
-def ContourPath(**args):
- return Element(qname = (DRAWNS,'contour-path'), **args)
-
-def ContourPolygon(**args):
- return Element(qname = (DRAWNS,'contour-polygon'), **args)
-
-def Control(**args):
- return StyleRefElement(qname = (DRAWNS,'control'), **args)
-
-def CustomShape(**args):
- return StyleRefElement(qname = (DRAWNS,'custom-shape'), **args)
-
-def Ellipse(**args):
- return StyleRefElement(qname = (DRAWNS,'ellipse'), **args)
-
-def EnhancedGeometry(**args):
- return Element(qname = (DRAWNS,'enhanced-geometry'), **args)
-
-def Equation(**args):
- return Element(qname = (DRAWNS,'equation'), **args)
-
-def FillImage(**args):
- args.setdefault('type', 'simple')
- return DrawElement(qname = (DRAWNS,'fill-image'), **args)
-
-def FloatingFrame(**args):
- args.setdefault('type', 'simple')
- return Element(qname = (DRAWNS,'floating-frame'), **args)
-
-def Frame(**args):
- return StyleRefElement(qname = (DRAWNS,'frame'), **args)
-
-def G(**args):
- return StyleRefElement(qname = (DRAWNS,'g'), **args)
-
-def GluePoint(**args):
- return Element(qname = (DRAWNS,'glue-point'), **args)
-
-def Gradient(**args):
- return DrawElement(qname = (DRAWNS,'gradient'), **args)
-
-def Handle(**args):
- return Element(qname = (DRAWNS,'handle'), **args)
-
-def Hatch(**args):
- return DrawElement(qname = (DRAWNS,'hatch'), **args)
-
-def Image(**args):
- return Element(qname = (DRAWNS,'image'), **args)
-
-def ImageMap(**args):
- return Element(qname = (DRAWNS,'image-map'), **args)
-
-def Layer(**args):
- return Element(qname = (DRAWNS,'layer'), **args)
-
-def LayerSet(**args):
- return Element(qname = (DRAWNS,'layer-set'), **args)
-
-def Line(**args):
- return StyleRefElement(qname = (DRAWNS,'line'), **args)
-
-def Marker(**args):
- return DrawElement(qname = (DRAWNS,'marker'), **args)
-
-def Measure(**args):
- return StyleRefElement(qname = (DRAWNS,'measure'), **args)
-
-def Object(**args):
- return Element(qname = (DRAWNS,'object'), **args)
-
-def ObjectOle(**args):
- return Element(qname = (DRAWNS,'object-ole'), **args)
-
-def Opacity(**args):
- return DrawElement(qname = (DRAWNS,'opacity'), **args)
-
-def Page(**args):
- return Element(qname = (DRAWNS,'page'), **args)
-
-def PageThumbnail(**args):
- return StyleRefElement(qname = (DRAWNS,'page-thumbnail'), **args)
-
-def Param(**args):
- return Element(qname = (DRAWNS,'param'), **args)
-
-def Path(**args):
- return StyleRefElement(qname = (DRAWNS,'path'), **args)
-
-def Plugin(**args):
- args.setdefault('type', 'simple')
- return Element(qname = (DRAWNS,'plugin'), **args)
-
-def Polygon(**args):
- return StyleRefElement(qname = (DRAWNS,'polygon'), **args)
-
-def Polyline(**args):
- return StyleRefElement(qname = (DRAWNS,'polyline'), **args)
-
-def Rect(**args):
- return StyleRefElement(qname = (DRAWNS,'rect'), **args)
-
-def RegularPolygon(**args):
- return StyleRefElement(qname = (DRAWNS,'regular-polygon'), **args)
-
-def StrokeDash(**args):
- return DrawElement(qname = (DRAWNS,'stroke-dash'), **args)
-
-def TextBox(**args):
- return Element(qname = (DRAWNS,'text-box'), **args)
-
diff --git a/libs/odf/easyliststyle.py b/libs/odf/easyliststyle.py
deleted file mode 100644
index 0576406..0000000
--- a/libs/odf/easyliststyle.py
+++ /dev/null
@@ -1,104 +0,0 @@
-# -*- coding: utf-8 -*-
-# Create a element from a text string.
-# Copyright (C) 2008 J. David Eisenberg
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Contributor(s):
-#
-
-import re, sys, os.path
-sys.path.append(os.path.dirname(__file__))
-from style import Style, TextProperties, ListLevelProperties
-from text import ListStyle,ListLevelStyleNumber,ListLevelStyleBullet
-
-"""
-Create a element from a string or array.
-
-List styles require a lot of code to create one level at a time.
-These routines take a string and delimiter, or a list of
-strings, and creates a element for you.
-Each item in the string (or array) represents a list level
- * style for levels 1-10.
- *
- * If an item contains 1
, I
,
- * i
, A
, or a
, then it is presumed
- * to be a numbering style; otherwise it is a bulleted style.
-"""
-
-_MAX_LIST_LEVEL = 10
-SHOW_ALL_LEVELS = True
-SHOW_ONE_LEVEL = False
-
-def styleFromString(name, specifiers, delim, spacing, showAllLevels):
- specArray = specifiers.split(delim)
- return styleFromList( name, specArray, spacing, showAllLevels )
-
-def styleFromList( styleName, specArray, spacing, showAllLevels):
- bullet = ""
- numPrefix = ""
- numSuffix = ""
- numberFormat = ""
- cssLengthNum = 0
- cssLengthUnits = ""
- numbered = False
- displayLevels = 0
- listStyle = ListStyle(name=styleName)
- numFormatPattern = re.compile("([1IiAa])")
- cssLengthPattern = re.compile("([^a-z]+)\\s*([a-z]+)?")
- m = cssLengthPattern.search( spacing )
- if (m != None):
- cssLengthNum = float(m.group(1))
- if (m.lastindex == 2):
- cssLengthUnits = m.group(2)
- i = 0
- while i < len(specArray):
- specification = specArray[i]
- m = numFormatPattern.search(specification)
- if (m != None):
- numberFormat = m.group(1)
- numPrefix = specification[0:m.start(1)]
- numSuffix = specification[m.end(1):]
- bullet = ""
- numbered = True
- if (showAllLevels):
- displayLevels = i + 1
- else:
- displayLevels = 1
- else: # it's a bullet style
- bullet = specification
- numPrefix = ""
- numSuffix = ""
- numberFormat = ""
- displayLevels = 1
- numbered = False
- if (numbered):
- lls = ListLevelStyleNumber(level=(i+1))
- if (numPrefix != ''):
- lls.setAttribute('numprefix', numPrefix)
- if (numSuffix != ''):
- lls.setAttribute('numsuffix', numSuffix)
- lls.setAttribute('displaylevels', displayLevels)
- else:
- lls = ListLevelStyleBullet(level=(i+1),bulletchar=bullet[0])
- llp = ListLevelProperties()
- llp.setAttribute('spacebefore', str(cssLengthNum * (i+1)) + cssLengthUnits)
- llp.setAttribute('minlabelwidth', str(cssLengthNum) + cssLengthUnits)
- lls.addElement( llp )
- listStyle.addElement(lls)
- i += 1
- return listStyle
-
-# vim: set expandtab sw=4 :
diff --git a/libs/odf/element.py b/libs/odf/element.py
deleted file mode 100644
index 09e7de5..0000000
--- a/libs/odf/element.py
+++ /dev/null
@@ -1,541 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2010 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-# Note: This script has copied a lot of text from xml.dom.minidom.
-# Whatever license applies to that file also applies to this file.
-#
-import sys, os.path
-sys.path.append(os.path.dirname(__file__))
-import xml.dom
-from xml.dom.minicompat import *
-from namespaces import nsdict
-import grammar
-from attrconverters import AttrConverters
-
-if sys.version_info[0] == 3:
- unicode=str # unicode function does not exist
-
-# The following code is pasted form xml.sax.saxutils
-# Tt makes it possible to run the code without the xml sax package installed
-# To make it possible to have in your text elements, it is necessary to escape the texts
-def _escape(data, entities={}):
- """ Escape &, <, and > in a string of data.
-
- You can escape other strings of data by passing a dictionary as
- the optional entities parameter. The keys and values must all be
- strings; each key will be replaced with its corresponding value.
- """
- data = data.replace("&", "&")
- data = data.replace("<", "<")
- data = data.replace(">", ">")
- for chars, entity in entities.items():
- data = data.replace(chars, entity)
- return data
-
-def _quoteattr(data, entities={}):
- """ Escape and quote an attribute value.
-
- Escape &, <, and > in a string of data, then quote it for use as
- an attribute value. The \" character will be escaped as well, if
- necessary.
-
- You can escape other strings of data by passing a dictionary as
- the optional entities parameter. The keys and values must all be
- strings; each key will be replaced with its corresponding value.
- """
- entities['\n']='
'
- entities['\r']=''
- data = _escape(data, entities)
- if '"' in data:
- if "'" in data:
- data = '"%s"' % data.replace('"', """)
- else:
- data = "'%s'" % data
- else:
- data = '"%s"' % data
- return data
-
-def _nssplit(qualifiedName):
- """ Split a qualified name into namespace part and local part. """
- fields = qualifiedName.split(':', 1)
- if len(fields) == 2:
- return fields
- else:
- return (None, fields[0])
-
-def _nsassign(namespace):
- return nsdict.setdefault(namespace,"ns" + str(len(nsdict)))
-
-
-# Exceptions
-class IllegalChild(Exception):
- """ Complains if you add an element to a parent where it is not allowed """
-class IllegalText(Exception):
- """ Complains if you add text or cdata to an element where it is not allowed """
-
-class Node(xml.dom.Node):
- """ super class for more specific nodes """
- parentNode = None
- nextSibling = None
- previousSibling = None
-
- def hasChildNodes(self):
- """ Tells whether this element has any children; text nodes,
- subelements, whatever.
- """
- if self.childNodes:
- return True
- else:
- return False
-
- def _get_childNodes(self):
- return self.childNodes
-
- def _get_firstChild(self):
- if self.childNodes:
- return self.childNodes[0]
-
- def _get_lastChild(self):
- if self.childNodes:
- return self.childNodes[-1]
-
- def insertBefore(self, newChild, refChild):
- """ Inserts the node newChild before the existing child node refChild.
- If refChild is null, insert newChild at the end of the list of children.
- """
- if newChild.nodeType not in self._child_node_types:
- raise IllegalChild( "%s cannot be child of %s" % (newChild.tagName, self.tagName))
- if newChild.parentNode is not None:
- newChild.parentNode.removeChild(newChild)
- if refChild is None:
- self.appendChild(newChild)
- else:
- try:
- index = self.childNodes.index(refChild)
- except ValueError:
- raise xml.dom.NotFoundErr()
- self.childNodes.insert(index, newChild)
- newChild.nextSibling = refChild
- refChild.previousSibling = newChild
- if index:
- node = self.childNodes[index-1]
- node.nextSibling = newChild
- newChild.previousSibling = node
- else:
- newChild.previousSibling = None
- newChild.parentNode = self
- return newChild
-
- def appendChild(self, newChild):
- """ Adds the node newChild to the end of the list of children of this node.
- If the newChild is already in the tree, it is first removed.
- """
- if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
- for c in tuple(newChild.childNodes):
- self.appendChild(c)
- ### The DOM does not clearly specify what to return in this case
- return newChild
- if newChild.nodeType not in self._child_node_types:
- raise IllegalChild( "<%s> is not allowed in %s" % ( newChild.tagName, self.tagName))
- if newChild.parentNode is not None:
- newChild.parentNode.removeChild(newChild)
- _append_child(self, newChild)
- newChild.nextSibling = None
- return newChild
-
- def removeChild(self, oldChild):
- """ Removes the child node indicated by oldChild from the list of children, and returns it.
- """
- #FIXME: update ownerDocument.element_dict or find other solution
- try:
- self.childNodes.remove(oldChild)
- except ValueError:
- raise xml.dom.NotFoundErr()
- if oldChild.nextSibling is not None:
- oldChild.nextSibling.previousSibling = oldChild.previousSibling
- if oldChild.previousSibling is not None:
- oldChild.previousSibling.nextSibling = oldChild.nextSibling
- oldChild.nextSibling = oldChild.previousSibling = None
- if self.ownerDocument:
- self.ownerDocument.clear_caches()
- oldChild.parentNode = None
- return oldChild
-
- def __str__(self):
- val = []
- for c in self.childNodes:
- val.append(str(c))
- return ''.join(val)
-
- def __unicode__(self):
- val = []
- for c in self.childNodes:
- val.append(unicode(c))
- return u''.join(val)
-
-defproperty(Node, "firstChild", doc="First child node, or None.")
-defproperty(Node, "lastChild", doc="Last child node, or None.")
-
-def _append_child(self, node):
- # fast path with less checks; usable by DOM builders if careful
- childNodes = self.childNodes
- if childNodes:
- last = childNodes[-1]
- node.__dict__["previousSibling"] = last
- last.__dict__["nextSibling"] = node
- childNodes.append(node)
- node.__dict__["parentNode"] = self
-
-class Childless:
- """ Mixin that makes childless-ness easy to implement and avoids
- the complexity of the Node methods that deal with children.
- """
-
- attributes = None
- childNodes = EmptyNodeList()
- firstChild = None
- lastChild = None
-
- def _get_firstChild(self):
- return None
-
- def _get_lastChild(self):
- return None
-
- def appendChild(self, node):
- """ Raises an error """
- raise xml.dom.HierarchyRequestErr(
- self.tagName + " nodes cannot have children")
-
- def hasChildNodes(self):
- return False
-
- def insertBefore(self, newChild, refChild):
- """ Raises an error """
- raise xml.dom.HierarchyRequestErr(
- self.tagName + " nodes do not have children")
-
- def removeChild(self, oldChild):
- """ Raises an error """
- raise xml.dom.NotFoundErr(
- self.tagName + " nodes do not have children")
-
- def replaceChild(self, newChild, oldChild):
- """ Raises an error """
- raise xml.dom.HierarchyRequestErr(
- self.tagName + " nodes do not have children")
-
-class Text(Childless, Node):
- nodeType = Node.TEXT_NODE
- tagName = "Text"
-
- def __init__(self, data):
- self.data = data
-
- def __str__(self):
- return self.data
-
- def __unicode__(self):
- return self.data
-
- def toXml(self,level,f):
- """ Write XML in UTF-8 """
- if self.data:
- f.write(_escape(unicode(self.data)))
-
-class CDATASection(Text, Childless):
- nodeType = Node.CDATA_SECTION_NODE
-
- def toXml(self,level,f):
- """ Generate XML output of the node. If the text contains "]]>", then
- escape it by going out of CDATA mode (]]>), then write the string
- and then go into CDATA mode again. (' % self.data.replace(']]>',']]>]]>" % (r[1].lower().replace('-',''), self.tagName))
-
- def get_knownns(self, prefix):
- """ Odfpy maintains a list of known namespaces. In some cases a prefix is used, and
- we need to know which namespace it resolves to.
- """
- global nsdict
- for ns,p in nsdict.items():
- if p == prefix: return ns
- return None
-
- def get_nsprefix(self, namespace):
- """ Odfpy maintains a list of known namespaces. In some cases we have a namespace URL,
- and needs to look up or assign the prefix for it.
- """
- if namespace is None: namespace = ""
- prefix = _nsassign(namespace)
- if not namespace in self.namespaces:
- self.namespaces[namespace] = prefix
- return prefix
-
- def allowed_attributes(self):
- return grammar.allowed_attributes.get(self.qname)
-
- def _setOwnerDoc(self, element):
- element.ownerDocument = self.ownerDocument
- for child in element.childNodes:
- self._setOwnerDoc(child)
-
- def addElement(self, element, check_grammar=True):
- """ adds an element to an Element
-
- Element.addElement(Element)
- """
- if check_grammar and self.allowed_children is not None:
- if element.qname not in self.allowed_children:
- raise IllegalChild( "<%s> is not allowed in <%s>" % ( element.tagName, self.tagName))
- self.appendChild(element)
- self._setOwnerDoc(element)
- if self.ownerDocument:
- self.ownerDocument.rebuild_caches(element)
-
- def addText(self, text, check_grammar=True):
- """ Adds text to an element
- Setting check_grammar=False turns off grammar checking
- """
- if check_grammar and self.qname not in grammar.allows_text:
- raise IllegalText( "The <%s> element does not allow text" % self.tagName)
- else:
- if text != '':
- self.appendChild(Text(text))
-
- def addCDATA(self, cdata, check_grammar=True):
- """ Adds CDATA to an element
- Setting check_grammar=False turns off grammar checking
- """
- if check_grammar and self.qname not in grammar.allows_text:
- raise IllegalText( "The <%s> element does not allow text" % self.tagName)
- else:
- self.appendChild(CDATASection(cdata))
-
- def removeAttribute(self, attr, check_grammar=True):
- """ Removes an attribute by name. """
- allowed_attrs = self.allowed_attributes()
- if allowed_attrs is None:
- if type(attr) == type(()):
- prefix, localname = attr
- self.removeAttrNS(prefix, localname)
- else:
- raise AttributeError( "Unable to add simple attribute - use (namespace, localpart)")
- else:
- # Construct a list of allowed arguments
- allowed_args = [ a[1].lower().replace('-','') for a in allowed_attrs]
- if check_grammar and attr not in allowed_args:
- raise AttributeError( "Attribute %s is not allowed in <%s>" % ( attr, self.tagName))
- i = allowed_args.index(attr)
- self.removeAttrNS(allowed_attrs[i][0], allowed_attrs[i][1])
-
- def setAttribute(self, attr, value, check_grammar=True):
- """ Add an attribute to the element
- This is sort of a convenience method. All attributes in ODF have
- namespaces. The library knows what attributes are legal and then allows
- the user to provide the attribute as a keyword argument and the
- library will add the correct namespace.
- Must overwrite, If attribute already exists.
- """
- allowed_attrs = self.allowed_attributes()
- if allowed_attrs is None:
- if type(attr) == type(()):
- prefix, localname = attr
- self.setAttrNS(prefix, localname, value)
- else:
- raise AttributeError( "Unable to add simple attribute - use (namespace, localpart)")
- else:
- # Construct a list of allowed arguments
- allowed_args = [ a[1].lower().replace('-','') for a in allowed_attrs]
- if check_grammar and attr not in allowed_args:
- raise AttributeError( "Attribute %s is not allowed in <%s>" % ( attr, self.tagName))
- i = allowed_args.index(attr)
- self.setAttrNS(allowed_attrs[i][0], allowed_attrs[i][1], value)
-
- def setAttrNS(self, namespace, localpart, value):
- """ Add an attribute to the element
- In case you need to add an attribute the library doesn't know about
- then you must provide the full qualified name
- It will not check that the attribute is legal according to the schema.
- Must overwrite, If attribute already exists.
- """
- allowed_attrs = self.allowed_attributes()
- prefix = self.get_nsprefix(namespace)
-# if allowed_attrs and (namespace, localpart) not in allowed_attrs:
-# raise AttributeError( "Attribute %s:%s is not allowed in element <%s>" % ( prefix, localpart, self.tagName))
- c = AttrConverters()
- self.attributes[(namespace, localpart)] = c.convert((namespace, localpart), value, self)
-
- def getAttrNS(self, namespace, localpart):
- """
- gets an attribute, given a namespace and a key
- @param namespace a unicode string or a bytes: the namespace
- @param localpart a unicode string or a bytes:
- the key to get the attribute
- @return an attribute as a unicode string or a bytes: if both paramters
- are byte strings, it will be a bytes; if both attributes are
- unicode strings, it will be a unicode string
- """
- prefix = self.get_nsprefix(namespace)
- result = self.attributes.get((namespace, localpart))
-
- assert(
- (type(namespace), type(namespace), type(namespace) == \
- type(b""), type(b""), type(b"")) or
- (type(namespace), type(namespace), type(namespace) == \
- type(u""), type(u""), type(u""))
- )
-
- return result
-
- def removeAttrNS(self, namespace, localpart):
- del self.attributes[(namespace, localpart)]
-
- def getAttribute(self, attr):
- """ Get an attribute value. The method knows which namespace the attribute is in
- """
- allowed_attrs = self.allowed_attributes()
- if allowed_attrs is None:
- if type(attr) == type(()):
- prefix, localname = attr
- return self.getAttrNS(prefix, localname)
- else:
- raise AttributeError( "Unable to get simple attribute - use (namespace, localpart)")
- else:
- # Construct a list of allowed arguments
- allowed_args = [ a[1].lower().replace('-','') for a in allowed_attrs]
- i = allowed_args.index(attr)
- return self.getAttrNS(allowed_attrs[i][0], allowed_attrs[i][1])
-
- def write_open_tag(self, level, f):
- f.write(('<'+self.tagName))
- if level == 0:
- for namespace, prefix in self.namespaces.items():
- f.write(u' xmlns:' + prefix + u'="'+ _escape(str(namespace))+'"')
- for qname in self.attributes.keys():
- prefix = self.get_nsprefix(qname[0])
- f.write(u' '+_escape(str(prefix+u':'+qname[1]))+u'='+_quoteattr(unicode(self.attributes[qname])))
- f.write(u'>')
-
- def write_close_tag(self, level, f):
- f.write(''+self.tagName+'>')
-
- def toXml(self, level, f):
- """
- Generate an XML stream out of the tree structure
- @param level integer: level in the XML tree; zero at root of the tree
- @param f an open writable file able to accept unicode strings
- """
- f.write(u'<'+self.tagName)
- if level == 0:
- for namespace, prefix in self.namespaces.items():
- f.write(u' xmlns:' + prefix + u'="'+ _escape(str(namespace))+u'"')
- for qname in self.attributes.keys():
- prefix = self.get_nsprefix(qname[0])
- f.write(u' '+_escape(unicode(prefix+':'+qname[1]))+u'='+_quoteattr(unicode(self.attributes[qname])))
- if self.childNodes:
- f.write(u'>')
- for element in self.childNodes:
- element.toXml(level+1,f)
- f.write(u''+self.tagName+'>')
- else:
- f.write(u'/>')
-
- def _getElementsByObj(self, obj, accumulator):
- if self.qname == obj.qname:
- accumulator.append(self)
- for e in self.childNodes:
- if e.nodeType == Node.ELEMENT_NODE:
- accumulator = e._getElementsByObj(obj, accumulator)
- return accumulator
-
- def getElementsByType(self, element):
- """ Gets elements based on the type, which is function from text.py, draw.py etc. """
- obj = element(check_grammar=False)
- return self._getElementsByObj(obj,[])
-
- def isInstanceOf(self, element):
- """ This is a check to see if the object is an instance of a type """
- obj = element(check_grammar=False)
- return self.qname == obj.qname
-
-
diff --git a/libs/odf/elementtypes.py b/libs/odf/elementtypes.py
deleted file mode 100644
index 7c19412..0000000
--- a/libs/odf/elementtypes.py
+++ /dev/null
@@ -1,325 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# Copyright (C) 2008 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import *
-
-# Inline element don't cause a box
-# They are analogous to the HTML elements SPAN, B, I etc.
-inline_elements = (
- (TEXTNS,u'a'),
- (TEXTNS,u'author-initials'),
- (TEXTNS,u'author-name'),
- (TEXTNS,u'bibliography-mark'),
- (TEXTNS,u'bookmark-ref'),
- (TEXTNS,u'chapter'),
- (TEXTNS,u'character-count'),
- (TEXTNS,u'conditional-text'),
- (TEXTNS,u'creation-date'),
- (TEXTNS,u'creation-time'),
- (TEXTNS,u'creator'),
- (TEXTNS,u'database-display'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'database-next'),
- (TEXTNS,u'database-row-number'),
- (TEXTNS,u'database-row-select'),
- (TEXTNS,u'date'),
- (TEXTNS,u'dde-connection'),
- (TEXTNS,u'description'),
- (TEXTNS,u'editing-cycles'),
- (TEXTNS,u'editing-duration'),
- (TEXTNS,u'execute-macro'),
- (TEXTNS,u'expression'),
- (TEXTNS,u'file-name'),
- (TEXTNS,u'hidden-paragraph'),
- (TEXTNS,u'hidden-text'),
- (TEXTNS,u'image-count'),
- (TEXTNS,u'initial-creator'),
- (TEXTNS,u'keywords'),
- (TEXTNS,u'measure'),
- (TEXTNS,u'modification-date'),
- (TEXTNS,u'modification-time'),
- (TEXTNS,u'note-ref'),
- (TEXTNS,u'object-count'),
- (TEXTNS,u'page-continuation'),
- (TEXTNS,u'page-count'),
- (TEXTNS,u'page-number'),
- (TEXTNS,u'page-variable-get'),
- (TEXTNS,u'page-variable-set'),
- (TEXTNS,u'paragraph-count'),
- (TEXTNS,u'placeholder'),
- (TEXTNS,u'print-date'),
- (TEXTNS,u'printed-by'),
- (TEXTNS,u'print-time'),
- (TEXTNS,u'reference-ref'),
- (TEXTNS,u'ruby'),
- (TEXTNS,u'ruby-base'),
- (TEXTNS,u'ruby-text'),
- (TEXTNS,u'script'),
- (TEXTNS,u'sender-city'),
- (TEXTNS,u'sender-company'),
- (TEXTNS,u'sender-country'),
- (TEXTNS,u'sender-email'),
- (TEXTNS,u'sender-fax'),
- (TEXTNS,u'sender-firstname'),
- (TEXTNS,u'sender-initials'),
- (TEXTNS,u'sender-lastname'),
- (TEXTNS,u'sender-phone-private'),
- (TEXTNS,u'sender-phone-work'),
- (TEXTNS,u'sender-position'),
- (TEXTNS,u'sender-postal-code'),
- (TEXTNS,u'sender-state-or-province'),
- (TEXTNS,u'sender-street'),
- (TEXTNS,u'sender-title'),
- (TEXTNS,u'sequence'),
- (TEXTNS,u'sequence-ref'),
- (TEXTNS,u'sheet-name'),
- (TEXTNS,u'span'),
- (TEXTNS,u'subject'),
- (TEXTNS,u'table-count'),
- (TEXTNS,u'table-formula'),
- (TEXTNS,u'template-name'),
- (TEXTNS,u'text-input'),
- (TEXTNS,u'time'),
- (TEXTNS,u'title'),
- (TEXTNS,u'user-defined'),
- (TEXTNS,u'user-field-get'),
- (TEXTNS,u'user-field-input'),
- (TEXTNS,u'variable-get'),
- (TEXTNS,u'variable-input'),
- (TEXTNS,u'variable-set'),
- (TEXTNS,u'word-count'),
-)
-
-
-# It is almost impossible to determine what elements are block elements.
-# There are so many that don't fit the form
-block_elements = (
- (TEXTNS,u'h'),
- (TEXTNS,u'p'),
- (TEXTNS,u'list'),
- (TEXTNS,u'list-item'),
- (TEXTNS,u'section'),
-)
-
-declarative_elements = (
- (OFFICENS,u'font-face-decls'),
- (PRESENTATIONNS,u'date-time-decl'),
- (PRESENTATIONNS,u'footer-decl'),
- (PRESENTATIONNS,u'header-decl'),
- (TABLENS,u'table-template'),
- (TEXTNS,u'alphabetical-index-entry-template'),
- (TEXTNS,u'alphabetical-index-source'),
- (TEXTNS,u'bibliography-entry-template'),
- (TEXTNS,u'bibliography-source'),
- (TEXTNS,u'dde-connection-decls'),
- (TEXTNS,u'illustration-index-entry-template'),
- (TEXTNS,u'illustration-index-source'),
- (TEXTNS,u'index-source-styles'),
- (TEXTNS,u'index-title-template'),
- (TEXTNS,u'note-continuation-notice-backward'),
- (TEXTNS,u'note-continuation-notice-forward'),
- (TEXTNS,u'notes-configuration'),
- (TEXTNS,u'object-index-entry-template'),
- (TEXTNS,u'object-index-source'),
- (TEXTNS,u'sequence-decls'),
- (TEXTNS,u'table-index-entry-template'),
- (TEXTNS,u'table-index-source'),
- (TEXTNS,u'table-of-content-entry-template'),
- (TEXTNS,u'table-of-content-source'),
- (TEXTNS,u'user-field-decls'),
- (TEXTNS,u'user-index-entry-template'),
- (TEXTNS,u'user-index-source'),
- (TEXTNS,u'variable-decls'),
-)
-
-empty_elements = (
- (ANIMNS,u'animate'),
- (ANIMNS,u'animateColor'),
- (ANIMNS,u'animateMotion'),
- (ANIMNS,u'animateTransform'),
- (ANIMNS,u'audio'),
- (ANIMNS,u'param'),
- (ANIMNS,u'set'),
- (ANIMNS,u'transitionFilter'),
- (CHARTNS,u'categories'),
- (CHARTNS,u'data-point'),
- (CHARTNS,u'domain'),
- (CHARTNS,u'error-indicator'),
- (CHARTNS,u'floor'),
- (CHARTNS,u'grid'),
- (CHARTNS,u'legend'),
- (CHARTNS,u'mean-value'),
- (CHARTNS,u'regression-curve'),
- (CHARTNS,u'stock-gain-marker'),
- (CHARTNS,u'stock-loss-marker'),
- (CHARTNS,u'stock-range-line'),
- (CHARTNS,u'symbol-image'),
- (CHARTNS,u'wall'),
- (DR3DNS,u'cube'),
- (DR3DNS,u'extrude'),
- (DR3DNS,u'light'),
- (DR3DNS,u'rotate'),
- (DR3DNS,u'sphere'),
- (DRAWNS,u'contour-path'),
- (DRAWNS,u'contour-polygon'),
- (DRAWNS,u'equation'),
- (DRAWNS,u'fill-image'),
- (DRAWNS,u'floating-frame'),
- (DRAWNS,u'glue-point'),
- (DRAWNS,u'gradient'),
- (DRAWNS,u'handle'),
- (DRAWNS,u'hatch'),
- (DRAWNS,u'layer'),
- (DRAWNS,u'marker'),
- (DRAWNS,u'opacity'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'param'),
- (DRAWNS,u'stroke-dash'),
- (FORMNS,u'connection-resource'),
- (FORMNS,u'list-value'),
- (FORMNS,u'property'),
- (MANIFESTNS,u'algorithm'),
- (MANIFESTNS,u'key-derivation'),
- (METANS,u'auto-reload'),
- (METANS,u'document-statistic'),
- (METANS,u'hyperlink-behaviour'),
- (METANS,u'template'),
- (NUMBERNS,u'am-pm'),
- (NUMBERNS,u'boolean'),
- (NUMBERNS,u'day'),
- (NUMBERNS,u'day-of-week'),
- (NUMBERNS,u'era'),
- (NUMBERNS,u'fraction'),
- (NUMBERNS,u'hours'),
- (NUMBERNS,u'minutes'),
- (NUMBERNS,u'month'),
- (NUMBERNS,u'quarter'),
- (NUMBERNS,u'scientific-number'),
- (NUMBERNS,u'seconds'),
- (NUMBERNS,u'text-content'),
- (NUMBERNS,u'week-of-year'),
- (NUMBERNS,u'year'),
- (OFFICENS,u'dde-source'),
- (PRESENTATIONNS,u'date-time'),
- (PRESENTATIONNS,u'footer'),
- (PRESENTATIONNS,u'header'),
- (PRESENTATIONNS,u'placeholder'),
- (PRESENTATIONNS,u'play'),
- (PRESENTATIONNS,u'show'),
- (PRESENTATIONNS,u'sound'),
- (SCRIPTNS,u'event-listener'),
- (STYLENS,u'column'),
- (STYLENS,u'column-sep'),
- (STYLENS,u'drop-cap'),
- (STYLENS,u'footnote-sep'),
- (STYLENS,u'list-level-properties'),
- (STYLENS,u'map'),
- (STYLENS,u'ruby-properties'),
- (STYLENS,u'table-column-properties'),
- (STYLENS,u'tab-stop'),
- (STYLENS,u'text-properties'),
- (SVGNS,u'definition-src'),
- (SVGNS,u'font-face-format'),
- (SVGNS,u'font-face-name'),
- (SVGNS,u'stop'),
- (TABLENS,u'body'),
- (TABLENS,u'cell-address'),
- (TABLENS,u'cell-range-source'),
- (TABLENS,u'change-deletion'),
- (TABLENS,u'consolidation'),
- (TABLENS,u'database-source-query'),
- (TABLENS,u'database-source-sql'),
- (TABLENS,u'database-source-table'),
- (TABLENS,u'data-pilot-display-info'),
- (TABLENS,u'data-pilot-field-reference'),
- (TABLENS,u'data-pilot-group-member'),
- (TABLENS,u'data-pilot-layout-info'),
- (TABLENS,u'data-pilot-member'),
- (TABLENS,u'data-pilot-sort-info'),
- (TABLENS,u'data-pilot-subtotal'),
- (TABLENS,u'dependency'),
- (TABLENS,u'error-macro'),
- (TABLENS,u'even-columns'),
- (TABLENS,u'even-rows'),
- (TABLENS,u'filter-condition'),
- (TABLENS,u'first-column'),
- (TABLENS,u'first-row'),
- (TABLENS,u'highlighted-range'),
- (TABLENS,u'insertion-cut-off'),
- (TABLENS,u'iteration'),
- (TABLENS,u'label-range'),
- (TABLENS,u'last-column'),
- (TABLENS,u'last-row'),
- (TABLENS,u'movement-cut-off'),
- (TABLENS,u'named-expression'),
- (TABLENS,u'named-range'),
- (TABLENS,u'null-date'),
- (TABLENS,u'odd-columns'),
- (TABLENS,u'odd-rows'),
- (TABLENS,u'operation'),
- (TABLENS,u'scenario'),
- (TABLENS,u'sort-by'),
- (TABLENS,u'sort-groups'),
- (TABLENS,u'source-range-address'),
- (TABLENS,u'source-service'),
- (TABLENS,u'subtotal-field'),
- (TABLENS,u'table-column'),
- (TABLENS,u'table-source'),
- (TABLENS,u'target-range-address'),
- (TEXTNS,u'alphabetical-index-auto-mark-file'),
- (TEXTNS,u'alphabetical-index-mark'),
- (TEXTNS,u'alphabetical-index-mark-end'),
- (TEXTNS,u'alphabetical-index-mark-start'),
- (TEXTNS,u'bookmark'),
- (TEXTNS,u'bookmark-end'),
- (TEXTNS,u'bookmark-start'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'dde-connection-decl'),
- (TEXTNS,u'index-entry-bibliography'),
- (TEXTNS,u'index-entry-chapter'),
- (TEXTNS,u'index-entry-link-end'),
- (TEXTNS,u'index-entry-link-start'),
- (TEXTNS,u'index-entry-page-number'),
- (TEXTNS,u'index-entry-tab-stop'),
- (TEXTNS,u'index-entry-text'),
- (TEXTNS,u'index-source-style'),
- (TEXTNS,u'line-break'),
- (TEXTNS,u'page'),
- (TEXTNS,u'reference-mark'),
- (TEXTNS,u'reference-mark-end'),
- (TEXTNS,u'reference-mark-start'),
- (TEXTNS,u's'),
- (TEXTNS,u'section-source'),
- (TEXTNS,u'sequence-decl'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'sort-key'),
- (TEXTNS,u'tab'),
- (TEXTNS,u'toc-mark'),
- (TEXTNS,u'toc-mark-end'),
- (TEXTNS,u'toc-mark-start'),
- (TEXTNS,u'user-field-decl'),
- (TEXTNS,u'user-index-mark'),
- (TEXTNS,u'user-index-mark-end'),
- (TEXTNS,u'user-index-mark-start'),
- (TEXTNS,u'variable-decl')
-)
diff --git a/libs/odf/form.py b/libs/odf/form.py
deleted file mode 100644
index 7969b84..0000000
--- a/libs/odf/form.py
+++ /dev/null
@@ -1,115 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import FORMNS
-from element import Element
-
-
-# Autogenerated
-def Button(**args):
- return Element(qname = (FORMNS,'button'), **args)
-
-def Checkbox(**args):
- return Element(qname = (FORMNS,'checkbox'), **args)
-
-def Column(**args):
- return Element(qname = (FORMNS,'column'), **args)
-
-def Combobox(**args):
- return Element(qname = (FORMNS,'combobox'), **args)
-
-def ConnectionResource(**args):
- return Element(qname = (FORMNS,'connection-resource'), **args)
-
-def Date(**args):
- return Element(qname = (FORMNS,'date'), **args)
-
-def File(**args):
- return Element(qname = (FORMNS,'file'), **args)
-
-def FixedText(**args):
- return Element(qname = (FORMNS,'fixed-text'), **args)
-
-def Form(**args):
- return Element(qname = (FORMNS,'form'), **args)
-
-def FormattedText(**args):
- return Element(qname = (FORMNS,'formatted-text'), **args)
-
-def Frame(**args):
- return Element(qname = (FORMNS,'frame'), **args)
-
-def GenericControl(**args):
- return Element(qname = (FORMNS,'generic-control'), **args)
-
-def Grid(**args):
- return Element(qname = (FORMNS,'grid'), **args)
-
-def Hidden(**args):
- return Element(qname = (FORMNS,'hidden'), **args)
-
-def Image(**args):
- return Element(qname = (FORMNS,'image'), **args)
-
-def ImageFrame(**args):
- return Element(qname = (FORMNS,'image-frame'), **args)
-
-def Item(**args):
- return Element(qname = (FORMNS,'item'), **args)
-
-def ListProperty(**args):
- return Element(qname = (FORMNS,'list-property'), **args)
-
-def ListValue(**args):
- return Element(qname = (FORMNS,'list-value'), **args)
-
-def Listbox(**args):
- return Element(qname = (FORMNS,'listbox'), **args)
-
-def Number(**args):
- return Element(qname = (FORMNS,'number'), **args)
-
-def Option(**args):
- return Element(qname = (FORMNS,'option'), **args)
-
-def Password(**args):
- return Element(qname = (FORMNS,'password'), **args)
-
-def Properties(**args):
- return Element(qname = (FORMNS,'properties'), **args)
-
-def Property(**args):
- return Element(qname = (FORMNS,'property'), **args)
-
-def Radio(**args):
- return Element(qname = (FORMNS,'radio'), **args)
-
-def Text(**args):
- return Element(qname = (FORMNS,'text'), **args)
-
-def Textarea(**args):
- return Element(qname = (FORMNS,'textarea'), **args)
-
-def Time(**args):
- return Element(qname = (FORMNS,'time'), **args)
-
-def ValueRange(**args):
- return Element(qname = (FORMNS,'value-range'), **args)
-
diff --git a/libs/odf/grammar.py b/libs/odf/grammar.py
deleted file mode 100644
index dca6519..0000000
--- a/libs/odf/grammar.py
+++ /dev/null
@@ -1,9194 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2013 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-__doc__=""" In principle the OpenDocument schema converted to python structures.
-Currently it contains the legal child elements of a given element.
-To be used for validation check in the API
-"""
-import sys, os.path
-sys.path.append(os.path.dirname(__file__))
-from namespaces import *
-
-# The following code is generated from the RelaxNG schema with this notice:
-
-# Open Document Format for Office Applications (OpenDocument) Version 1.2
-# OASIS Standard, 29 September 2011
-# Relax-NG Schema
-# Source: http://docs.oasis-open.org/office/v1.2/os/
-# Copyright (c) OASIS Open 2002-2011. All Rights Reserved.
-
-# All capitalized terms in the following text have the meanings assigned to them
-# in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The
-# full Policy may be found at the OASIS website.
-
-# This document and translations of it may be copied and furnished to others, and
-# derivative works that comment on or otherwise explain it or assist in its
-# implementation may be prepared, copied, published, and distributed, in whole or
-# in part, without restriction of any kind, provided that the above copyright
-# notice and this section are included on all such copies and derivative works.
-# However, this document itself may not be modified in any way, including by
-# removing the copyright notice or references to OASIS, except as needed for the
-# purpose of developing any document or deliverable produced by an OASIS
-# Technical Committee (in which case the rules applicable to copyrights, as set
-# forth in the OASIS IPR Policy, must be followed) or as required to translate it
-# into languages other than English.
-
-# The limited permissions granted above are perpetual and will not be revoked by
-# OASIS or its successors or assigns.
-
-# This document and the information contained herein is provided on an "AS IS"
-# basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
-# LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT
-# INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
-# FITNESS FOR A PARTICULAR PURPOSE.
-
-allowed_children = {
- (DCNS,u'creator') : (
- ),
- (DCNS,u'date') : (
- ),
- (DCNS,u'description') : (
- ),
- (DCNS,u'language') : (
- ),
- (DCNS,u'subject') : (
- ),
- (DCNS,u'title') : (
- ),
-# Completes Dublin Core start
-# (DCNS,'contributor') : (
-# ),
-# (DCNS,'coverage') : (
-# ),
-# (DCNS,'format') : (
-# ),
-# (DCNS,'identifier') : (
-# ),
-# (DCNS,'publisher') : (
-# ),
-# (DCNS,'relation') : (
-# ),
-# (DCNS,'rights') : (
-# ),
-# (DCNS,'source') : (
-# ),
-# (DCNS,'type') : (
-# ),
-# Completes Dublin Core end
- (MATHNS,u'math') : None,
-
- (XFORMSNS,u'model') : None,
-
- (ANIMNS,u'animate') : (
- ),
- (ANIMNS,u'animateColor') : (
- ),
- (ANIMNS,u'animateMotion') : (
- ),
- (ANIMNS,u'animateTransform') : (
- ),
- (ANIMNS,u'audio') : (
- ),
- (ANIMNS,u'command') : (
- (ANIMNS,u'param'),
- ),
-# allowed_children
- (ANIMNS,u'iterate') : (
- (ANIMNS,u'animate'),
- (ANIMNS,u'animateColor'),
- (ANIMNS,u'animateMotion'),
- (ANIMNS,u'animateTransform'),
- (ANIMNS,u'audio'),
- (ANIMNS,u'command'),
- (ANIMNS,u'iterate'),
- (ANIMNS,u'par'),
- (ANIMNS,u'seq'),
- (ANIMNS,u'set'),
- (ANIMNS,u'transitionFilter'),
- ),
- (ANIMNS,u'par') : (
- (ANIMNS,u'animate'),
- (ANIMNS,u'animateColor'),
- (ANIMNS,u'animateMotion'),
- (ANIMNS,u'animateTransform'),
- (ANIMNS,u'audio'),
- (ANIMNS,u'command'),
- (ANIMNS,u'iterate'),
- (ANIMNS,u'par'),
- (ANIMNS,u'seq'),
- (ANIMNS,u'set'),
- (ANIMNS,u'transitionFilter'),
- ),
-# allowed_children
- (ANIMNS,u'param') : (
- ),
- (ANIMNS,u'seq') : (
- (ANIMNS,u'animate'),
- (ANIMNS,u'animateColor'),
- (ANIMNS,u'animateMotion'),
- (ANIMNS,u'animateTransform'),
- (ANIMNS,u'audio'),
- (ANIMNS,u'command'),
- (ANIMNS,u'iterate'),
- (ANIMNS,u'par'),
- (ANIMNS,u'seq'),
- (ANIMNS,u'set'),
- (ANIMNS,u'transitionFilter'),
- ),
- (ANIMNS,u'set') : (
- ),
- (ANIMNS,u'transitionFilter') : (
- ),
- (CHARTNS,u'axis') : (
- (CHARTNS,u'categories'),
- (CHARTNS,u'grid'),
- (CHARTNS,u'title'),
- ),
-# allowed_children
- (CHARTNS,u'categories') : (
- ),
- (CHARTNS,u'chart') : (
- (CHARTNS,u'footer'),
- (CHARTNS,u'legend'),
- (CHARTNS,u'plot-area'),
- (CHARTNS,u'subtitle'),
- (CHARTNS,u'title'),
- (TABLENS,u'table'),
- ),
- (CHARTNS,u'data-label') : (
- (TEXTNS,u'p'),
- ),
- (CHARTNS,u'data-point') : (
- (CHARTNS,u'data-label'),
- ),
- (CHARTNS,u'domain') : (
- ),
-# allowed_children
- (CHARTNS,u'equation') : (
- (TEXTNS,u'p'),
- ),
- (CHARTNS,u'error-indicator') : (
- ),
- (CHARTNS,u'floor') : (
- ),
- (CHARTNS,u'footer') : (
- (TEXTNS,u'p'),
- ),
- (CHARTNS,u'grid') : (
- ),
- (CHARTNS,u'label-separator') : (
- (TEXTNS,u'p'),
- ),
- (CHARTNS,u'legend') : (
- (TEXTNS,u'p'),
- ),
-# allowed_children
- (CHARTNS,u'mean-value') : (
- ),
- (CHARTNS,u'plot-area') : (
- (CHARTNS,u'axis'),
- (CHARTNS,u'floor'),
- (CHARTNS,u'series'),
- (CHARTNS,u'stock-gain-marker'),
- (CHARTNS,u'stock-loss-marker'),
- (CHARTNS,u'stock-range-line'),
- (CHARTNS,u'wall'),
- (DR3DNS,u'light'),
- ),
- (CHARTNS,u'regression-curve') : (
- (CHARTNS,u'equation'),
- ),
- (CHARTNS,u'series') : (
- (CHARTNS,u'data-label'),
- (CHARTNS,u'data-point'),
- (CHARTNS,u'domain'),
- (CHARTNS,u'error-indicator'),
- (CHARTNS,u'mean-value'),
- (CHARTNS,u'regression-curve'),
- ),
- (CHARTNS,u'stock-gain-marker') : (
- ),
- (CHARTNS,u'stock-loss-marker') : (
- ),
-# allowed_children
- (CHARTNS,u'stock-range-line') : (
- ),
- (CHARTNS,u'subtitle') : (
- (TEXTNS,u'p'),
- ),
- (CHARTNS,u'symbol-image') : (
- ),
- (CHARTNS,u'title') : (
- (TEXTNS,u'p'),
- ),
- (CHARTNS,u'wall') : (
- ),
- (CONFIGNS,u'config-item') : (
- ),
- (CONFIGNS,u'config-item-map-entry') : (
- (CONFIGNS,u'config-item'),
- (CONFIGNS,u'config-item-map-indexed'),
- (CONFIGNS,u'config-item-map-named'),
- (CONFIGNS,u'config-item-set'),
- ),
- (CONFIGNS,u'config-item-map-indexed') : (
- (CONFIGNS,u'config-item-map-entry'),
- ),
- (CONFIGNS,u'config-item-map-named') : (
- (CONFIGNS,u'config-item-map-entry'),
- ),
-# allowed_children
- (CONFIGNS,u'config-item-set') : (
- (CONFIGNS,u'config-item'),
- (CONFIGNS,u'config-item-map-indexed'),
- (CONFIGNS,u'config-item-map-named'),
- (CONFIGNS,u'config-item-set'),
- ),
- (MANIFESTNS,u'algorithm') : (
- ),
- (MANIFESTNS,u'encryption-data') : (
- (MANIFESTNS,u'algorithm'),
- (MANIFESTNS,u'key-derivation'),
- ),
- (MANIFESTNS,u'file-entry') : (
- (MANIFESTNS,u'encryption-data'),
- ),
- (MANIFESTNS,u'key-derivation') : (
- ),
- (MANIFESTNS,u'manifest') : (
- (MANIFESTNS,u'file-entry'),
- ),
- (NUMBERNS,u'am-pm') : (
- ),
- (NUMBERNS,u'boolean') : (
- ),
-# allowed_children
- (NUMBERNS,u'boolean-style') : (
- (NUMBERNS,u'boolean'),
- (NUMBERNS,u'text'),
- (STYLENS,u'map'),
- (STYLENS,u'text-properties'),
- ),
- (NUMBERNS,u'currency-style') : (
- (NUMBERNS,u'currency-symbol'),
- (NUMBERNS,u'number'),
- (NUMBERNS,u'text'),
- (STYLENS,u'map'),
- (STYLENS,u'text-properties'),
- ),
- (NUMBERNS,u'currency-symbol') : (
- ),
- (NUMBERNS,u'date-style') : (
- (NUMBERNS,u'am-pm'),
- (NUMBERNS,u'day'),
- (NUMBERNS,u'day-of-week'),
- (NUMBERNS,u'era'),
- (NUMBERNS,u'hours'),
- (NUMBERNS,u'minutes'),
- (NUMBERNS,u'month'),
- (NUMBERNS,u'quarter'),
- (NUMBERNS,u'seconds'),
- (NUMBERNS,u'text'),
- (NUMBERNS,u'week-of-year'),
- (NUMBERNS,u'year'),
- (STYLENS,u'map'),
- (STYLENS,u'text-properties'),
- ),
-# allowed_children
- (NUMBERNS,u'day') : (
- ),
- (NUMBERNS,u'day-of-week') : (
- ),
- (NUMBERNS,u'embedded-text') : (
- ),
- (NUMBERNS,u'era') : (
- ),
- (NUMBERNS,u'fraction') : (
- ),
- (NUMBERNS,u'hours') : (
- ),
- (NUMBERNS,u'minutes') : (
- ),
- (NUMBERNS,u'month') : (
- ),
- (NUMBERNS,u'number') : (
- (NUMBERNS,u'embedded-text'),
- ),
- (NUMBERNS,u'number-style') : (
- (NUMBERNS,u'fraction'),
- (NUMBERNS,u'number'),
- (NUMBERNS,u'scientific-number'),
- (NUMBERNS,u'text'),
- (STYLENS,u'map'),
- (STYLENS,u'text-properties'),
- ),
-# allowed_children
- (NUMBERNS,u'percentage-style') : (
- (NUMBERNS,u'number'),
- (NUMBERNS,u'text'),
- (STYLENS,u'map'),
- (STYLENS,u'text-properties'),
- ),
- (NUMBERNS,u'quarter') : (
- ),
- (NUMBERNS,u'scientific-number') : (
- ),
- (NUMBERNS,u'seconds') : (
- ),
- (NUMBERNS,u'text') : (
- ),
- (NUMBERNS,u'text-content') : (
- ),
- (NUMBERNS,u'text-style') : (
- (NUMBERNS,u'text'),
- (NUMBERNS,u'text-content'),
- (STYLENS,u'map'),
- (STYLENS,u'text-properties'),
- ),
-# allowed_children
- (NUMBERNS,u'time-style') : (
- (NUMBERNS,u'am-pm'),
- (NUMBERNS,u'hours'),
- (NUMBERNS,u'minutes'),
- (NUMBERNS,u'seconds'),
- (NUMBERNS,u'text'),
- (STYLENS,u'map'),
- (STYLENS,u'text-properties'),
- ),
-# allowed_children
- (NUMBERNS,u'week-of-year') : (
- ),
- (NUMBERNS,u'year') : (
- ),
- (DR3DNS,u'cube') : (
- ),
- (DR3DNS,u'extrude') : (
- ),
- (DR3DNS,u'light') : (
- ),
- (DR3DNS,u'rotate') : (
- ),
- (DR3DNS,u'scene') : (
- (DR3DNS,u'cube'),
- (DR3DNS,u'extrude'),
- (DR3DNS,u'light'),
- (DR3DNS,u'rotate'),
- (DR3DNS,u'scene'),
- (DR3DNS,u'sphere'),
- (DRAWNS,u'glue-point'),
- (SVGNS,u'title'),
- (SVGNS,u'desc'),
- ),
- (DR3DNS,u'sphere') : (
- ),
- (DRAWNS,u'a') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- ),
-# allowed_children
- (DRAWNS,u'applet') : (
- (DRAWNS,u'param'),
- ),
- (DRAWNS,u'area-circle') : (
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- ),
- (DRAWNS,u'area-polygon') : (
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- ),
- (DRAWNS,u'area-rectangle') : (
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- ),
- (DRAWNS,u'caption') : (
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
- (DRAWNS,u'circle') : (
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
-# allowed_children
- (DRAWNS,u'connector') : (
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
- (DRAWNS,u'contour-path') : (
- ),
- (DRAWNS,u'contour-polygon') : (
- ),
- (DRAWNS,u'control') : (
- (DRAWNS,u'glue-point'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- ),
- (DRAWNS,u'custom-shape') : (
- (DRAWNS,u'enhanced-geometry'),
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
-# allowed_children
- (DRAWNS,u'ellipse') : (
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
- (DRAWNS,u'enhanced-geometry') : (
- (DRAWNS,u'equation'),
- (DRAWNS,u'handle'),
- ),
- (DRAWNS,u'equation') : (
- ),
-# allowed_children
- (DRAWNS,u'fill-image') : (
- ),
- (DRAWNS,u'floating-frame') : (
- ),
- (DRAWNS,u'frame') : (
- (DRAWNS,u'applet'),
- (DRAWNS,u'contour-path'),
- (DRAWNS,u'contour-polygon'),
- (DRAWNS,u'floating-frame'),
- (DRAWNS,u'glue-point'),
- (DRAWNS,u'image'),
- (DRAWNS,u'image-map'),
- (DRAWNS,u'object'),
- (DRAWNS,u'object-ole'),
- (DRAWNS,u'plugin'),
- (DRAWNS,u'text-box'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TABLENS,u'table'),
- ),
-# allowed_children
- (DRAWNS,u'g') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'glue-point'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (OFFICENS,u'event-listeners'),
- ),
- (DRAWNS,u'glue-point') : (
- ),
- (DRAWNS,u'gradient') : (
- ),
- (DRAWNS,u'handle') : (
- ),
- (DRAWNS,u'hatch') : (
- ),
-# allowed_children
- (DRAWNS,u'image') : (
- (OFFICENS,u'binary-data'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
- (DRAWNS,u'image-map') : (
- (DRAWNS,u'area-circle'),
- (DRAWNS,u'area-polygon'),
- (DRAWNS,u'area-rectangle'),
- ),
- (DRAWNS,u'layer') : (
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- ),
- (DRAWNS,u'layer-set') : (
- (DRAWNS,u'layer'),
- ),
- (DRAWNS,u'line') : (
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
- (DRAWNS,u'marker') : (
- ),
- (DRAWNS,u'measure') : (
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- (SVGNS,u'title'),
- (SVGNS,u'desc'),
- ),
- (DRAWNS,u'object') : (
- (MATHNS,u'math'),
- (OFFICENS,u'document'),
- ),
-# allowed_children
- (DRAWNS,u'object-ole') : (
- (OFFICENS,u'binary-data'),
- ),
- (DRAWNS,u'opacity') : (
- ),
- (DRAWNS,u'page') : (
- (ANIMNS,u'animate'),
- (ANIMNS,u'animateColor'),
- (ANIMNS,u'animateMotion'),
- (ANIMNS,u'animateTransform'),
- (ANIMNS,u'audio'),
- (ANIMNS,u'command'),
- (ANIMNS,u'iterate'),
- (ANIMNS,u'par'),
- (ANIMNS,u'seq'),
- (ANIMNS,u'set'),
- (ANIMNS,u'transitionFilter'),
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'layer-set'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'forms'),
- (PRESENTATIONNS,u'animations'),
- (PRESENTATIONNS,u'notes'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- ),
-# allowed_children
- (DRAWNS,u'page-thumbnail') : (
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- ),
- (DRAWNS,u'param') : (
- ),
- (DRAWNS,u'path') : (
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
- (DRAWNS,u'plugin') : (
- (DRAWNS,u'param'),
- ),
- (DRAWNS,u'polygon') : (
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'title'),
- (SVGNS,u'desc'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
- (DRAWNS,u'polyline') : (
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
-# allowed_children
- (DRAWNS,u'rect') : (
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
- (DRAWNS,u'regular-polygon') : (
- (DRAWNS,u'glue-point'),
- (OFFICENS,u'event-listeners'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
- (DRAWNS,u'stroke-dash') : (
- ),
- (DRAWNS,u'text-box') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'list'),
- (TEXTNS,u'numbered-paragraph'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'user-index'),
- ),
-# allowed_children
- (FORMNS,u'button') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'checkbox') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'column') : (
- (FORMNS,u'checkbox'),
- (FORMNS,u'combobox'),
- (FORMNS,u'date'),
- (FORMNS,u'formatted-text'),
- (FORMNS,u'listbox'),
- (FORMNS,u'number'),
- (FORMNS,u'text'),
- (FORMNS,u'textarea'),
- (FORMNS,u'time'),
- ),
- (FORMNS,u'combobox') : (
- (FORMNS,u'item'),
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'connection-resource') : (
- ),
- (FORMNS,u'date') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'file') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'fixed-text') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
-# allowed_children
- (FORMNS,u'form') : (
- (FORMNS,u'button'),
- (FORMNS,u'checkbox'),
- (FORMNS,u'combobox'),
- (FORMNS,u'connection-resource'),
- (FORMNS,u'date'),
- (FORMNS,u'file'),
- (FORMNS,u'fixed-text'),
- (FORMNS,u'form'),
- (FORMNS,u'formatted-text'),
- (FORMNS,u'frame'),
- (FORMNS,u'generic-control'),
- (FORMNS,u'grid'),
- (FORMNS,u'hidden'),
- (FORMNS,u'image'),
- (FORMNS,u'image-frame'),
- (FORMNS,u'listbox'),
- (FORMNS,u'number'),
- (FORMNS,u'password'),
- (FORMNS,u'properties'),
- (FORMNS,u'radio'),
- (FORMNS,u'text'),
- (FORMNS,u'textarea'),
- (FORMNS,u'time'),
- (FORMNS,u'value-range'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'formatted-text') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'frame') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'generic-control') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'grid') : (
- (FORMNS,u'column'),
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'hidden') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'image') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
-# allowed_children
- (FORMNS,u'image-frame') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'item') : (
- ),
- (FORMNS,u'list-property') : (
- (FORMNS,u'list-value'),
- (FORMNS,u'list-value'),
- (FORMNS,u'list-value'),
- (FORMNS,u'list-value'),
- (FORMNS,u'list-value'),
- (FORMNS,u'list-value'),
- (FORMNS,u'list-value'),
- ),
- (FORMNS,u'list-value') : (
- ),
- (FORMNS,u'listbox') : (
- (FORMNS,u'option'),
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
-# allowed_children
- (FORMNS,u'number') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'option') : (
- ),
- (FORMNS,u'password') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'properties') : (
- (FORMNS,u'list-property'),
- (FORMNS,u'property'),
- ),
- (FORMNS,u'property') : (
- ),
- (FORMNS,u'radio') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'text') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'textarea') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- (TEXTNS,u'p'),
- ),
-# allowed_children
- (FORMNS,u'time') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (FORMNS,u'value-range') : (
- (FORMNS,u'properties'),
- (OFFICENS,u'event-listeners'),
- ),
- (METANS,u'auto-reload') : (
- ),
- (METANS,u'creation-date') : (
- ),
- (METANS,u'date-string') : (
- ),
- (METANS,u'document-statistic') : (
- ),
- (METANS,u'editing-cycles') : (
- ),
- (METANS,u'editing-duration') : (
- ),
- (METANS,u'generator') : (
- ),
- (METANS,u'hyperlink-behaviour') : (
- ),
- (METANS,u'initial-creator') : (
- ),
- (METANS,u'keyword') : (
- ),
- (METANS,u'print-date') : (
- ),
- (METANS,u'printed-by') : (
- ),
- (METANS,u'template') : (
- ),
- (METANS,u'user-defined') : (
- ),
-# allowed_children
- (OFFICENS,u'annotation') : (
- (DCNS,u'creator'),
- (DCNS,u'date'),
- (METANS,u'date-string'),
- (TEXTNS,u'list'),
- (TEXTNS,u'p'),
- ),
-# allowed_children
- (OFFICENS,u'annotation-end') : (
- ),
- (OFFICENS,u'automatic-styles') : (
- (NUMBERNS,u'boolean-style'),
- (NUMBERNS,u'currency-style'),
- (NUMBERNS,u'date-style'),
- (NUMBERNS,u'number-style'),
- (NUMBERNS,u'percentage-style'),
- (NUMBERNS,u'text-style'),
- (NUMBERNS,u'time-style'),
- (STYLENS,u'page-layout'),
- (STYLENS,u'style'),
- (TEXTNS,u'list-style'),
- ),
- (OFFICENS,u'binary-data') : (
- ),
- (OFFICENS,u'body') : (
- (OFFICENS,u'chart'),
- (OFFICENS,u'drawing'),
- (OFFICENS,u'image'),
- (OFFICENS,u'presentation'),
- (OFFICENS,u'spreadsheet'),
- (OFFICENS,u'text'),
- ),
- (OFFICENS,u'change-info') : (
- (DCNS,u'creator'),
- (DCNS,u'date'),
- (TEXTNS,u'p'),
- ),
- (OFFICENS,u'chart') : (
- (CHARTNS,u'chart'),
- (TABLENS,u'calculation-settings'),
- (TABLENS,u'consolidation'),
- (TABLENS,u'content-validations'),
- (TABLENS,u'data-pilot-tables'),
- (TABLENS,u'database-ranges'),
- (TABLENS,u'dde-links'),
- (TABLENS,u'label-ranges'),
- (TABLENS,u'named-expressions'),
- (TEXTNS,u'alphabetical-index-auto-mark-file'),
- (TEXTNS,u'dde-connection-decls'),
- (TEXTNS,u'sequence-decls'),
- (TEXTNS,u'user-field-decls'),
- (TEXTNS,u'variable-decls'),
- ),
- (OFFICENS,u'dde-source') : (
- ),
- (OFFICENS,u'document') : (
- (OFFICENS,u'automatic-styles'),
- (OFFICENS,u'body'),
- (OFFICENS,u'font-face-decls'),
- (OFFICENS,u'master-styles'),
- (OFFICENS,u'meta'),
- (OFFICENS,u'scripts'),
- (OFFICENS,u'settings'),
- (OFFICENS,u'styles'),
- ),
- (OFFICENS,u'document-content') : (
- (OFFICENS,u'automatic-styles'),
- (OFFICENS,u'body'),
- (OFFICENS,u'font-face-decls'),
- (OFFICENS,u'scripts'),
- ),
- (OFFICENS,u'document-meta') : (
- (OFFICENS,u'meta'),
- ),
- (OFFICENS,u'document-settings') : (
- (OFFICENS,u'settings'),
- ),
- (OFFICENS,u'document-styles') : (
- (OFFICENS,u'automatic-styles'),
- (OFFICENS,u'font-face-decls'),
- (OFFICENS,u'master-styles'),
- (OFFICENS,u'styles'),
- ),
- (OFFICENS,u'drawing') : (
- (DRAWNS,u'page'),
- (TABLENS,u'calculation-settings'),
- (TABLENS,u'consolidation'),
- (TABLENS,u'content-validations'),
- (TABLENS,u'data-pilot-tables'),
- (TABLENS,u'database-ranges'),
- (TABLENS,u'dde-links'),
- (TABLENS,u'label-ranges'),
- (TABLENS,u'named-expressions'),
- (TEXTNS,u'alphabetical-index-auto-mark-file'),
- (TEXTNS,u'dde-connection-decls'),
- (TEXTNS,u'sequence-decls'),
- (TEXTNS,u'user-field-decls'),
- (TEXTNS,u'variable-decls'),
- ),
- (OFFICENS,u'event-listeners') : (
- (PRESENTATIONNS,u'event-listener'),
- (SCRIPTNS,u'event-listener'),
- ),
- (OFFICENS,u'font-face-decls') : (
- (STYLENS,u'font-face'),
- ),
-# allowed_children
- (OFFICENS,u'forms') : (
- (XFORMSNS,u'model'),
- (FORMNS,u'form'),
- ),
- (OFFICENS,u'image') : (
- (DRAWNS,u'frame'),
- ),
- (OFFICENS,u'master-styles') : (
- (DRAWNS,u'layer-set'),
- (STYLENS,u'handout-master'),
- (STYLENS,u'master-page'),
- ),
- (OFFICENS,u'meta') : (
- (DCNS,u'creator'),
- (DCNS,u'date'),
- (DCNS,u'description'),
- (DCNS,u'language'),
- (DCNS,u'subject'),
- (DCNS,u'title'),
-# Completes Dublin Core start
-# (DCNS,'contributor'),
-# (DCNS,'coverage'),
-# (DCNS,'format'),
-# (DCNS,'identifier'),
-# (DCNS,'publisher'),
-# (DCNS,'relation'),
-# (DCNS,'rights'),
-# (DCNS,'source'),
-# (DCNS,'type'),
-# Completes Dublin Core end
- (METANS,u'auto-reload'),
- (METANS,u'creation-date'),
- (METANS,u'document-statistic'),
- (METANS,u'editing-cycles'),
- (METANS,u'editing-duration'),
- (METANS,u'generator'),
- (METANS,u'hyperlink-behaviour'),
- (METANS,u'initial-creator'),
- (METANS,u'keyword'),
- (METANS,u'print-date'),
- (METANS,u'printed-by'),
- (METANS,u'template'),
- (METANS,u'user-defined'),
- ),
- (OFFICENS,u'presentation') : (
- (DRAWNS,u'page'),
- (PRESENTATIONNS,u'date-time-decl'),
- (PRESENTATIONNS,u'footer-decl'),
- (PRESENTATIONNS,u'header-decl'),
- (PRESENTATIONNS,u'settings'),
- (TABLENS,u'calculation-settings'),
- (TABLENS,u'consolidation'),
- (TABLENS,u'content-validations'),
- (TABLENS,u'data-pilot-tables'),
- (TABLENS,u'database-ranges'),
- (TABLENS,u'dde-links'),
- (TABLENS,u'label-ranges'),
- (TABLENS,u'named-expressions'),
- (TEXTNS,u'alphabetical-index-auto-mark-file'),
- (TEXTNS,u'dde-connection-decls'),
- (TEXTNS,u'sequence-decls'),
- (TEXTNS,u'user-field-decls'),
- (TEXTNS,u'variable-decls'),
- ),
-# allowed_children
- (OFFICENS,u'script') : None,
-
- (OFFICENS,u'scripts') : (
- (OFFICENS,u'event-listeners'),
- (OFFICENS,u'script'),
- ),
- (OFFICENS,u'settings') : (
- (CONFIGNS,u'config-item-set'),
- ),
- (OFFICENS,u'spreadsheet') : (
- (TABLENS,u'calculation-settings'),
- (TABLENS,u'consolidation'),
- (TABLENS,u'content-validations'),
- (TABLENS,u'data-pilot-tables'),
- (TABLENS,u'database-ranges'),
- (TABLENS,u'dde-links'),
- (TABLENS,u'label-ranges'),
- (TABLENS,u'named-expressions'),
- (TABLENS,u'table'),
- (TABLENS,u'tracked-changes'),
- (TEXTNS,u'alphabetical-index-auto-mark-file'),
- (TEXTNS,u'dde-connection-decls'),
- (TEXTNS,u'sequence-decls'),
- (TEXTNS,u'user-field-decls'),
- (TEXTNS,u'variable-decls'),
- ),
- (OFFICENS,u'styles') : (
- (NUMBERNS,u'boolean-style'),
- (NUMBERNS,u'currency-style'),
- (NUMBERNS,u'date-style'),
- (NUMBERNS,u'number-style'),
- (NUMBERNS,u'percentage-style'),
- (NUMBERNS,u'text-style'),
- (NUMBERNS,u'time-style'),
- (DRAWNS,u'fill-image'),
- (DRAWNS,u'gradient'),
- (DRAWNS,u'hatch'),
- (DRAWNS,u'marker'),
- (DRAWNS,u'opacity'),
- (DRAWNS,u'stroke-dash'),
- (STYLENS,u'default-page-layout'),
- (STYLENS,u'default-style'),
- (STYLENS,u'presentation-page-layout'),
- (STYLENS,u'style'),
- (SVGNS,u'linearGradient'),
- (SVGNS,u'radialGradient'),
- (TABLENS,u'table-template'),
- (TEXTNS,u'bibliography-configuration'),
- (TEXTNS,u'linenumbering-configuration'),
- (TEXTNS,u'list-style'),
- (TEXTNS,u'notes-configuration'),
- (TEXTNS,u'outline-style'),
- ),
- (OFFICENS,u'text') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'forms'),
- (TABLENS,u'calculation-settings'),
- (TABLENS,u'consolidation'),
- (TABLENS,u'content-validations'),
- (TABLENS,u'data-pilot-tables'),
- (TABLENS,u'database-ranges'),
- (TABLENS,u'dde-links'),
- (TABLENS,u'label-ranges'),
- (TABLENS,u'named-expressions'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'alphabetical-index-auto-mark-file'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'dde-connection-decls'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'list'),
- (TEXTNS,u'numbered-paragraph'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'page-sequence'),
- (TEXTNS,u'section'),
- (TEXTNS,u'sequence-decls'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'tracked-changes'),
- (TEXTNS,u'user-field-decls'),
- (TEXTNS,u'user-index'),
- (TEXTNS,u'variable-decls'),
- ),
- (PRESENTATIONNS,u'animation-group') : (
- (PRESENTATIONNS,u'dim'),
- (PRESENTATIONNS,u'hide-shape'),
- (PRESENTATIONNS,u'hide-text'),
- (PRESENTATIONNS,u'play'),
- (PRESENTATIONNS,u'show-shape'),
- (PRESENTATIONNS,u'show-text'),
- ),
- (PRESENTATIONNS,u'animations') : (
- (PRESENTATIONNS,u'animation-group'),
- (PRESENTATIONNS,u'dim'),
- (PRESENTATIONNS,u'hide-shape'),
- (PRESENTATIONNS,u'hide-text'),
- (PRESENTATIONNS,u'play'),
- (PRESENTATIONNS,u'show-shape'),
- (PRESENTATIONNS,u'show-text'),
- ),
- (PRESENTATIONNS,u'date-time') : (
- ),
- (PRESENTATIONNS,u'date-time-decl') : (
- ),
- (PRESENTATIONNS,u'dim') : (
- (PRESENTATIONNS,u'sound'),
- ),
- (PRESENTATIONNS,u'event-listener') : (
- (PRESENTATIONNS,u'sound'),
- ),
- (PRESENTATIONNS,u'footer') : (
- ),
- (PRESENTATIONNS,u'footer-decl') : (
- ),
- (PRESENTATIONNS,u'header') : (
- ),
- (PRESENTATIONNS,u'header-decl') : (
- ),
- (PRESENTATIONNS,u'hide-shape') : (
- (PRESENTATIONNS,u'sound'),
- ),
- (PRESENTATIONNS,u'hide-text') : (
- (PRESENTATIONNS,u'sound'),
- ),
-# allowed_children
- (PRESENTATIONNS,u'notes') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'forms'),
- ),
- (PRESENTATIONNS,u'placeholder') : (
- ),
- (PRESENTATIONNS,u'play') : (
- ),
- (PRESENTATIONNS,u'settings') : (
- (PRESENTATIONNS,u'show'),
- ),
- (PRESENTATIONNS,u'show') : (
- ),
- (PRESENTATIONNS,u'show-shape') : (
- (PRESENTATIONNS,u'sound'),
- ),
- (PRESENTATIONNS,u'show-text') : (
- (PRESENTATIONNS,u'sound'),
- ),
- (PRESENTATIONNS,u'sound') : (
- ),
- (SCRIPTNS,u'event-listener') : (
- ),
- (STYLENS,u'background-image') : (
- (OFFICENS,u'binary-data'),
- ),
-# allowed_children
- (STYLENS,u'chart-properties') : (
- (CHARTNS,u'label-separator'),
- (CHARTNS,u'symbol-image'),
- ),
- (STYLENS,u'column') : (
- ),
- (STYLENS,u'column-sep') : (
- ),
- (STYLENS,u'columns') : (
- (STYLENS,u'column'),
- (STYLENS,u'column-sep'),
- ),
-# allowed_children
- (STYLENS,u'default-page-layout') : (
- (STYLENS,u'page-layout-properties'),
- (STYLENS,u'header-style'),
- (STYLENS,u'footer-style'),
- ),
- (STYLENS,u'default-style') : (
- (STYLENS,u'chart-properties'),
- (STYLENS,u'drawing-page-properties'),
- (STYLENS,u'graphic-properties'),
- (STYLENS,u'paragraph-properties'),
- (STYLENS,u'ruby-properties'),
- (STYLENS,u'section-properties'),
- (STYLENS,u'table-cell-properties'),
- (STYLENS,u'table-column-properties'),
- (STYLENS,u'table-properties'),
- (STYLENS,u'table-row-properties'),
- (STYLENS,u'text-properties'),
- ),
- (STYLENS,u'drawing-page-properties') : (
- (PRESENTATIONNS,u'sound'),
- ),
- (STYLENS,u'drop-cap') : (
- ),
- (STYLENS,u'font-face') : (
- (SVGNS,u'definition-src'),
- (SVGNS,u'font-face-src'),
- ),
- (STYLENS,u'footer') : (
- (STYLENS,u'region-center'),
- (STYLENS,u'region-left'),
- (STYLENS,u'region-right'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'alphabetical-index-auto-mark-file'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'dde-connection-decls'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'index-title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'sequence-decls'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'tracked-changes'),
- (TEXTNS,u'user-field-decls'),
- (TEXTNS,u'user-index'),
- (TEXTNS,u'variable-decls'),
- ),
-# allowed_children
- (STYLENS,u'footer-left') : (
- (STYLENS,u'region-center'),
- (STYLENS,u'region-left'),
- (STYLENS,u'region-right'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'alphabetical-index-auto-mark-file'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'dde-connection-decls'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'index-title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'sequence-decls'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'tracked-changes'),
- (TEXTNS,u'user-field-decls'),
- (TEXTNS,u'user-index'),
- (TEXTNS,u'variable-decls'),
- ),
- (STYLENS,u'footer-style') : (
- (STYLENS,u'header-footer-properties'),
- ),
- (STYLENS,u'footnote-sep') : (
- ),
- (STYLENS,u'graphic-properties') : (
- (STYLENS,u'background-image'),
- (STYLENS,u'columns'),
- (TEXTNS,u'list-style'),
- ),
-# allowed_children
- (STYLENS,u'handout-master') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- ),
- (STYLENS,u'header') : (
- (STYLENS,u'region-center'),
- (STYLENS,u'region-left'),
- (STYLENS,u'region-right'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'alphabetical-index-auto-mark-file'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'dde-connection-decls'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'index-title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'sequence-decls'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'tracked-changes'),
- (TEXTNS,u'user-field-decls'),
- (TEXTNS,u'user-index'),
- (TEXTNS,u'variable-decls'),
- ),
-# allowed_children
- (STYLENS,u'header-footer-properties') : (
- (STYLENS,u'background-image'),
- ),
- (STYLENS,u'header-left') : (
- (STYLENS,u'region-center'),
- (STYLENS,u'region-left'),
- (STYLENS,u'region-right'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'alphabetical-index-auto-mark-file'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'dde-connection-decls'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'index-title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'sequence-decls'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'tracked-changes'),
- (TEXTNS,u'user-field-decls'),
- (TEXTNS,u'user-index'),
- (TEXTNS,u'variable-decls'),
- ),
- (STYLENS,u'header-style') : (
- (STYLENS,u'header-footer-properties'),
- ),
-# allowed_children
- (STYLENS,u'list-level-label-alignment') : (
- ),
- (STYLENS,u'list-level-properties') : (
- (STYLENS,u'list-level-label-alignment'),
- ),
- (STYLENS,u'map') : (
- ),
- (STYLENS,u'master-page') : (
- (ANIMNS,u'animate'),
- (ANIMNS,u'animateColor'),
- (ANIMNS,u'animateMotion'),
- (ANIMNS,u'animateTransform'),
- (ANIMNS,u'audio'),
- (ANIMNS,u'command'),
- (ANIMNS,u'iterate'),
- (ANIMNS,u'par'),
- (ANIMNS,u'seq'),
- (ANIMNS,u'set'),
- (ANIMNS,u'transitionFilter'),
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'layer-set'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'forms'),
- (PRESENTATIONNS,u'notes'),
- (STYLENS,u'footer'),
- (STYLENS,u'footer-left'),
- (STYLENS,u'header'),
- (STYLENS,u'header-left'),
- ),
- (STYLENS,u'page-layout') : (
- (STYLENS,u'footer-style'),
- (STYLENS,u'header-style'),
- (STYLENS,u'page-layout-properties'),
- ),
- (STYLENS,u'page-layout-properties') : (
- (STYLENS,u'background-image'),
- (STYLENS,u'columns'),
- (STYLENS,u'footnote-sep'),
- ),
-# allowed_children
- (STYLENS,u'paragraph-properties') : (
- (STYLENS,u'background-image'),
- (STYLENS,u'drop-cap'),
- (STYLENS,u'tab-stops'),
- ),
- (STYLENS,u'presentation-page-layout') : (
- (PRESENTATIONNS,u'placeholder'),
- ),
- (STYLENS,u'region-center') : (
- (TEXTNS,u'p'),
- ),
- (STYLENS,u'region-left') : (
- (TEXTNS,u'p'),
- ),
- (STYLENS,u'region-right') : (
- (TEXTNS,u'p'),
- ),
- (STYLENS,u'ruby-properties') : (
- ),
- (STYLENS,u'section-properties') : (
- (STYLENS,u'background-image'),
- (STYLENS,u'columns'),
- (TEXTNS,u'notes-configuration'),
- ),
- (STYLENS,u'style') : (
- (STYLENS,u'chart-properties'),
- (STYLENS,u'drawing-page-properties'),
- (STYLENS,u'graphic-properties'),
- (STYLENS,u'map'),
- (STYLENS,u'paragraph-properties'),
- (STYLENS,u'ruby-properties'),
- (STYLENS,u'section-properties'),
- (STYLENS,u'table-cell-properties'),
- (STYLENS,u'table-column-properties'),
- (STYLENS,u'table-properties'),
- (STYLENS,u'table-row-properties'),
- (STYLENS,u'text-properties'),
- ),
- (STYLENS,u'tab-stop') : (
- ),
- (STYLENS,u'tab-stops') : (
- (STYLENS,u'tab-stop'),
- ),
-# allowed_children
- (STYLENS,u'table-cell-properties') : (
- (STYLENS,u'background-image'),
- ),
- (STYLENS,u'table-column-properties') : (
- ),
- (STYLENS,u'table-properties') : (
- (STYLENS,u'background-image'),
- ),
- (STYLENS,u'table-row-properties') : (
- (STYLENS,u'background-image'),
- ),
- (STYLENS,u'text-properties') : (
- ),
- (SVGNS,u'definition-src') : (
- ),
- (SVGNS,u'desc') : (
- ),
- (SVGNS,u'font-face-format') : (
- ),
- (SVGNS,u'font-face-name') : (
- ),
- (SVGNS,u'font-face-src') : (
- (SVGNS,u'font-face-name'),
- (SVGNS,u'font-face-uri'),
- ),
- (SVGNS,u'font-face-uri') : (
- (SVGNS,u'font-face-format'),
- ),
- (SVGNS,u'linearGradient') : (
- (SVGNS,u'stop'),
- ),
- (SVGNS,u'radialGradient') : (
- (SVGNS,u'stop'),
- ),
- (SVGNS,u'stop') : (
- ),
- (SVGNS,u'title') : (
- ),
-# allowed_children
- (TABLENS,u'background') : (
- ),
- (TABLENS,u'body') : (
- ),
- (TABLENS,u'calculation-settings') : (
- (TABLENS,u'iteration'),
- (TABLENS,u'null-date'),
- ),
-# allowed_children
- (TABLENS,u'cell-address') : (
- ),
- (TABLENS,u'cell-content-change') : (
- (OFFICENS,u'change-info'),
- (TABLENS,u'cell-address'),
- (TABLENS,u'deletions'),
- (TABLENS,u'dependencies'),
- (TABLENS,u'previous'),
- ),
- (TABLENS,u'cell-content-deletion') : (
- (TABLENS,u'cell-address'),
- (TABLENS,u'change-track-table-cell'),
- ),
- (TABLENS,u'cell-range-source') : (
- ),
- (TABLENS,u'change-deletion') : (
- ),
- (TABLENS,u'change-track-table-cell') : (
- (TEXTNS,u'p'),
- ),
- (TABLENS,u'consolidation') : (
- ),
- (TABLENS,u'content-validation') : (
- (OFFICENS,u'event-listeners'),
- (TABLENS,u'error-macro'),
- (TABLENS,u'error-message'),
- (TABLENS,u'help-message'),
- ),
-# allowed_children
- (TABLENS,u'content-validations') : (
- (TABLENS,u'content-validation'),
- ),
- (TABLENS,u'covered-table-cell') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'annotation'),
- (TABLENS,u'cell-range-source'),
- (TABLENS,u'detective'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'list'),
- (TEXTNS,u'numbered-paragraph'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'user-index'),
- ),
-# allowed_children
- (TABLENS,u'cut-offs') : (
- (TABLENS,u'insertion-cut-off'),
- (TABLENS,u'movement-cut-off'),
- ),
- (TABLENS,u'data-pilot-display-info') : (
- ),
- (TABLENS,u'data-pilot-field') : (
- (TABLENS,u'data-pilot-field-reference'),
- (TABLENS,u'data-pilot-groups'),
- (TABLENS,u'data-pilot-level'),
- ),
- (TABLENS,u'data-pilot-field-reference') : (
- ),
- (TABLENS,u'data-pilot-group') : (
- (TABLENS,u'data-pilot-group-member'),
- ),
- (TABLENS,u'data-pilot-group-member') : (
- ),
- (TABLENS,u'data-pilot-groups') : (
- (TABLENS,u'data-pilot-group'),
- ),
- (TABLENS,u'data-pilot-layout-info') : (
- ),
- (TABLENS,u'data-pilot-level') : (
- (TABLENS,u'data-pilot-display-info'),
- (TABLENS,u'data-pilot-layout-info'),
- (TABLENS,u'data-pilot-members'),
- (TABLENS,u'data-pilot-sort-info'),
- (TABLENS,u'data-pilot-subtotals'),
- ),
- (TABLENS,u'data-pilot-member') : (
- ),
- (TABLENS,u'data-pilot-members') : (
- (TABLENS,u'data-pilot-member'),
- ),
- (TABLENS,u'data-pilot-sort-info') : (
- ),
- (TABLENS,u'data-pilot-subtotal') : (
- ),
- (TABLENS,u'data-pilot-subtotals') : (
- (TABLENS,u'data-pilot-subtotal'),
- ),
-# allowed_children
- (TABLENS,u'data-pilot-table') : (
- (TABLENS,u'data-pilot-field'),
- (TABLENS,u'database-source-query'),
- (TABLENS,u'database-source-sql'),
- (TABLENS,u'database-source-table'),
- (TABLENS,u'source-cell-range'),
- (TABLENS,u'source-service'),
- ),
- (TABLENS,u'data-pilot-tables') : (
- (TABLENS,u'data-pilot-table'),
- ),
- (TABLENS,u'database-range') : (
- (TABLENS,u'database-source-query'),
- (TABLENS,u'database-source-sql'),
- (TABLENS,u'database-source-table'),
- (TABLENS,u'filter'),
- (TABLENS,u'sort'),
- (TABLENS,u'subtotal-rules'),
- ),
- (TABLENS,u'database-ranges') : (
- (TABLENS,u'database-range'),
- ),
- (TABLENS,u'database-source-query') : (
- ),
- (TABLENS,u'database-source-sql') : (
- ),
- (TABLENS,u'database-source-table') : (
- ),
-# allowed_children
- (TABLENS,u'dde-link') : (
- (OFFICENS,u'dde-source'),
- (TABLENS,u'table'),
- ),
- (TABLENS,u'dde-links') : (
- (TABLENS,u'dde-link'),
- ),
- (TABLENS,u'deletion') : (
- (OFFICENS,u'change-info'),
- (TABLENS,u'cut-offs'),
- (TABLENS,u'deletions'),
- (TABLENS,u'dependencies'),
- ),
- (TABLENS,u'deletions') : (
- (TABLENS,u'cell-content-deletion'),
- (TABLENS,u'change-deletion'),
- ),
- (TABLENS,u'dependencies') : (
- (TABLENS,u'dependency'),
- ),
- (TABLENS,u'dependency') : (
- ),
-# allowed_children
- (TABLENS,u'desc') : (
- ),
- (TABLENS,u'detective') : (
- (TABLENS,u'highlighted-range'),
- (TABLENS,u'operation'),
- ),
-# allowed_children
- (TABLENS,u'error-macro') : (
- ),
- (TABLENS,u'error-message') : (
- (TEXTNS,u'p'),
- ),
- (TABLENS,u'even-columns') : (
- ),
- (TABLENS,u'even-rows') : (
- ),
- (TABLENS,u'filter') : (
- (TABLENS,u'filter-and'),
- (TABLENS,u'filter-condition'),
- (TABLENS,u'filter-or'),
- ),
- (TABLENS,u'filter-and') : (
- (TABLENS,u'filter-condition'),
- (TABLENS,u'filter-or'),
- ),
- (TABLENS,u'filter-condition') : (
- (TABLENS,u'filter-set-item'),
- ),
- (TABLENS,u'filter-or') : (
- (TABLENS,u'filter-and'),
- (TABLENS,u'filter-condition'),
- ),
-# allowed_children
- (TABLENS,u'filter-set-item') : (
- ),
-# allowed_children
- (TABLENS,u'first-column') : (
- ),
- (TABLENS,u'first-row') : (
- ),
- (TABLENS,u'help-message') : (
- (TEXTNS,u'p'),
- ),
- (TABLENS,u'highlighted-range') : (
- ),
- (TABLENS,u'insertion') : (
- (OFFICENS,u'change-info'),
- (TABLENS,u'deletions'),
- (TABLENS,u'dependencies'),
- ),
- (TABLENS,u'insertion-cut-off') : (
- ),
- (TABLENS,u'iteration') : (
- ),
- (TABLENS,u'label-range') : (
- ),
- (TABLENS,u'label-ranges') : (
- (TABLENS,u'label-range'),
- ),
- (TABLENS,u'last-column') : (
- ),
- (TABLENS,u'last-row') : (
- ),
- (TABLENS,u'movement') : (
- (OFFICENS,u'change-info'),
- (TABLENS,u'deletions'),
- (TABLENS,u'dependencies'),
- (TABLENS,u'source-range-address'),
- (TABLENS,u'target-range-address'),
- ),
- (TABLENS,u'movement-cut-off') : (
- ),
- (TABLENS,u'named-expression') : (
- ),
- (TABLENS,u'named-expressions') : (
- (TABLENS,u'named-expression'),
- (TABLENS,u'named-range'),
- ),
-# allowed_children
- (TABLENS,u'named-range') : (
- ),
- (TABLENS,u'null-date') : (
- ),
- (TABLENS,u'odd-columns') : (
- ),
- (TABLENS,u'odd-rows') : (
- ),
- (TABLENS,u'operation') : (
- ),
- (TABLENS,u'previous') : (
- (TABLENS,u'change-track-table-cell'),
- ),
- (TABLENS,u'scenario') : (
- ),
- (TABLENS,u'shapes') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- ),
-# allowed_children
- (TABLENS,u'sort') : (
- (TABLENS,u'sort-by'),
- ),
- (TABLENS,u'sort-by') : (
- ),
- (TABLENS,u'sort-groups') : (
- ),
- (TABLENS,u'source-cell-range') : (
- (TABLENS,u'filter'),
- ),
- (TABLENS,u'source-range-address') : (
- ),
- (TABLENS,u'source-service') : (
- ),
- (TABLENS,u'subtotal-field') : (
- ),
- (TABLENS,u'subtotal-rule') : (
- (TABLENS,u'subtotal-field'),
- ),
- (TABLENS,u'subtotal-rules') : (
- (TABLENS,u'sort-groups'),
- (TABLENS,u'subtotal-rule'),
- ),
-# allowed_children
- (TABLENS,u'table') : (
- (OFFICENS,u'dde-source'),
- (OFFICENS,u'forms'),
- (TABLENS,u'desc'),
- (TABLENS,u'named-expressions'),
- (TABLENS,u'scenario'),
- (TABLENS,u'shapes'),
- (TABLENS,u'table-column'),
- (TABLENS,u'table-column-group'),
- (TABLENS,u'table-columns'),
- (TABLENS,u'table-header-columns'),
- (TABLENS,u'table-header-rows'),
- (TABLENS,u'table-row'),
- (TABLENS,u'table-row-group'),
- (TABLENS,u'table-rows'),
- (TABLENS,u'table-source'),
- (TABLENS,u'title'),
- (TEXTNS,u'soft-page-break'),
- ),
- (TABLENS,u'table-cell') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'annotation'),
- (TABLENS,u'cell-range-source'),
- (TABLENS,u'detective'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'list'),
- (TEXTNS,u'numbered-paragraph'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'user-index'),
- ),
-# allowed_children
- (TABLENS,u'table-column') : (
- ),
- (TABLENS,u'table-column-group') : (
- (TABLENS,u'table-column'),
- (TABLENS,u'table-column-group'),
- (TABLENS,u'table-columns'),
- (TABLENS,u'table-header-columns'),
- ),
- (TABLENS,u'table-columns') : (
- (TABLENS,u'table-column'),
- ),
- (TABLENS,u'table-header-columns') : (
- (TABLENS,u'table-column'),
- ),
- (TABLENS,u'table-header-rows') : (
- (TABLENS,u'table-row'),
- (TEXTNS,u'soft-page-break'),
- ),
- (TABLENS,u'table-row') : (
- (TABLENS,u'covered-table-cell'),
- (TABLENS,u'table-cell'),
- ),
- (TABLENS,u'table-row-group') : (
- (TABLENS,u'table-header-rows'),
- (TABLENS,u'table-row'),
- (TABLENS,u'table-row-group'),
- (TABLENS,u'table-rows'),
- (TEXTNS,u'soft-page-break'),
- ),
- (TABLENS,u'table-rows') : (
- (TABLENS,u'table-row'),
- (TEXTNS,u'soft-page-break'),
- ),
-# allowed_children
- (TABLENS,u'table-source') : (
- ),
- (TABLENS,u'table-template') : (
- (TABLENS,u'background'),
- (TABLENS,u'body'),
- (TABLENS,u'even-columns'),
- (TABLENS,u'even-rows'),
- (TABLENS,u'first-column'),
- (TABLENS,u'first-row'),
- (TABLENS,u'last-column'),
- (TABLENS,u'last-row'),
- (TABLENS,u'odd-columns'),
- (TABLENS,u'odd-rows'),
- ),
- (TABLENS,u'target-range-address') : (
- ),
-# allowed_children
- (TABLENS,u'title') : (
- ),
- (TABLENS,u'tracked-changes') : (
- (TABLENS,u'cell-content-change'),
- (TABLENS,u'deletion'),
- (TABLENS,u'insertion'),
- (TABLENS,u'movement'),
- ),
-# allowed_children
- (TEXTNS,u'a') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'annotation'),
- (OFFICENS,u'annotation-end'),
- (OFFICENS,u'event-listeners'),
- (PRESENTATIONNS,u'date-time'),
- (PRESENTATIONNS,u'footer'),
- (PRESENTATIONNS,u'header'),
- (TEXTNS,u'alphabetical-index-mark'),
- (TEXTNS,u'alphabetical-index-mark-end'),
- (TEXTNS,u'alphabetical-index-mark-start'),
- (TEXTNS,u'author-initials'),
- (TEXTNS,u'author-name'),
- (TEXTNS,u'bibliography-mark'),
- (TEXTNS,u'bookmark'),
- (TEXTNS,u'bookmark-end'),
- (TEXTNS,u'bookmark-ref'),
- (TEXTNS,u'bookmark-start'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'chapter'),
- (TEXTNS,u'character-count'),
- (TEXTNS,u'conditional-text'),
- (TEXTNS,u'creation-date'),
- (TEXTNS,u'creation-time'),
- (TEXTNS,u'creator'),
- (TEXTNS,u'database-display'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'database-next'),
- (TEXTNS,u'database-row-number'),
- (TEXTNS,u'database-row-select'),
- (TEXTNS,u'date'),
- (TEXTNS,u'dde-connection'),
- (TEXTNS,u'description'),
- (TEXTNS,u'editing-cycles'),
- (TEXTNS,u'editing-duration'),
- (TEXTNS,u'execute-macro'),
- (TEXTNS,u'expression'),
- (TEXTNS,u'file-name'),
- (TEXTNS,u'hidden-paragraph'),
- (TEXTNS,u'hidden-text'),
- (TEXTNS,u'image-count'),
- (TEXTNS,u'initial-creator'),
- (TEXTNS,u'keywords'),
- (TEXTNS,u'line-break'),
- (TEXTNS,u'measure'),
- (TEXTNS,u'meta'),
- (TEXTNS,u'meta-field'),
- (TEXTNS,u'modification-date'),
- (TEXTNS,u'modification-time'),
- (TEXTNS,u'note'),
- (TEXTNS,u'note-ref'),
- (TEXTNS,u'object-count'),
- (TEXTNS,u'page-continuation'),
- (TEXTNS,u'page-count'),
- (TEXTNS,u'page-number'),
- (TEXTNS,u'page-variable-get'),
- (TEXTNS,u'page-variable-set'),
- (TEXTNS,u'paragraph-count'),
- (TEXTNS,u'placeholder'),
- (TEXTNS,u'print-date'),
- (TEXTNS,u'printed-by'),
- (TEXTNS,u'print-time'),
- (TEXTNS,u'reference-mark'),
- (TEXTNS,u'reference-mark-end'),
- (TEXTNS,u'reference-mark-start'),
- (TEXTNS,u'reference-ref'),
- (TEXTNS,u'ruby'),
- (TEXTNS,u's'),
- (TEXTNS,u'script'),
- (TEXTNS,u'sender-city'),
- (TEXTNS,u'sender-company'),
- (TEXTNS,u'sender-country'),
- (TEXTNS,u'sender-email'),
- (TEXTNS,u'sender-fax'),
- (TEXTNS,u'sender-firstname'),
- (TEXTNS,u'sender-initials'),
- (TEXTNS,u'sender-lastname'),
- (TEXTNS,u'sender-phone-private'),
- (TEXTNS,u'sender-phone-work'),
- (TEXTNS,u'sender-position'),
- (TEXTNS,u'sender-postal-code'),
- (TEXTNS,u'sender-state-or-province'),
- (TEXTNS,u'sender-street'),
- (TEXTNS,u'sender-title'),
- (TEXTNS,u'sequence'),
- (TEXTNS,u'sequence-ref'),
- (TEXTNS,u'sheet-name'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'span'),
- (TEXTNS,u'subject'),
- (TEXTNS,u'tab'),
- (TEXTNS,u'table-count'),
- (TEXTNS,u'table-formula'),
- (TEXTNS,u'template-name'),
- (TEXTNS,u'text-input'),
- (TEXTNS,u'time'),
- (TEXTNS,u'title'),
- (TEXTNS,u'toc-mark'),
- (TEXTNS,u'toc-mark-end'),
- (TEXTNS,u'toc-mark-start'),
- (TEXTNS,u'user-defined'),
- (TEXTNS,u'user-field-get'),
- (TEXTNS,u'user-field-input'),
- (TEXTNS,u'user-index-mark'),
- (TEXTNS,u'user-index-mark-end'),
- (TEXTNS,u'user-index-mark-start'),
- (TEXTNS,u'variable-get'),
- (TEXTNS,u'variable-input'),
- (TEXTNS,u'variable-set'),
- (TEXTNS,u'word-count'),
-
- ),
-# allowed_children
- (TEXTNS,u'alphabetical-index') : (
- (TEXTNS,u'alphabetical-index-source'),
- (TEXTNS,u'index-body'),
- ),
- (TEXTNS,u'alphabetical-index-auto-mark-file') : (
- ),
- (TEXTNS,u'alphabetical-index-entry-template') : (
- (TEXTNS,u'index-entry-chapter'),
- (TEXTNS,u'index-entry-page-number'),
- (TEXTNS,u'index-entry-span'),
- (TEXTNS,u'index-entry-tab-stop'),
- (TEXTNS,u'index-entry-text'),
- ),
- (TEXTNS,u'alphabetical-index-mark') : (
- ),
- (TEXTNS,u'alphabetical-index-mark-end') : (
- ),
- (TEXTNS,u'alphabetical-index-mark-start') : (
- ),
- (TEXTNS,u'alphabetical-index-source') : (
- (TEXTNS,u'alphabetical-index-entry-template'),
- (TEXTNS,u'index-title-template'),
- ),
- (TEXTNS,u'author-initials') : (
- ),
- (TEXTNS,u'author-name') : (
- ),
- (TEXTNS,u'bibliography') : (
- (TEXTNS,u'bibliography-source'),
- (TEXTNS,u'index-body'),
- ),
- (TEXTNS,u'bibliography-configuration') : (
- (TEXTNS,u'sort-key'),
- ),
- (TEXTNS,u'bibliography-entry-template') : (
- (TEXTNS,u'index-entry-bibliography'),
- (TEXTNS,u'index-entry-span'),
- (TEXTNS,u'index-entry-tab-stop'),
- ),
-# allowed_children
- (TEXTNS,u'bibliography-mark') : (
- ),
- (TEXTNS,u'bibliography-source') : (
- (TEXTNS,u'bibliography-entry-template'),
- (TEXTNS,u'index-title-template'),
- ),
- (TEXTNS,u'bookmark') : (
- ),
- (TEXTNS,u'bookmark-end') : (
- ),
- (TEXTNS,u'bookmark-ref') : (
- ),
- (TEXTNS,u'bookmark-start') : (
- ),
- (TEXTNS,u'change') : (
- ),
- (TEXTNS,u'change-end') : (
- ),
- (TEXTNS,u'change-start') : (
- ),
- (TEXTNS,u'changed-region') : (
- (TEXTNS,u'deletion'),
- (TEXTNS,u'format-change'),
- (TEXTNS,u'insertion'),
- ),
- (TEXTNS,u'chapter') : (
- ),
- (TEXTNS,u'character-count') : (
- ),
- (TEXTNS,u'conditional-text') : (
- ),
- (TEXTNS,u'creation-date') : (
- ),
- (TEXTNS,u'creation-time') : (
- ),
- (TEXTNS,u'creator') : (
- ),
- (TEXTNS,u'database-display') : (
- (FORMNS,u'connection-resource'),
- ),
- (TEXTNS,u'database-name') : (
- (FORMNS,u'connection-resource'),
- ),
- (TEXTNS,u'database-next') : (
- (FORMNS,u'connection-resource'),
- ),
- (TEXTNS,u'database-row-number') : (
- (FORMNS,u'connection-resource'),
- ),
- (TEXTNS,u'database-row-select') : (
- (FORMNS,u'connection-resource'),
- ),
- (TEXTNS,u'date') : (
- ),
- (TEXTNS,u'dde-connection') : (
- ),
- (TEXTNS,u'dde-connection-decl') : (
- ),
- (TEXTNS,u'dde-connection-decls') : (
- (TEXTNS,u'dde-connection-decl'),
- ),
-# allowed_children
- (TEXTNS,u'deletion') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'change-info'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'list'),
- (TEXTNS,u'numbered-paragraph'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'user-index'),
- ),
- (TEXTNS,u'description') : (
- ),
- (TEXTNS,u'editing-cycles') : (
- ),
- (TEXTNS,u'editing-duration') : (
- ),
- (TEXTNS,u'execute-macro') : (
- (OFFICENS,u'event-listeners'),
- ),
- (TEXTNS,u'expression') : (
- ),
- (TEXTNS,u'file-name') : (
- ),
- (TEXTNS,u'format-change') : (
- (OFFICENS,u'change-info'),
- ),
-# allowed_children
- (TEXTNS,u'h') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'annotation'),
- (OFFICENS,u'annotation-end'),
- (PRESENTATIONNS,u'date-time'),
- (PRESENTATIONNS,u'footer'),
- (PRESENTATIONNS,u'header'),
- (TEXTNS,u'a'),
- (TEXTNS,u'alphabetical-index-mark'),
- (TEXTNS,u'alphabetical-index-mark-end'),
- (TEXTNS,u'alphabetical-index-mark-start'),
- (TEXTNS,u'author-initials'),
- (TEXTNS,u'author-name'),
- (TEXTNS,u'bibliography-mark'),
- (TEXTNS,u'bookmark'),
- (TEXTNS,u'bookmark-end'),
- (TEXTNS,u'bookmark-ref'),
- (TEXTNS,u'bookmark-start'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'chapter'),
- (TEXTNS,u'character-count'),
- (TEXTNS,u'conditional-text'),
- (TEXTNS,u'creation-date'),
- (TEXTNS,u'creation-time'),
- (TEXTNS,u'creator'),
- (TEXTNS,u'database-display'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'database-next'),
- (TEXTNS,u'database-row-number'),
- (TEXTNS,u'database-row-select'),
- (TEXTNS,u'date'),
- (TEXTNS,u'dde-connection'),
- (TEXTNS,u'description'),
- (TEXTNS,u'editing-cycles'),
- (TEXTNS,u'editing-duration'),
- (TEXTNS,u'execute-macro'),
- (TEXTNS,u'expression'),
- (TEXTNS,u'file-name'),
- (TEXTNS,u'hidden-paragraph'),
- (TEXTNS,u'hidden-text'),
- (TEXTNS,u'image-count'),
- (TEXTNS,u'initial-creator'),
- (TEXTNS,u'keywords'),
- (TEXTNS,u'line-break'),
- (TEXTNS,u'measure'),
- (TEXTNS,u'meta'),
- (TEXTNS,u'meta-field'),
- (TEXTNS,u'modification-date'),
- (TEXTNS,u'modification-time'),
- (TEXTNS,u'note'),
- (TEXTNS,u'note-ref'),
- (TEXTNS,u'number'),
- (TEXTNS,u'object-count'),
- (TEXTNS,u'page-continuation'),
- (TEXTNS,u'page-count'),
- (TEXTNS,u'page-number'),
- (TEXTNS,u'page-variable-get'),
- (TEXTNS,u'page-variable-set'),
- (TEXTNS,u'paragraph-count'),
- (TEXTNS,u'placeholder'),
- (TEXTNS,u'print-date'),
- (TEXTNS,u'printed-by'),
- (TEXTNS,u'print-time'),
- (TEXTNS,u'reference-mark'),
- (TEXTNS,u'reference-mark-end'),
- (TEXTNS,u'reference-mark-start'),
- (TEXTNS,u'reference-ref'),
- (TEXTNS,u'ruby'),
- (TEXTNS,u's'),
- (TEXTNS,u'script'),
- (TEXTNS,u'sender-city'),
- (TEXTNS,u'sender-company'),
- (TEXTNS,u'sender-country'),
- (TEXTNS,u'sender-email'),
- (TEXTNS,u'sender-fax'),
- (TEXTNS,u'sender-firstname'),
- (TEXTNS,u'sender-initials'),
- (TEXTNS,u'sender-lastname'),
- (TEXTNS,u'sender-phone-private'),
- (TEXTNS,u'sender-phone-work'),
- (TEXTNS,u'sender-position'),
- (TEXTNS,u'sender-postal-code'),
- (TEXTNS,u'sender-state-or-province'),
- (TEXTNS,u'sender-street'),
- (TEXTNS,u'sender-title'),
- (TEXTNS,u'sequence'),
- (TEXTNS,u'sequence-ref'),
- (TEXTNS,u'sheet-name'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'span'),
- (TEXTNS,u'subject'),
- (TEXTNS,u'tab'),
- (TEXTNS,u'table-count'),
- (TEXTNS,u'table-formula'),
- (TEXTNS,u'template-name'),
- (TEXTNS,u'text-input'),
- (TEXTNS,u'time'),
- (TEXTNS,u'title'),
- (TEXTNS,u'toc-mark'),
- (TEXTNS,u'toc-mark-end'),
- (TEXTNS,u'toc-mark-start'),
- (TEXTNS,u'user-defined'),
- (TEXTNS,u'user-field-get'),
- (TEXTNS,u'user-field-input'),
- (TEXTNS,u'user-index-mark'),
- (TEXTNS,u'user-index-mark-end'),
- (TEXTNS,u'user-index-mark-start'),
- (TEXTNS,u'variable-get'),
- (TEXTNS,u'variable-input'),
- (TEXTNS,u'variable-set'),
- (TEXTNS,u'word-count'),
-
- ),
-# allowed_children
- (TEXTNS,u'hidden-paragraph') : (
- ),
- (TEXTNS,u'hidden-text') : (
- ),
- (TEXTNS,u'illustration-index') : (
- (TEXTNS,u'illustration-index-source'),
- (TEXTNS,u'index-body'),
- ),
- (TEXTNS,u'illustration-index-entry-template') : (
- (TEXTNS,u'index-entry-chapter'),
- (TEXTNS,u'index-entry-page-number'),
- (TEXTNS,u'index-entry-span'),
- (TEXTNS,u'index-entry-tab-stop'),
- (TEXTNS,u'index-entry-text'),
- ),
- (TEXTNS,u'illustration-index-source') : (
- (TEXTNS,u'illustration-index-entry-template'),
- (TEXTNS,u'index-title-template'),
- ),
- (TEXTNS,u'image-count') : (
- ),
-# allowed_children
- (TEXTNS,u'index-body') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'index-title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'numbered-paragraph'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'user-index'),
- ),
- (TEXTNS,u'index-entry-bibliography') : (
- ),
- (TEXTNS,u'index-entry-chapter') : (
- ),
- (TEXTNS,u'index-entry-link-end') : (
- ),
- (TEXTNS,u'index-entry-link-start') : (
- ),
- (TEXTNS,u'index-entry-page-number') : (
- ),
- (TEXTNS,u'index-entry-span') : (
- ),
- (TEXTNS,u'index-entry-tab-stop') : (
- ),
- (TEXTNS,u'index-entry-text') : (
- ),
- (TEXTNS,u'index-source-style') : (
- ),
- (TEXTNS,u'index-source-styles') : (
- (TEXTNS,u'index-source-style'),
- ),
-# allowed_children
- (TEXTNS,u'index-title') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'index-title'),
- (TEXTNS,u'list'),
- (TEXTNS,u'numbered-paragraph'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'user-index'),
- ),
- (TEXTNS,u'index-title-template') : (
- ),
- (TEXTNS,u'initial-creator') : (
- ),
- (TEXTNS,u'insertion') : (
- (OFFICENS,u'change-info'),
- ),
- (TEXTNS,u'keywords') : (
- ),
- (TEXTNS,u'line-break') : (
- ),
- (TEXTNS,u'linenumbering-configuration') : (
- (TEXTNS,u'linenumbering-separator'),
- ),
- (TEXTNS,u'linenumbering-separator') : (
- ),
- (TEXTNS,u'list') : (
- (TEXTNS,u'list-header'),
- (TEXTNS,u'list-item'),
- ),
- (TEXTNS,u'list-header') : (
- (TEXTNS,u'h'),
- (TEXTNS,u'list'),
- (TEXTNS,u'number'),
- (TEXTNS,u'p'),
- (TEXTNS,u'soft-page-break'),
- ),
- (TEXTNS,u'list-item') : (
- (TEXTNS,u'h'),
- (TEXTNS,u'list'),
- (TEXTNS,u'number'),
- (TEXTNS,u'p'),
- (TEXTNS,u'soft-page-break'),
- ),
- (TEXTNS,u'list-level-style-bullet') : (
- (STYLENS,u'list-level-properties'),
- (STYLENS,u'text-properties'),
- ),
- (TEXTNS,u'list-level-style-image') : (
- (OFFICENS,u'binary-data'),
- (STYLENS,u'list-level-properties'),
- ),
- (TEXTNS,u'list-level-style-number') : (
- (STYLENS,u'list-level-properties'),
- (STYLENS,u'text-properties'),
- ),
- (TEXTNS,u'list-style') : (
- (TEXTNS,u'list-level-style-bullet'),
- (TEXTNS,u'list-level-style-image'),
- (TEXTNS,u'list-level-style-number'),
- ),
- (TEXTNS,u'measure') : (
- ),
-# allowed_children
- (TEXTNS,u'meta') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'annotation'),
- (OFFICENS,u'annotation-end'),
- (PRESENTATIONNS,u'date-time'),
- (PRESENTATIONNS,u'footer'),
- (PRESENTATIONNS,u'header'),
- (TEXTNS,u'a'),
- (TEXTNS,u'alphabetical-index-mark'),
- (TEXTNS,u'alphabetical-index-mark-end'),
- (TEXTNS,u'alphabetical-index-mark-start'),
- (TEXTNS,u'author-initials'),
- (TEXTNS,u'author-name'),
- (TEXTNS,u'bibliography-mark'),
- (TEXTNS,u'bookmark'),
- (TEXTNS,u'bookmark-end'),
- (TEXTNS,u'bookmark-ref'),
- (TEXTNS,u'bookmark-start'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'chapter'),
- (TEXTNS,u'character-count'),
- (TEXTNS,u'conditional-text'),
- (TEXTNS,u'creation-date'),
- (TEXTNS,u'creation-time'),
- (TEXTNS,u'creator'),
- (TEXTNS,u'database-display'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'database-next'),
- (TEXTNS,u'database-row-number'),
- (TEXTNS,u'database-row-select'),
- (TEXTNS,u'date'),
- (TEXTNS,u'dde-connection'),
- (TEXTNS,u'description'),
- (TEXTNS,u'editing-cycles'),
- (TEXTNS,u'editing-duration'),
- (TEXTNS,u'execute-macro'),
- (TEXTNS,u'expression'),
- (TEXTNS,u'file-name'),
- (TEXTNS,u'hidden-paragraph'),
- (TEXTNS,u'hidden-text'),
- (TEXTNS,u'image-count'),
- (TEXTNS,u'initial-creator'),
- (TEXTNS,u'keywords'),
- (TEXTNS,u'line-break'),
- (TEXTNS,u'measure'),
- (TEXTNS,u'meta'),
- (TEXTNS,u'meta-field'),
- (TEXTNS,u'modification-date'),
- (TEXTNS,u'modification-time'),
- (TEXTNS,u'note'),
- (TEXTNS,u'note-ref'),
- (TEXTNS,u'object-count'),
- (TEXTNS,u'page-continuation'),
- (TEXTNS,u'page-count'),
- (TEXTNS,u'page-number'),
- (TEXTNS,u'page-variable-get'),
- (TEXTNS,u'page-variable-set'),
- (TEXTNS,u'paragraph-count'),
- (TEXTNS,u'placeholder'),
- (TEXTNS,u'print-date'),
- (TEXTNS,u'printed-by'),
- (TEXTNS,u'print-time'),
- (TEXTNS,u'reference-mark'),
- (TEXTNS,u'reference-mark-end'),
- (TEXTNS,u'reference-mark-start'),
- (TEXTNS,u'reference-ref'),
- (TEXTNS,u'ruby'),
- (TEXTNS,u's'),
- (TEXTNS,u'script'),
- (TEXTNS,u'sender-city'),
- (TEXTNS,u'sender-company'),
- (TEXTNS,u'sender-country'),
- (TEXTNS,u'sender-email'),
- (TEXTNS,u'sender-fax'),
- (TEXTNS,u'sender-firstname'),
- (TEXTNS,u'sender-initials'),
- (TEXTNS,u'sender-lastname'),
- (TEXTNS,u'sender-phone-private'),
- (TEXTNS,u'sender-phone-work'),
- (TEXTNS,u'sender-position'),
- (TEXTNS,u'sender-postal-code'),
- (TEXTNS,u'sender-state-or-province'),
- (TEXTNS,u'sender-street'),
- (TEXTNS,u'sender-title'),
- (TEXTNS,u'sequence'),
- (TEXTNS,u'sequence-ref'),
- (TEXTNS,u'sheet-name'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'span'),
- (TEXTNS,u'subject'),
- (TEXTNS,u'tab'),
- (TEXTNS,u'table-count'),
- (TEXTNS,u'table-formula'),
- (TEXTNS,u'template-name'),
- (TEXTNS,u'text-input'),
- (TEXTNS,u'time'),
- (TEXTNS,u'title'),
- (TEXTNS,u'toc-mark'),
- (TEXTNS,u'toc-mark-end'),
- (TEXTNS,u'toc-mark-start'),
- (TEXTNS,u'user-defined'),
- (TEXTNS,u'user-field-get'),
- (TEXTNS,u'user-field-input'),
- (TEXTNS,u'user-index-mark'),
- (TEXTNS,u'user-index-mark-end'),
- (TEXTNS,u'user-index-mark-start'),
- (TEXTNS,u'variable-get'),
- (TEXTNS,u'variable-input'),
- (TEXTNS,u'variable-set'),
- (TEXTNS,u'word-count'),
- ),
-# allowed_children
- (TEXTNS,u'meta-field') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'annotation'),
- (OFFICENS,u'annotation-end'),
- (PRESENTATIONNS,u'date-time'),
- (PRESENTATIONNS,u'footer'),
- (PRESENTATIONNS,u'header'),
- (TEXTNS,u'a'),
- (TEXTNS,u'alphabetical-index-mark'),
- (TEXTNS,u'alphabetical-index-mark-end'),
- (TEXTNS,u'alphabetical-index-mark-start'),
- (TEXTNS,u'author-initials'),
- (TEXTNS,u'author-name'),
- (TEXTNS,u'bibliography-mark'),
- (TEXTNS,u'bookmark'),
- (TEXTNS,u'bookmark-end'),
- (TEXTNS,u'bookmark-ref'),
- (TEXTNS,u'bookmark-start'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'chapter'),
- (TEXTNS,u'character-count'),
- (TEXTNS,u'conditional-text'),
- (TEXTNS,u'creation-date'),
- (TEXTNS,u'creation-time'),
- (TEXTNS,u'creator'),
- (TEXTNS,u'database-display'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'database-next'),
- (TEXTNS,u'database-row-number'),
- (TEXTNS,u'database-row-select'),
- (TEXTNS,u'date'),
- (TEXTNS,u'dde-connection'),
- (TEXTNS,u'description'),
- (TEXTNS,u'editing-cycles'),
- (TEXTNS,u'editing-duration'),
- (TEXTNS,u'execute-macro'),
- (TEXTNS,u'expression'),
- (TEXTNS,u'file-name'),
- (TEXTNS,u'hidden-paragraph'),
- (TEXTNS,u'hidden-text'),
- (TEXTNS,u'image-count'),
- (TEXTNS,u'initial-creator'),
- (TEXTNS,u'keywords'),
- (TEXTNS,u'line-break'),
- (TEXTNS,u'measure'),
- (TEXTNS,u'meta'),
- (TEXTNS,u'meta-field'),
- (TEXTNS,u'modification-date'),
- (TEXTNS,u'modification-time'),
- (TEXTNS,u'note'),
- (TEXTNS,u'note-ref'),
- (TEXTNS,u'object-count'),
- (TEXTNS,u'page-continuation'),
- (TEXTNS,u'page-count'),
- (TEXTNS,u'page-number'),
- (TEXTNS,u'page-variable-get'),
- (TEXTNS,u'page-variable-set'),
- (TEXTNS,u'paragraph-count'),
- (TEXTNS,u'placeholder'),
- (TEXTNS,u'print-date'),
- (TEXTNS,u'printed-by'),
- (TEXTNS,u'print-time'),
- (TEXTNS,u'reference-mark'),
- (TEXTNS,u'reference-mark-end'),
- (TEXTNS,u'reference-mark-start'),
- (TEXTNS,u'reference-ref'),
- (TEXTNS,u'ruby'),
- (TEXTNS,u's'),
- (TEXTNS,u'script'),
- (TEXTNS,u'sender-city'),
- (TEXTNS,u'sender-company'),
- (TEXTNS,u'sender-country'),
- (TEXTNS,u'sender-email'),
- (TEXTNS,u'sender-fax'),
- (TEXTNS,u'sender-firstname'),
- (TEXTNS,u'sender-initials'),
- (TEXTNS,u'sender-lastname'),
- (TEXTNS,u'sender-phone-private'),
- (TEXTNS,u'sender-phone-work'),
- (TEXTNS,u'sender-position'),
- (TEXTNS,u'sender-postal-code'),
- (TEXTNS,u'sender-state-or-province'),
- (TEXTNS,u'sender-street'),
- (TEXTNS,u'sender-title'),
- (TEXTNS,u'sequence'),
- (TEXTNS,u'sequence-ref'),
- (TEXTNS,u'sheet-name'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'span'),
- (TEXTNS,u'subject'),
- (TEXTNS,u'tab'),
- (TEXTNS,u'table-count'),
- (TEXTNS,u'table-formula'),
- (TEXTNS,u'template-name'),
- (TEXTNS,u'text-input'),
- (TEXTNS,u'time'),
- (TEXTNS,u'title'),
- (TEXTNS,u'toc-mark'),
- (TEXTNS,u'toc-mark-end'),
- (TEXTNS,u'toc-mark-start'),
- (TEXTNS,u'user-defined'),
- (TEXTNS,u'user-field-get'),
- (TEXTNS,u'user-field-input'),
- (TEXTNS,u'user-index-mark'),
- (TEXTNS,u'user-index-mark-end'),
- (TEXTNS,u'user-index-mark-start'),
- (TEXTNS,u'variable-get'),
- (TEXTNS,u'variable-input'),
- (TEXTNS,u'variable-set'),
- (TEXTNS,u'word-count'),
- ),
-# allowed_children
- (TEXTNS,u'modification-date') : (
- ),
- (TEXTNS,u'modification-time') : (
- ),
- (TEXTNS,u'note') : (
- (TEXTNS,u'note-body'),
- (TEXTNS,u'note-citation'),
- ),
-# allowed_children
- (TEXTNS,u'note-body') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'list'),
- (TEXTNS,u'numbered-paragraph'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'user-index'),
- ),
- (TEXTNS,u'note-citation') : (
- ),
- (TEXTNS,u'note-continuation-notice-backward') : (
- ),
- (TEXTNS,u'note-continuation-notice-forward') : (
- ),
- (TEXTNS,u'note-ref') : (
- ),
- (TEXTNS,u'notes-configuration') : (
- (TEXTNS,u'note-continuation-notice-backward'),
- (TEXTNS,u'note-continuation-notice-forward'),
- ),
- (TEXTNS,u'number') : (
- ),
- (TEXTNS,u'numbered-paragraph') : (
- (TEXTNS,u'h'),
- (TEXTNS,u'number'),
- (TEXTNS,u'p'),
- ),
- (TEXTNS,u'object-count') : (
- ),
- (TEXTNS,u'object-index') : (
- (TEXTNS,u'index-body'),
- (TEXTNS,u'object-index-source'),
- ),
- (TEXTNS,u'object-index-entry-template') : (
- (TEXTNS,u'index-entry-chapter'),
- (TEXTNS,u'index-entry-page-number'),
- (TEXTNS,u'index-entry-span'),
- (TEXTNS,u'index-entry-tab-stop'),
- (TEXTNS,u'index-entry-text'),
- ),
- (TEXTNS,u'object-index-source') : (
- (TEXTNS,u'index-title-template'),
- (TEXTNS,u'object-index-entry-template'),
- ),
- (TEXTNS,u'outline-level-style') : (
- (STYLENS,u'list-level-properties'),
- (STYLENS,u'text-properties'),
- ),
- (TEXTNS,u'outline-style') : (
- (TEXTNS,u'outline-level-style'),
- ),
-# allowed_children
- (TEXTNS,u'p') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'annotation'),
- (OFFICENS,u'annotation-end'),
- (PRESENTATIONNS,u'date-time'),
- (PRESENTATIONNS,u'footer'),
- (PRESENTATIONNS,u'header'),
- (TEXTNS,u'a'),
- (TEXTNS,u'alphabetical-index-mark'),
- (TEXTNS,u'alphabetical-index-mark-end'),
- (TEXTNS,u'alphabetical-index-mark-start'),
- (TEXTNS,u'author-initials'),
- (TEXTNS,u'author-name'),
- (TEXTNS,u'bibliography-mark'),
- (TEXTNS,u'bookmark'),
- (TEXTNS,u'bookmark-end'),
- (TEXTNS,u'bookmark-ref'),
- (TEXTNS,u'bookmark-start'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'chapter'),
- (TEXTNS,u'character-count'),
- (TEXTNS,u'conditional-text'),
- (TEXTNS,u'creation-date'),
- (TEXTNS,u'creation-time'),
- (TEXTNS,u'creator'),
- (TEXTNS,u'database-display'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'database-next'),
- (TEXTNS,u'database-row-number'),
- (TEXTNS,u'database-row-select'),
- (TEXTNS,u'date'),
- (TEXTNS,u'dde-connection'),
- (TEXTNS,u'description'),
- (TEXTNS,u'editing-cycles'),
- (TEXTNS,u'editing-duration'),
- (TEXTNS,u'execute-macro'),
- (TEXTNS,u'expression'),
- (TEXTNS,u'file-name'),
- (TEXTNS,u'hidden-paragraph'),
- (TEXTNS,u'hidden-text'),
- (TEXTNS,u'image-count'),
- (TEXTNS,u'initial-creator'),
- (TEXTNS,u'keywords'),
- (TEXTNS,u'line-break'),
- (TEXTNS,u'measure'),
- (TEXTNS,u'meta'),
- (TEXTNS,u'meta-field'),
- (TEXTNS,u'modification-date'),
- (TEXTNS,u'modification-time'),
- (TEXTNS,u'note'),
- (TEXTNS,u'note-ref'),
- (TEXTNS,u'object-count'),
- (TEXTNS,u'page-continuation'),
- (TEXTNS,u'page-count'),
- (TEXTNS,u'page-number'),
- (TEXTNS,u'page-variable-get'),
- (TEXTNS,u'page-variable-set'),
- (TEXTNS,u'paragraph-count'),
- (TEXTNS,u'placeholder'),
- (TEXTNS,u'print-date'),
- (TEXTNS,u'printed-by'),
- (TEXTNS,u'print-time'),
- (TEXTNS,u'reference-mark'),
- (TEXTNS,u'reference-mark-end'),
- (TEXTNS,u'reference-mark-start'),
- (TEXTNS,u'reference-ref'),
- (TEXTNS,u'ruby'),
- (TEXTNS,u's'),
- (TEXTNS,u'script'),
- (TEXTNS,u'sender-city'),
- (TEXTNS,u'sender-company'),
- (TEXTNS,u'sender-country'),
- (TEXTNS,u'sender-email'),
- (TEXTNS,u'sender-fax'),
- (TEXTNS,u'sender-firstname'),
- (TEXTNS,u'sender-initials'),
- (TEXTNS,u'sender-lastname'),
- (TEXTNS,u'sender-phone-private'),
- (TEXTNS,u'sender-phone-work'),
- (TEXTNS,u'sender-position'),
- (TEXTNS,u'sender-postal-code'),
- (TEXTNS,u'sender-state-or-province'),
- (TEXTNS,u'sender-street'),
- (TEXTNS,u'sender-title'),
- (TEXTNS,u'sequence'),
- (TEXTNS,u'sequence-ref'),
- (TEXTNS,u'sheet-name'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'span'),
- (TEXTNS,u'subject'),
- (TEXTNS,u'tab'),
- (TEXTNS,u'table-count'),
- (TEXTNS,u'table-formula'),
- (TEXTNS,u'template-name'),
- (TEXTNS,u'text-input'),
- (TEXTNS,u'time'),
- (TEXTNS,u'title'),
- (TEXTNS,u'toc-mark'),
- (TEXTNS,u'toc-mark-end'),
- (TEXTNS,u'toc-mark-start'),
- (TEXTNS,u'user-defined'),
- (TEXTNS,u'user-field-get'),
- (TEXTNS,u'user-field-input'),
- (TEXTNS,u'user-index-mark'),
- (TEXTNS,u'user-index-mark-end'),
- (TEXTNS,u'user-index-mark-start'),
- (TEXTNS,u'variable-get'),
- (TEXTNS,u'variable-input'),
- (TEXTNS,u'variable-set'),
- (TEXTNS,u'word-count'),
- ),
- (TEXTNS,u'page') : (
- ),
- (TEXTNS,u'page-count') : (
- ),
- (TEXTNS,u'page-continuation') : (
- ),
- (TEXTNS,u'page-number') : (
- ),
- (TEXTNS,u'page-sequence') : (
- (TEXTNS,u'page'),
- ),
- (TEXTNS,u'page-variable-get') : (
- ),
- (TEXTNS,u'page-variable-set') : (
- ),
- (TEXTNS,u'paragraph-count') : (
- ),
- (TEXTNS,u'placeholder') : (
- ),
- (TEXTNS,u'print-date') : (
- ),
- (TEXTNS,u'print-time') : (
- ),
- (TEXTNS,u'printed-by') : (
- ),
- (TEXTNS,u'reference-mark') : (
- ),
- (TEXTNS,u'reference-mark-end') : (
- ),
-# allowed_children
- (TEXTNS,u'reference-mark-start') : (
- ),
- (TEXTNS,u'reference-ref') : (
- ),
- (TEXTNS,u'ruby') : (
- (TEXTNS,u'ruby-base'),
- (TEXTNS,u'ruby-text'),
- ),
- (TEXTNS,u'ruby-base') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'annotation'),
- (OFFICENS,u'annotation-end'),
- (PRESENTATIONNS,u'date-time'),
- (PRESENTATIONNS,u'footer'),
- (PRESENTATIONNS,u'header'),
- (TEXTNS,u'a'),
- (TEXTNS,u'alphabetical-index-mark'),
- (TEXTNS,u'alphabetical-index-mark-end'),
- (TEXTNS,u'alphabetical-index-mark-start'),
- (TEXTNS,u'author-initials'),
- (TEXTNS,u'author-name'),
- (TEXTNS,u'bibliography-mark'),
- (TEXTNS,u'bookmark'),
- (TEXTNS,u'bookmark-end'),
- (TEXTNS,u'bookmark-ref'),
- (TEXTNS,u'bookmark-start'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'chapter'),
- (TEXTNS,u'character-count'),
- (TEXTNS,u'conditional-text'),
- (TEXTNS,u'creation-date'),
- (TEXTNS,u'creation-time'),
- (TEXTNS,u'creator'),
- (TEXTNS,u'database-display'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'database-next'),
- (TEXTNS,u'database-row-number'),
- (TEXTNS,u'database-row-select'),
- (TEXTNS,u'date'),
- (TEXTNS,u'dde-connection'),
- (TEXTNS,u'description'),
- (TEXTNS,u'editing-cycles'),
- (TEXTNS,u'editing-duration'),
- (TEXTNS,u'execute-macro'),
- (TEXTNS,u'expression'),
- (TEXTNS,u'file-name'),
- (TEXTNS,u'hidden-paragraph'),
- (TEXTNS,u'hidden-text'),
- (TEXTNS,u'image-count'),
- (TEXTNS,u'initial-creator'),
- (TEXTNS,u'keywords'),
- (TEXTNS,u'line-break'),
- (TEXTNS,u'measure'),
- (TEXTNS,u'meta'),
- (TEXTNS,u'meta-field'),
- (TEXTNS,u'modification-date'),
- (TEXTNS,u'modification-time'),
- (TEXTNS,u'note'),
- (TEXTNS,u'note-ref'),
- (TEXTNS,u'object-count'),
- (TEXTNS,u'page-continuation'),
- (TEXTNS,u'page-count'),
- (TEXTNS,u'page-number'),
- (TEXTNS,u'page-variable-get'),
- (TEXTNS,u'page-variable-set'),
- (TEXTNS,u'paragraph-count'),
- (TEXTNS,u'placeholder'),
- (TEXTNS,u'print-date'),
- (TEXTNS,u'printed-by'),
- (TEXTNS,u'print-time'),
- (TEXTNS,u'reference-mark'),
- (TEXTNS,u'reference-mark-end'),
- (TEXTNS,u'reference-mark-start'),
- (TEXTNS,u'reference-ref'),
- (TEXTNS,u'ruby'),
- (TEXTNS,u's'),
- (TEXTNS,u'script'),
- (TEXTNS,u'sender-city'),
- (TEXTNS,u'sender-company'),
- (TEXTNS,u'sender-country'),
- (TEXTNS,u'sender-email'),
- (TEXTNS,u'sender-fax'),
- (TEXTNS,u'sender-firstname'),
- (TEXTNS,u'sender-initials'),
- (TEXTNS,u'sender-lastname'),
- (TEXTNS,u'sender-phone-private'),
- (TEXTNS,u'sender-phone-work'),
- (TEXTNS,u'sender-position'),
- (TEXTNS,u'sender-postal-code'),
- (TEXTNS,u'sender-state-or-province'),
- (TEXTNS,u'sender-street'),
- (TEXTNS,u'sender-title'),
- (TEXTNS,u'sequence'),
- (TEXTNS,u'sequence-ref'),
- (TEXTNS,u'sheet-name'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'span'),
- (TEXTNS,u'subject'),
- (TEXTNS,u'tab'),
- (TEXTNS,u'table-count'),
- (TEXTNS,u'table-formula'),
- (TEXTNS,u'template-name'),
- (TEXTNS,u'text-input'),
- (TEXTNS,u'time'),
- (TEXTNS,u'title'),
- (TEXTNS,u'toc-mark'),
- (TEXTNS,u'toc-mark-end'),
- (TEXTNS,u'toc-mark-start'),
- (TEXTNS,u'user-defined'),
- (TEXTNS,u'user-field-get'),
- (TEXTNS,u'user-field-input'),
- (TEXTNS,u'user-index-mark'),
- (TEXTNS,u'user-index-mark-end'),
- (TEXTNS,u'user-index-mark-start'),
- (TEXTNS,u'variable-get'),
- (TEXTNS,u'variable-input'),
- (TEXTNS,u'variable-set'),
- (TEXTNS,u'word-count'),
-
- ),
-# allowed_children
- (TEXTNS,u'ruby-text') : (
- ),
- (TEXTNS,u's') : (
- ),
- (TEXTNS,u'script') : (
- ),
- (TEXTNS,u'section') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'dde-source'),
- (TABLENS,u'table'),
- (TEXTNS,u'alphabetical-index'),
- (TEXTNS,u'bibliography'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'h'),
- (TEXTNS,u'illustration-index'),
- (TEXTNS,u'list'),
- (TEXTNS,u'numbered-paragraph'),
- (TEXTNS,u'object-index'),
- (TEXTNS,u'p'),
- (TEXTNS,u'section'),
- (TEXTNS,u'section-source'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'table-index'),
- (TEXTNS,u'table-of-content'),
- (TEXTNS,u'user-index'),
- ),
- (TEXTNS,u'section-source') : (
- ),
- (TEXTNS,u'sender-city') : (
- ),
- (TEXTNS,u'sender-company') : (
- ),
- (TEXTNS,u'sender-country') : (
- ),
-# allowed_children
- (TEXTNS,u'sender-email') : (
- ),
- (TEXTNS,u'sender-fax') : (
- ),
- (TEXTNS,u'sender-firstname') : (
- ),
- (TEXTNS,u'sender-initials') : (
- ),
- (TEXTNS,u'sender-lastname') : (
- ),
- (TEXTNS,u'sender-phone-private') : (
- ),
- (TEXTNS,u'sender-phone-work') : (
- ),
- (TEXTNS,u'sender-position') : (
- ),
- (TEXTNS,u'sender-postal-code') : (
- ),
- (TEXTNS,u'sender-state-or-province') : (
- ),
- (TEXTNS,u'sender-street') : (
- ),
- (TEXTNS,u'sender-title') : (
- ),
- (TEXTNS,u'sequence') : (
- ),
- (TEXTNS,u'sequence-decl') : (
- ),
- (TEXTNS,u'sequence-decls') : (
- (TEXTNS,u'sequence-decl'),
- ),
- (TEXTNS,u'sequence-ref') : (
- ),
- (TEXTNS,u'sheet-name') : (
- ),
- (TEXTNS,u'soft-page-break') : (
- ),
- (TEXTNS,u'sort-key') : (
- ),
-# allowed_children
- (TEXTNS,u'span') : (
- (DR3DNS,u'scene'),
- (DRAWNS,u'a'),
- (DRAWNS,u'caption'),
- (DRAWNS,u'circle'),
- (DRAWNS,u'connector'),
- (DRAWNS,u'control'),
- (DRAWNS,u'custom-shape'),
- (DRAWNS,u'ellipse'),
- (DRAWNS,u'frame'),
- (DRAWNS,u'g'),
- (DRAWNS,u'line'),
- (DRAWNS,u'measure'),
- (DRAWNS,u'page-thumbnail'),
- (DRAWNS,u'path'),
- (DRAWNS,u'polygon'),
- (DRAWNS,u'polyline'),
- (DRAWNS,u'rect'),
- (DRAWNS,u'regular-polygon'),
- (OFFICENS,u'annotation'),
- (OFFICENS,u'annotation-end'),
- (PRESENTATIONNS,u'date-time'),
- (PRESENTATIONNS,u'footer'),
- (PRESENTATIONNS,u'header'),
- (TEXTNS,u'a'),
- (TEXTNS,u'alphabetical-index-mark'),
- (TEXTNS,u'alphabetical-index-mark-end'),
- (TEXTNS,u'alphabetical-index-mark-start'),
- (TEXTNS,u'author-initials'),
- (TEXTNS,u'author-name'),
- (TEXTNS,u'bibliography-mark'),
- (TEXTNS,u'bookmark'),
- (TEXTNS,u'bookmark-end'),
- (TEXTNS,u'bookmark-ref'),
- (TEXTNS,u'bookmark-start'),
- (TEXTNS,u'change'),
- (TEXTNS,u'change-end'),
- (TEXTNS,u'change-start'),
- (TEXTNS,u'chapter'),
- (TEXTNS,u'conditional-text'),
- (TEXTNS,u'creation-date'),
- (TEXTNS,u'creation-time'),
- (TEXTNS,u'creator'),
- (TEXTNS,u'database-display'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'database-next'),
- (TEXTNS,u'database-row-number'),
- (TEXTNS,u'database-row-select'),
- (TEXTNS,u'date'),
- (TEXTNS,u'dde-connection'),
- (TEXTNS,u'description'),
- (TEXTNS,u'editing-cycles'),
- (TEXTNS,u'editing-duration'),
- (TEXTNS,u'execute-macro'),
- (TEXTNS,u'expression'),
- (TEXTNS,u'file-name'),
- (TEXTNS,u'hidden-paragraph'),
- (TEXTNS,u'hidden-text'),
- (TEXTNS,u'initial-creator'),
- (TEXTNS,u'keywords'),
- (TEXTNS,u'line-break'),
- (TEXTNS,u'measure'),
- (TEXTNS,u'meta'),
- (TEXTNS,u'meta-field'),
- (TEXTNS,u'modification-date'),
- (TEXTNS,u'modification-time'),
- (TEXTNS,u'note'),
- (TEXTNS,u'note-ref'),
- (TEXTNS,u'page-count'),
- (TEXTNS,u'paragraph-count'),
- (TEXTNS,u'word-count'),
- (TEXTNS,u'character-count'),
- (TEXTNS,u'table-count'),
- (TEXTNS,u'image-count'),
- (TEXTNS,u'object-count'),
- (TEXTNS,u'page-continuation'),
- (TEXTNS,u'page-number'),
- (TEXTNS,u'page-variable-get'),
- (TEXTNS,u'page-variable-set'),
- (TEXTNS,u'placeholder'),
- (TEXTNS,u'print-date'),
- (TEXTNS,u'print-time'),
- (TEXTNS,u'printed-by'),
- (TEXTNS,u'reference-mark'),
- (TEXTNS,u'reference-mark-end'),
- (TEXTNS,u'reference-mark-start'),
- (TEXTNS,u'reference-ref'),
- (TEXTNS,u'ruby'),
- (TEXTNS,u's'),
- (TEXTNS,u'script'),
- (TEXTNS,u'sender-city'),
- (TEXTNS,u'sender-company'),
- (TEXTNS,u'sender-country'),
- (TEXTNS,u'sender-email'),
- (TEXTNS,u'sender-fax'),
- (TEXTNS,u'sender-firstname'),
- (TEXTNS,u'sender-initials'),
- (TEXTNS,u'sender-lastname'),
- (TEXTNS,u'sender-phone-private'),
- (TEXTNS,u'sender-phone-work'),
- (TEXTNS,u'sender-position'),
- (TEXTNS,u'sender-postal-code'),
- (TEXTNS,u'sender-state-or-province'),
- (TEXTNS,u'sender-street'),
- (TEXTNS,u'sender-title'),
- (TEXTNS,u'sequence'),
- (TEXTNS,u'sequence-ref'),
- (TEXTNS,u'sheet-name'),
- (TEXTNS,u'soft-page-break'),
- (TEXTNS,u'span'),
- (TEXTNS,u'subject'),
- (TEXTNS,u'tab'),
- (TEXTNS,u'table-formula'),
- (TEXTNS,u'template-name'),
- (TEXTNS,u'text-input'),
- (TEXTNS,u'time'),
- (TEXTNS,u'title'),
- (TEXTNS,u'toc-mark'),
- (TEXTNS,u'toc-mark-end'),
- (TEXTNS,u'toc-mark-start'),
- (TEXTNS,u'user-defined'),
- (TEXTNS,u'user-field-get'),
- (TEXTNS,u'user-field-input'),
- (TEXTNS,u'user-index-mark'),
- (TEXTNS,u'user-index-mark-end'),
- (TEXTNS,u'user-index-mark-start'),
- (TEXTNS,u'variable-get'),
- (TEXTNS,u'variable-input'),
- (TEXTNS,u'variable-set'),
- ),
-# allowed_children
- (TEXTNS,u'subject') : (
- ),
- (TEXTNS,u'tab') : (
- ),
- (TEXTNS,u'table-count') : (
- ),
- (TEXTNS,u'table-formula') : (
- ),
- (TEXTNS,u'table-index') : (
- (TEXTNS,u'index-body'),
- (TEXTNS,u'table-index-source'),
- ),
- (TEXTNS,u'table-index-entry-template') : (
- (TEXTNS,u'index-entry-chapter'),
- (TEXTNS,u'index-entry-page-number'),
- (TEXTNS,u'index-entry-span'),
- (TEXTNS,u'index-entry-tab-stop'),
- (TEXTNS,u'index-entry-text'),
- ),
- (TEXTNS,u'table-index-source') : (
- (TEXTNS,u'index-title-template'),
- (TEXTNS,u'table-index-entry-template'),
- ),
- (TEXTNS,u'table-of-content') : (
- (TEXTNS,u'index-body'),
- (TEXTNS,u'table-of-content-source'),
- ),
- (TEXTNS,u'table-of-content-entry-template') : (
- (TEXTNS,u'index-entry-chapter'),
- (TEXTNS,u'index-entry-link-end'),
- (TEXTNS,u'index-entry-link-start'),
- (TEXTNS,u'index-entry-page-number'),
- (TEXTNS,u'index-entry-span'),
- (TEXTNS,u'index-entry-tab-stop'),
- (TEXTNS,u'index-entry-text'),
- ),
- (TEXTNS,u'table-of-content-source') : (
- (TEXTNS,u'index-source-styles'),
- (TEXTNS,u'index-title-template'),
- (TEXTNS,u'table-of-content-entry-template'),
- ),
- (TEXTNS,u'template-name') : (
- ),
- (TEXTNS,u'text-input') : (
- ),
- (TEXTNS,u'time') : (
- ),
- (TEXTNS,u'title') : (
- ),
- (TEXTNS,u'toc-mark') : (
- ),
- (TEXTNS,u'toc-mark-end') : (
- ),
- (TEXTNS,u'toc-mark-start') : (
- ),
-# allowed_children
- (TEXTNS,u'tracked-changes') : (
- (TEXTNS,u'changed-region'),
- ),
- (TEXTNS,u'user-defined') : (
- ),
- (TEXTNS,u'user-field-decl') : (
- ),
- (TEXTNS,u'user-field-decls') : (
- (TEXTNS,u'user-field-decl'),
- ),
- (TEXTNS,u'user-field-get') : (
- ),
- (TEXTNS,u'user-field-input') : (
- ),
- (TEXTNS,u'user-index') : (
- (TEXTNS,u'index-body'),
- (TEXTNS,u'user-index-source'),
- ),
- (TEXTNS,u'user-index-entry-template') : (
- (TEXTNS,u'index-entry-chapter'),
- (TEXTNS,u'index-entry-page-number'),
- (TEXTNS,u'index-entry-span'),
- (TEXTNS,u'index-entry-tab-stop'),
- (TEXTNS,u'index-entry-text'),
- ),
-# allowed_children
- (TEXTNS,u'user-index-mark') : (
- ),
- (TEXTNS,u'user-index-mark-end') : (
- ),
- (TEXTNS,u'user-index-mark-start') : (
- ),
- (TEXTNS,u'user-index-source') : (
- (TEXTNS,u'index-source-styles'),
- (TEXTNS,u'index-title-template'),
- (TEXTNS,u'user-index-entry-template'),
- ),
- (TEXTNS,u'variable-decl') : (
- ),
- (TEXTNS,u'variable-decls') : (
- (TEXTNS,u'variable-decl'),
- ),
- (TEXTNS,u'variable-get') : (
- ),
- (TEXTNS,u'variable-input') : (
- ),
- (TEXTNS,u'variable-set') : (
- ),
- (TEXTNS,u'word-count') : (
- ),
-}
-
-#
-# List of elements that allows text nodes
-#
-allows_text = (
- (CONFIGNS,u'config-item'),
- (DCNS,u'creator'),
- (DCNS,u'date'),
- (DCNS,u'description'),
- (DCNS,u'language'),
- (DCNS,u'subject'),
- (DCNS,u'title'),
-# Completes Dublin Core start
-# (DCNS,'contributor'),
-# (DCNS,'coverage'),
-# (DCNS,'format'),
-# (DCNS,'identifier'),
-# (DCNS,'publisher'),
-# (DCNS,'relation'),
-# (DCNS,'rights'),
-# (DCNS,'source'),
-# (DCNS,'type'),
-# Completes Dublin Core end
- (FORMNS,u'item'),
- (FORMNS,u'option'),
- (MATHNS,u'math'),
- (METANS,u'creation-date'),
- (METANS,u'date-string'),
- (METANS,u'editing-cycles'),
- (METANS,u'editing-duration'),
-# allows_text
- (METANS,u'generator'),
- (METANS,u'initial-creator'),
- (METANS,u'keyword'),
- (METANS,u'print-date'),
- (METANS,u'printed-by'),
- (METANS,u'user-defined'),
- (NUMBERNS,u'currency-symbol'),
- (NUMBERNS,u'embedded-text'),
- (NUMBERNS,u'text'),
- (OFFICENS,u'binary-data'),
- (OFFICENS,u'script'),
- (PRESENTATIONNS,u'date-time-decl'),
- (PRESENTATIONNS,u'footer-decl'),
- (PRESENTATIONNS,u'header-decl'),
- (SVGNS,u'desc'),
- (SVGNS,u'title'),
- (TABLENS,u'desc'),
- (TABLENS,u'title'),
- (TEXTNS,u'a'),
- (TEXTNS,u'author-initials'),
- (TEXTNS,u'author-name'),
- (TEXTNS,u'bibliography-mark'),
- (TEXTNS,u'bookmark-ref'),
- (TEXTNS,u'chapter'),
- (TEXTNS,u'character-count'),
- (TEXTNS,u'conditional-text'),
- (TEXTNS,u'creation-date'),
- (TEXTNS,u'creation-time'),
- (TEXTNS,u'creator'),
- (TEXTNS,u'database-display'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'database-row-number'),
- (TEXTNS,u'date'),
- (TEXTNS,u'dde-connection'),
- (TEXTNS,u'description'),
- (TEXTNS,u'editing-cycles'),
- (TEXTNS,u'editing-duration'),
- (TEXTNS,u'execute-macro'),
- (TEXTNS,u'expression'),
- (TEXTNS,u'file-name'),
- (TEXTNS,u'h'),
- (TEXTNS,u'hidden-paragraph'),
- (TEXTNS,u'hidden-text'),
- (TEXTNS,u'image-count'),
-# allows_text
- (TEXTNS,u'index-entry-span'),
- (TEXTNS,u'index-title-template'),
- (TEXTNS,u'initial-creator'),
- (TEXTNS,u'keywords'),
- (TEXTNS,u'linenumbering-separator'),
- (TEXTNS,u'measure'),
- (TEXTNS,u'meta'),
- (TEXTNS,u'meta-field'),
- (TEXTNS,u'modification-date'),
- (TEXTNS,u'modification-time'),
- (TEXTNS,u'note-citation'),
- (TEXTNS,u'note-continuation-notice-backward'),
- (TEXTNS,u'note-continuation-notice-forward'),
- (TEXTNS,u'note-ref'),
- (TEXTNS,u'number'),
- (TEXTNS,u'object-count'),
- (TEXTNS,u'p'),
- (TEXTNS,u'page-continuation'),
- (TEXTNS,u'page-count'),
- (TEXTNS,u'page-number'),
- (TEXTNS,u'page-variable-get'),
- (TEXTNS,u'page-variable-set'),
- (TEXTNS,u'paragraph-count'),
- (TEXTNS,u'placeholder'),
- (TEXTNS,u'print-date'),
- (TEXTNS,u'print-time'),
- (TEXTNS,u'printed-by'),
- (TEXTNS,u'reference-ref'),
- (TEXTNS,u'ruby-base'),
- (TEXTNS,u'ruby-text'),
-# allows_text
- (TEXTNS,u'script'),
- (TEXTNS,u'sender-city'),
- (TEXTNS,u'sender-company'),
- (TEXTNS,u'sender-country'),
- (TEXTNS,u'sender-email'),
- (TEXTNS,u'sender-fax'),
- (TEXTNS,u'sender-firstname'),
- (TEXTNS,u'sender-initials'),
- (TEXTNS,u'sender-lastname'),
- (TEXTNS,u'sender-phone-private'),
- (TEXTNS,u'sender-phone-work'),
- (TEXTNS,u'sender-position'),
- (TEXTNS,u'sender-postal-code'),
- (TEXTNS,u'sender-state-or-province'),
- (TEXTNS,u'sender-street'),
- (TEXTNS,u'sender-title'),
- (TEXTNS,u'sequence'),
- (TEXTNS,u'sequence-ref'),
- (TEXTNS,u'sheet-name'),
-# allows_text
- (TEXTNS,u'span'),
- (TEXTNS,u'subject'),
- (TEXTNS,u'table-count'),
- (TEXTNS,u'table-formula'),
- (TEXTNS,u'template-name'),
- (TEXTNS,u'text-input'),
- (TEXTNS,u'time'),
- (TEXTNS,u'title'),
- (TEXTNS,u'user-defined'),
- (TEXTNS,u'user-field-get'),
- (TEXTNS,u'user-field-input'),
- (TEXTNS,u'variable-get'),
- (TEXTNS,u'variable-input'),
- (TEXTNS,u'variable-set'),
- (TEXTNS,u'word-count'),
-)
-
-# Only the elements with at least one required attribute is listed
-
-required_attributes = {
- (ANIMNS,u'animate'): (
- (SMILNS,u'attributeName'),
- ),
- (ANIMNS,u'animateColor'): (
- (SMILNS,u'attributeName'),
- ),
- (ANIMNS,u'animateMotion'): (
- (SMILNS,u'attributeName'),
- ),
- (ANIMNS,u'animateTransform'): (
- (SVGNS,u'type'),
- (SMILNS,u'attributeName'),
- ),
- (ANIMNS,u'command'): (
- (ANIMNS,u'command'),
- ),
- (ANIMNS,u'param'): (
- (ANIMNS,u'name'),
- (ANIMNS,u'value'),
- ),
- (ANIMNS,u'set'): (
- (SMILNS,u'attributeName'),
- ),
-# required_attributes
- (ANIMNS,u'transitionFilter'): (
- (SMILNS,u'type'),
- ),
- (CHARTNS,u'axis'): (
- (CHARTNS,u'dimension'),
- ),
- (CHARTNS,u'chart'): (
- (CHARTNS,u'class'),
- ),
-# required_attributes
- (CHARTNS,u'error-indicator'): (
- (CHARTNS,u'dimension'),
- ),
- (CHARTNS,u'symbol-image'): (
- (XLINKNS,u'href'),
- ),
- (CONFIGNS,u'config-item'): (
- (CONFIGNS,u'type'),
- (CONFIGNS,u'name'),
- ),
- (CONFIGNS,u'config-item-map-indexed'): (
- (CONFIGNS,u'name'),
- ),
- (CONFIGNS,u'config-item-map-named'): (
- (CONFIGNS,u'name'),
- ),
- (CONFIGNS,u'config-item-set'): (
- (CONFIGNS,u'name'),
- ),
-# required_attributes
- (NUMBERNS,u'boolean-style'): (
- (STYLENS,u'name'),
- ),
- (NUMBERNS,u'currency-style'): (
- (STYLENS,u'name'),
- ),
- (NUMBERNS,u'date-style'): (
- (STYLENS,u'name'),
- ),
- (NUMBERNS,u'embedded-text'): (
- (NUMBERNS,u'position'),
- ),
- (NUMBERNS,u'number-style'): (
- (STYLENS,u'name'),
- ),
- (NUMBERNS,u'percentage-style'): (
- (STYLENS,u'name'),
- ),
- (NUMBERNS,u'text-style'): (
- (STYLENS,u'name'),
- ),
- (NUMBERNS,u'time-style'): (
- (STYLENS,u'name'),
- ),
- (DR3DNS,u'extrude'): (
- (SVGNS,u'd'),
- (SVGNS,u'viewBox'),
- ),
- (DR3DNS,u'light'): (
- (DR3DNS,u'direction'),
- ),
- (DR3DNS,u'rotate'): (
- (SVGNS,u'viewBox'),
- (SVGNS,u'd'),
- ),
-# required_attributes
- (DRAWNS,u'a'): (
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (DRAWNS,u'area-circle'): (
- (SVGNS,u'cy'),
- (SVGNS,u'cx'),
- (SVGNS,u'r'),
- ),
- (DRAWNS,u'area-polygon'): (
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (DRAWNS,u'points'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (SVGNS,u'viewBox'),
- ),
- (DRAWNS,u'area-rectangle'): (
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- ),
-# required_attributes
- (DRAWNS,u'connector'): (
- (SVGNS,u'viewBox'),
- ),
- (DRAWNS,u'contour-path'): (
- (DRAWNS,u'recreate-on-edit'),
- (SVGNS,u'viewBox'),
- (SVGNS,u'd'),
- ),
- (DRAWNS,u'contour-polygon'): (
- (DRAWNS,u'points'),
- (DRAWNS,u'recreate-on-edit'),
- (SVGNS,u'viewBox'),
- ),
- (DRAWNS,u'control'): (
- (DRAWNS,u'control'),
- ),
- (DRAWNS,u'fill-image'): (
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (DRAWNS,u'name'),
- ),
- (DRAWNS,u'floating-frame'): (
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (DRAWNS,u'glue-point'): (
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (DRAWNS,u'id'),
- (DRAWNS,u'escape-direction'),
- ),
-# required_attributes
- (DRAWNS,u'gradient'): (
- (DRAWNS,u'style'),
- ),
- (DRAWNS,u'handle'): (
- (DRAWNS,u'handle-position'),
- ),
- (DRAWNS,u'hatch'): (
- (DRAWNS,u'style'),
- (DRAWNS,u'name'),
- ),
- (DRAWNS,u'layer'): (
- (DRAWNS,u'name'),
- ),
- (DRAWNS,u'line'): (
- (SVGNS,u'y1'),
- (SVGNS,u'x2'),
- (SVGNS,u'x1'),
- (SVGNS,u'y2'),
- ),
- (DRAWNS,u'marker'): (
- (SVGNS,u'd'),
- (DRAWNS,u'name'),
- (SVGNS,u'viewBox'),
- ),
- (DRAWNS,u'measure'): (
- (SVGNS,u'y1'),
- (SVGNS,u'x2'),
- (SVGNS,u'x1'),
- (SVGNS,u'y2'),
- ),
- (DRAWNS,u'opacity'): (
- (DRAWNS,u'style'),
- ),
- (DRAWNS,u'page'): (
- (DRAWNS,u'master-page-name'),
- ),
- (DRAWNS,u'path'): (
- (SVGNS,u'd'),
- (SVGNS,u'viewBox'),
- ),
- (DRAWNS,u'plugin'): (
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (DRAWNS,u'polygon'): (
- (DRAWNS,u'points'),
- (SVGNS,u'viewBox'),
- ),
-# required_attributes
- (DRAWNS,u'polyline'): (
- (DRAWNS,u'points'),
- (SVGNS,u'viewBox'),
- ),
- (DRAWNS,u'regular-polygon'): (
- (DRAWNS,u'corners'),
- ),
- (DRAWNS,u'stroke-dash'): (
- (DRAWNS,u'name'),
- ),
- (FORMNS,u'button'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'checkbox'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'combobox'): (
- (XMLNS,u'id'),
- ),
-# required_attributes
- (FORMNS,u'connection-resource'): (
- (XLINKNS,u'href'),
- ),
- (FORMNS,u'date'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'file'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'fixed-text'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'formatted-text'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'frame'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'generic-control'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'grid'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'hidden'): (
- (XMLNS,u'id'),
- ),
-# required_attributes
- (FORMNS,u'image'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'image-frame'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'list-property'): (
- (FORMNS,u'property-name'),
- ),
- (FORMNS,u'list-value'): (
- (OFFICENS,u'string-value'),
- ),
- (FORMNS,u'listbox'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'number'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'password'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'property'): (
- (FORMNS,u'property-name'),
- ),
- (FORMNS,u'radio'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'text'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'textarea'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'time'): (
- (XMLNS,u'id'),
- ),
- (FORMNS,u'value-range'): (
- (XMLNS,u'id'),
- ),
- (MANIFESTNS,u'algorithm') : (
- (MANIFESTNS,u'algorithm-name'),
- (MANIFESTNS,u'initialisation-vector'),
- ),
- (MANIFESTNS,u'encryption-data') : (
- (MANIFESTNS,u'checksum-type'),
- (MANIFESTNS,u'checksum'),
- ),
- (MANIFESTNS,u'file-entry') : (
- (MANIFESTNS,u'full-path'),
- (MANIFESTNS,u'media-type'),
- ),
- (MANIFESTNS,u'key-derivation') : (
- (MANIFESTNS,u'key-derivation-name'),
- (MANIFESTNS,u'salt'),
- (MANIFESTNS,u'iteration-count'),
- ),
-# required_attributes
- (METANS,u'template'): (
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (METANS,u'user-defined'): (
- (METANS,u'name'),
- ),
-# required_attributes
- (OFFICENS,u'annotation-end'): (
- (OFFICENS,u'name'),
- ),
- (OFFICENS,u'dde-source'): (
- (OFFICENS,u'dde-topic'),
- (OFFICENS,u'dde-application'),
- (OFFICENS,u'dde-item'),
- ),
- (OFFICENS,u'document'): (
- (OFFICENS,u'mimetype'),
- (OFFICENS,u'version'),
- ),
-# required_attributes
- (OFFICENS,u'document-content'): (
- (OFFICENS,u'version'),
- ),
-# required_attributes
- (OFFICENS,u'document-meta'): (
- (OFFICENS,u'version'),
- ),
-# required_attributes
- (OFFICENS,u'document-settings'): (
- (OFFICENS,u'version'),
- ),
-# required_attributes
- (OFFICENS,u'document-styles'): (
- (OFFICENS,u'version'),
- ),
- (OFFICENS,u'script'): (
- (SCRIPTNS,u'language'),
- ),
- (PRESENTATIONNS,u'date-time-decl'): (
- (PRESENTATIONNS,u'source'),
- (PRESENTATIONNS,u'name'),
- ),
- (PRESENTATIONNS,u'dim'): (
- (DRAWNS,u'color'),
- (DRAWNS,u'shape-id'),
- ),
-# required_attributes
- (PRESENTATIONNS,u'event-listener'): (
- (PRESENTATIONNS,u'action'),
- (SCRIPTNS,u'event-name'),
- ),
- (PRESENTATIONNS,u'footer-decl'): (
- (PRESENTATIONNS,u'name'),
- ),
- (PRESENTATIONNS,u'header-decl'): (
- (PRESENTATIONNS,u'name'),
- ),
- (PRESENTATIONNS,u'hide-shape'): (
- (DRAWNS,u'shape-id'),
- ),
- (PRESENTATIONNS,u'hide-text'): (
- (DRAWNS,u'shape-id'),
- ),
- (PRESENTATIONNS,u'placeholder'): (
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (SVGNS,u'height'),
- (PRESENTATIONNS,u'object'),
- (SVGNS,u'width'),
- ),
- (PRESENTATIONNS,u'play'): (
- (DRAWNS,u'shape-id'),
- ),
- (PRESENTATIONNS,u'show'): (
- (PRESENTATIONNS,u'name'),
- (PRESENTATIONNS,u'pages'),
- ),
- (PRESENTATIONNS,u'show-shape'): (
- (DRAWNS,u'shape-id'),
- ),
- (PRESENTATIONNS,u'show-text'): (
- (DRAWNS,u'shape-id'),
- ),
- (PRESENTATIONNS,u'sound'): (
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (SCRIPTNS,u'event-listener'): (
- (SCRIPTNS,u'language'),
- (SCRIPTNS,u'event-name'),
- ),
- (STYLENS,u'column'): (
- (STYLENS,u'rel-width'),
- ),
-# required_attributes
- (STYLENS,u'column-sep'): (
- (STYLENS,u'width'),
- ),
- (STYLENS,u'columns'): (
- (FONS,u'column-count'),
- ),
- (STYLENS,u'font-face'): (
- (STYLENS,u'name'),
- ),
- (STYLENS,u'handout-master'): (
- (STYLENS,u'page-layout-name'),
- ),
- (STYLENS,u'map'): (
- (STYLENS,u'apply-style-name'),
- (STYLENS,u'condition'),
- ),
-# required_attributes
- (STYLENS,u'list-level-label-alignment'): (
- (TEXTNS,u'label-followed-by'),
- ),
- (STYLENS,u'master-page'): (
- (STYLENS,u'page-layout-name'),
- (STYLENS,u'name'),
- ),
- (STYLENS,u'page-layout'): (
- (STYLENS,u'name'),
- ),
- (STYLENS,u'presentation-page-layout'): (
- (STYLENS,u'name'),
- ),
- (STYLENS,u'style'): (
- (STYLENS,u'name'),
- ),
- (STYLENS,u'tab-stop'): (
- (STYLENS,u'position'),
- ),
- (SVGNS,u'definition-src'): (
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (SVGNS,u'font-face-uri'): (
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (SVGNS,u'linearGradient'): (
- (DRAWNS,u'name'),
- ),
- (SVGNS,u'radialGradient'): (
- (DRAWNS,u'name'),
- ),
- (SVGNS,u'stop'): (
- (SVGNS,u'offset'),
- ),
-# required_attributes
- (TABLENS,u'background'): (
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'body'): (
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'cell-address'): (
- (TABLENS,u'column'),
- (TABLENS,u'table'),
- (TABLENS,u'row'),
- ),
- (TABLENS,u'cell-content-change'): (
- (TABLENS,u'id'),
- ),
- (TABLENS,u'cell-range-source'): (
- (TABLENS,u'last-row-spanned'),
- (TABLENS,u'last-column-spanned'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (TABLENS,u'name'),
- ),
- (TABLENS,u'consolidation'): (
- (TABLENS,u'function'),
- (TABLENS,u'source-cell-range-addresses'),
- (TABLENS,u'target-cell-address'),
- ),
- (TABLENS,u'content-validation'): (
- (TABLENS,u'name'),
- ),
- (TABLENS,u'data-pilot-display-info'): (
- (TABLENS,u'member-count'),
- (TABLENS,u'data-field'),
- (TABLENS,u'enabled'),
- (TABLENS,u'display-member-mode'),
- ),
-# required_attributes
- (TABLENS,u'data-pilot-field'): (
- (TABLENS,u'source-field-name'),
- ),
- (TABLENS,u'data-pilot-field-reference'): (
- (TABLENS,u'field-name'),
- (TABLENS,u'type'),
- ),
- (TABLENS,u'data-pilot-group'): (
- (TABLENS,u'name'),
- ),
- (TABLENS,u'data-pilot-group-member'): (
- (TABLENS,u'name'),
- ),
- (TABLENS,u'data-pilot-groups'): (
- (TABLENS,u'source-field-name'),
- (TABLENS,u'step'),
- (TABLENS,u'grouped-by'),
- ),
- (TABLENS,u'data-pilot-layout-info'): (
- (TABLENS,u'add-empty-lines'),
- (TABLENS,u'layout-mode'),
- ),
- (TABLENS,u'data-pilot-member'): (
- (TABLENS,u'name'),
- ),
- (TABLENS,u'data-pilot-sort-info'): (
- (TABLENS,u'order'),
- ),
- (TABLENS,u'data-pilot-subtotal'): (
- (TABLENS,u'function'),
- ),
- (TABLENS,u'data-pilot-table'): (
- (TABLENS,u'target-range-address'),
- (TABLENS,u'name'),
- ),
- (TABLENS,u'database-range'): (
- (TABLENS,u'target-range-address'),
- ),
-# required_attributes
- (TABLENS,u'database-source-query'): (
- (TABLENS,u'query-name'),
- (TABLENS,u'database-name'),
- ),
- (TABLENS,u'database-source-sql'): (
- (TABLENS,u'database-name'),
- (TABLENS,u'sql-statement'),
- ),
- (TABLENS,u'database-source-table'): (
- (TABLENS,u'database-table-name'),
- (TABLENS,u'database-name'),
- ),
- (TABLENS,u'deletion'): (
- (TABLENS,u'position'),
- (TABLENS,u'type'),
- (TABLENS,u'id'),
- ),
- (TABLENS,u'dependency'): (
- (TABLENS,u'id'),
- ),
-# required_attributes
- (TABLENS,u'even-columns'): (
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'even-rows'): (
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'filter-condition'): (
- (TABLENS,u'operator'),
- (TABLENS,u'field-number'),
- (TABLENS,u'value'),
- ),
-# required_attributes
- (TABLENS,u'filter-set-item'): (
- (TABLENS,u'value'),
- ),
- (TABLENS,u'first-column'): (
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'first-row'): (
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'insertion'): (
- (TABLENS,u'position'),
- (TABLENS,u'type'),
- (TABLENS,u'id'),
- ),
- (TABLENS,u'insertion-cut-off'): (
- (TABLENS,u'position'),
- (TABLENS,u'id'),
- ),
-# required_attributes
- (TABLENS,u'label-range'): (
- (TABLENS,u'label-cell-range-address'),
- (TABLENS,u'data-cell-range-address'),
- (TABLENS,u'orientation'),
- ),
- (TABLENS,u'last-column'): (
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'last-row'): (
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'movement'): (
- (TABLENS,u'id'),
- ),
- (TABLENS,u'named-expression'): (
- (TABLENS,u'expression'),
- (TABLENS,u'name'),
- ),
- (TABLENS,u'named-range'): (
- (TABLENS,u'name'),
- (TABLENS,u'cell-range-address'),
- ),
- (TABLENS,u'odd-columns'): (
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'odd-rows'): (
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'operation'): (
- (TABLENS,u'index'),
- (TABLENS,u'name'),
- ),
-# required_attributes
- (TABLENS,u'scenario'): (
- (TABLENS,u'is-active'),
- (TABLENS,u'scenario-ranges'),
- ),
- (TABLENS,u'sort-by'): (
- (TABLENS,u'field-number'),
- ),
- (TABLENS,u'source-cell-range'): (
- (TABLENS,u'cell-range-address'),
- ),
- (TABLENS,u'source-service'): (
- (TABLENS,u'source-name'),
- (TABLENS,u'object-name'),
- (TABLENS,u'name'),
- ),
- (TABLENS,u'subtotal-field'): (
- (TABLENS,u'function'),
- (TABLENS,u'field-number'),
- ),
- (TABLENS,u'subtotal-rule'): (
- (TABLENS,u'group-by-field-number'),
- ),
- (TABLENS,u'table-source'): (
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (TABLENS,u'table-template'): (
-# (TABLENS,u'last-row-end-column'), # Deprecated
-# (TABLENS,u'first-row-end-column'), # Deprecated
- (TABLENS,u'name'),
-# (TABLENS,u'last-row-start-column'), # Deprecated
-# (TABLENS,u'first-row-start-column'), # Deprecated
- ),
- (TEXTNS,u'a'): (
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
-# required_attributes
- (TEXTNS,u'alphabetical-index'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'alphabetical-index-auto-mark-file'): (
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (TEXTNS,u'alphabetical-index-entry-template'): (
- (TEXTNS,u'style-name'),
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'alphabetical-index-mark'): (
- (TEXTNS,u'string-value'),
- ),
- (TEXTNS,u'alphabetical-index-mark-end'): (
- (TEXTNS,u'id'),
- ),
- (TEXTNS,u'alphabetical-index-mark-start'): (
- (TEXTNS,u'id'),
- ),
- (TEXTNS,u'bibliography'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'bibliography-entry-template'): (
- (TEXTNS,u'style-name'),
- (TEXTNS,u'bibliography-type'),
- ),
- (TEXTNS,u'bibliography-mark'): (
- (TEXTNS,u'bibliography-type'),
- ),
- (TEXTNS,u'bookmark'): (
- (TEXTNS,u'name'),
- ),
-# required_attributes
- (TEXTNS,u'bookmark-end'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'bookmark-start'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'change'): (
- (TEXTNS,u'change-id'),
- ),
- (TEXTNS,u'change-end'): (
- (TEXTNS,u'change-id'),
- ),
- (TEXTNS,u'change-start'): (
- (TEXTNS,u'change-id'),
- ),
- (TEXTNS,u'changed-region'): (
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'chapter'): (
- (TEXTNS,u'display'),
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'conditional-text'): (
- (TEXTNS,u'string-value-if-true'),
- (TEXTNS,u'string-value-if-false'),
- (TEXTNS,u'condition'),
- ),
- (TEXTNS,u'database-display'): (
- (TEXTNS,u'column-name'),
- (TEXTNS,u'table-name'),
- ),
- (TEXTNS,u'database-name'): (
- (TEXTNS,u'table-name'),
- ),
- (TEXTNS,u'database-next'): (
- (TEXTNS,u'table-name'),
- ),
- (TEXTNS,u'database-row-number'): (
- (TEXTNS,u'table-name'),
- ),
- (TEXTNS,u'database-row-select'): (
- (TEXTNS,u'table-name'),
- ),
- (TEXTNS,u'dde-connection'): (
- (TEXTNS,u'connection-name'),
- ),
-# required_attributes
- (TEXTNS,u'dde-connection-decl'): (
- (OFFICENS,u'dde-topic'),
- (OFFICENS,u'dde-application'),
- (OFFICENS,u'name'),
- (OFFICENS,u'dde-item'),
- ),
- (TEXTNS,u'h'): (
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'hidden-paragraph'): (
- (TEXTNS,u'condition'),
- ),
- (TEXTNS,u'hidden-text'): (
- (TEXTNS,u'string-value'),
- (TEXTNS,u'condition'),
- ),
- (TEXTNS,u'illustration-index'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'illustration-index-entry-template'): (
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'index-entry-bibliography'): (
- (TEXTNS,u'bibliography-data-field'),
- ),
- (TEXTNS,u'index-source-style'): (
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'index-source-styles'): (
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'index-title'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'list-level-style-bullet'): (
- (TEXTNS,u'bullet-char'),
- (TEXTNS,u'level'),
- ),
- (TEXTNS,u'list-level-style-image'): (
- (TEXTNS,u'level'),
- ),
- (TEXTNS,u'list-level-style-number'): (
- (TEXTNS,u'level'),
- ),
- (TEXTNS,u'list-style'): (
- (STYLENS,u'name'),
- ),
- (TEXTNS,u'meta-field'): (
- (XMLNS,u'id'),
- ),
-# required_attributes
- (TEXTNS,u'measure'): (
- (TEXTNS,u'kind'),
- ),
- (TEXTNS,u'note'): (
- (TEXTNS,u'note-class'),
- ),
- (TEXTNS,u'note-ref'): (
- (TEXTNS,u'note-class'),
- ),
- (TEXTNS,u'notes-configuration'): (
- (TEXTNS,u'note-class'),
- ),
-# required_attributes
- (TEXTNS,u'numbered-paragraph'): (
- (TEXTNS,u'list-id'),
- ),
- (TEXTNS,u'object-index'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'object-index-entry-template'): (
- (TEXTNS,u'style-name'),
- ),
-# required_attributes
- (TEXTNS,u'outline-style'): (
- (STYLENS,u'name'),
- ),
- (TEXTNS,u'outline-level-style'): (
- (TEXTNS,u'level'),
- ),
- (TEXTNS,u'page'): (
- (TEXTNS,u'master-page-name'),
- ),
- (TEXTNS,u'page-continuation'): (
- (TEXTNS,u'select-page'),
- ),
- (TEXTNS,u'placeholder'): (
- (TEXTNS,u'placeholder-type'),
- ),
- (TEXTNS,u'reference-mark'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'reference-mark-end'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'reference-mark-start'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'section'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'sequence'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'sequence-decl'): (
- (TEXTNS,u'display-outline-level'),
- (TEXTNS,u'name'),
- ),
-# required_attributes
- (TEXTNS,u'sort-key'): (
- (TEXTNS,u'key'),
- ),
- (TEXTNS,u'table-index'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'table-index-entry-template'): (
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'table-of-content'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'table-of-content-entry-template'): (
- (TEXTNS,u'style-name'),
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'toc-mark'): (
- (TEXTNS,u'string-value'),
- ),
- (TEXTNS,u'toc-mark-end'): (
- (TEXTNS,u'id'),
- ),
- (TEXTNS,u'toc-mark-start'): (
- (TEXTNS,u'id'),
- ),
- (TEXTNS,u'user-defined'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'user-field-decl'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'user-field-get'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'user-field-input'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'user-index'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'user-index-entry-template'): (
- (TEXTNS,u'style-name'),
- (TEXTNS,u'outline-level'),
- ),
-# required_attributes
- (TEXTNS,u'user-index-mark'): (
- (TEXTNS,u'index-name'),
- (TEXTNS,u'string-value'),
- ),
- (TEXTNS,u'user-index-mark-end'): (
- (TEXTNS,u'id'),
- ),
- (TEXTNS,u'user-index-mark-start'): (
- (TEXTNS,u'index-name'),
- (TEXTNS,u'id'),
- ),
- (TEXTNS,u'user-index-source'): (
- (TEXTNS,u'index-name'),
- ),
- (TEXTNS,u'variable-decl'): (
- (TEXTNS,u'name'),
- (OFFICENS,u'value-type'),
- ),
- (TEXTNS,u'variable-get'): (
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'variable-input'): (
- (TEXTNS,u'name'),
- (OFFICENS,u'value-type'),
- ),
- (TEXTNS,u'variable-set'): (
- (TEXTNS,u'name'),
- ),
-}
-
-# Empty list means the element has no allowed attributes
-# None means anything goes
-
-allowed_attributes = {
- (DCNS,u'creator'):(
- ),
- (DCNS,u'date'):(
- ),
- (DCNS,u'description'):(
- ),
- (DCNS,u'language'):(
- ),
- (DCNS,u'subject'):(
- ),
- (DCNS,u'title'):(
- ),
-# Completes Dublin Core start
-# (DCNS,'contributor') : (
-# ),
-# (DCNS,'coverage') : (
-# ),
-# (DCNS,'format') : (
-# ),
-# (DCNS,'identifier') : (
-# ),
-# (DCNS,'publisher') : (
-# ),
-# (DCNS,'relation') : (
-# ),
-# (DCNS,'rights') : (
-# ),
-# (DCNS,'source') : (
-# ),
-# (DCNS,'type') : (
-# ),
-# Completes Dublin Core end
- (MATHNS,u'math'): None,
- (XFORMSNS,u'model'): None,
-# allowed_attributes
- (ANIMNS,u'animate'):(
- (ANIMNS,u'formula'),
- (ANIMNS,u'sub-item'),
- (SMILNS,u'accelerate'),
- (SMILNS,u'accumulate'),
- (SMILNS,u'additive'),
- (SMILNS,u'attributeName'),
- (SMILNS,u'autoReverse'),
- (SMILNS,u'begin'),
- (SMILNS,u'by'),
- (SMILNS,u'calcMode'),
- (SMILNS,u'decelerate'),
- (SMILNS,u'dur'),
- (SMILNS,u'end'),
- (SMILNS,u'fill'),
- (SMILNS,u'fillDefault'),
- (SMILNS,u'from'),
- (SMILNS,u'keySplines'),
- (SMILNS,u'keyTimes'),
- (SMILNS,u'repeatCount'),
- (SMILNS,u'repeatDur'),
- (SMILNS,u'restart'),
- (SMILNS,u'restartDefault'),
- (SMILNS,u'targetElement'),
- (SMILNS,u'to'),
- (SMILNS,u'values'),
- ),
-# allowed_attributes
- (ANIMNS,u'animateColor'):(
- (ANIMNS,u'color-interpolation'),
- (ANIMNS,u'color-interpolation-direction'),
- (ANIMNS,u'formula'),
- (ANIMNS,u'sub-item'),
- (SMILNS,u'accelerate'),
- (SMILNS,u'accumulate'),
- (SMILNS,u'additive'),
- (SMILNS,u'attributeName'),
- (SMILNS,u'autoReverse'),
- (SMILNS,u'begin'),
- (SMILNS,u'by'),
- (SMILNS,u'calcMode'),
- (SMILNS,u'decelerate'),
- (SMILNS,u'dur'),
- (SMILNS,u'end'),
- (SMILNS,u'fill'),
- (SMILNS,u'fillDefault'),
- (SMILNS,u'from'),
- (SMILNS,u'keySplines'),
- (SMILNS,u'keyTimes'),
- (SMILNS,u'repeatCount'),
- (SMILNS,u'repeatDur'),
- (SMILNS,u'restart'),
- (SMILNS,u'restartDefault'),
- (SMILNS,u'targetElement'),
- (SMILNS,u'to'),
- (SMILNS,u'values'),
- ),
-# allowed_attributes
- (ANIMNS,u'animateMotion'):(
- (ANIMNS,u'formula'),
- (ANIMNS,u'sub-item'),
- (SMILNS,u'accelerate'),
- (SMILNS,u'accumulate'),
- (SMILNS,u'additive'),
- (SMILNS,u'attributeName'),
- (SMILNS,u'autoReverse'),
- (SMILNS,u'begin'),
- (SMILNS,u'by'),
- (SMILNS,u'calcMode'),
- (SMILNS,u'decelerate'),
- (SMILNS,u'dur'),
- (SMILNS,u'end'),
- (SMILNS,u'fill'),
- (SMILNS,u'fillDefault'),
- (SMILNS,u'from'),
- (SMILNS,u'keySplines'),
- (SMILNS,u'keyTimes'),
- (SMILNS,u'repeatCount'),
- (SMILNS,u'repeatDur'),
- (SMILNS,u'restart'),
- (SMILNS,u'restartDefault'),
- (SMILNS,u'targetElement'),
- (SMILNS,u'to'),
- (SMILNS,u'values'),
- (SVGNS,u'origin'),
- (SVGNS,u'path'),
- ),
-# allowed_attributes
- (ANIMNS,u'animateTransform'):(
- (ANIMNS,u'formula'),
- (ANIMNS,u'sub-item'),
- (SMILNS,u'accelerate'),
- (SMILNS,u'accumulate'),
- (SMILNS,u'additive'),
- (SMILNS,u'attributeName'),
- (SMILNS,u'autoReverse'),
- (SMILNS,u'begin'),
- (SMILNS,u'by'),
- (SMILNS,u'decelerate'),
- (SMILNS,u'dur'),
- (SMILNS,u'end'),
- (SMILNS,u'fill'),
- (SMILNS,u'fillDefault'),
- (SMILNS,u'from'),
- (SMILNS,u'repeatCount'),
- (SMILNS,u'repeatDur'),
- (SMILNS,u'restart'),
- (SMILNS,u'restartDefault'),
- (SMILNS,u'targetElement'),
- (SMILNS,u'to'),
- (SMILNS,u'values'),
- (SVGNS,u'type'),
- ),
-# allowed_attributes
- (ANIMNS,u'audio'):(
- (ANIMNS,u'audio-level'),
- (ANIMNS,u'id'),
- (PRESENTATIONNS,u'group-id'),
- (PRESENTATIONNS,u'master-element'),
- (PRESENTATIONNS,u'node-type'),
- (PRESENTATIONNS,u'preset-class'),
- (PRESENTATIONNS,u'preset-id'),
- (PRESENTATIONNS,u'preset-sub-type'),
- (SMILNS,u'begin'),
- (SMILNS,u'dur'),
- (SMILNS,u'end'),
- (SMILNS,u'fill'),
- (SMILNS,u'fillDefault'),
- (SMILNS,u'repeatCount'),
- (SMILNS,u'repeatDur'),
- (SMILNS,u'restart'),
- (SMILNS,u'restartDefault'),
- (XLINKNS,u'href'),
- (XMLNS,u'id'),
- ),
- (ANIMNS,u'command'):(
- (PRESENTATIONNS,u'node-type'),
- (SMILNS,u'begin'),
- (SMILNS,u'end'),
- (PRESENTATIONNS,u'group-id'),
- (PRESENTATIONNS,u'preset-class'),
- (PRESENTATIONNS,u'preset-id'),
- (ANIMNS,u'sub-item'),
- (ANIMNS,u'command'),
- (PRESENTATIONNS,u'preset-sub-type'),
- (SMILNS,u'targetElement'),
- (ANIMNS,u'id'),
- (PRESENTATIONNS,u'master-element'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (ANIMNS,u'iterate'):(
- (ANIMNS,u'id'),
- (ANIMNS,u'iterate-interval'),
- (ANIMNS,u'iterate-type'),
- (ANIMNS,u'sub-item'),
- (PRESENTATIONNS,u'group-id'),
- (PRESENTATIONNS,u'master-element'),
- (PRESENTATIONNS,u'node-type'),
- (PRESENTATIONNS,u'preset-class'),
- (PRESENTATIONNS,u'preset-id'),
- (PRESENTATIONNS,u'preset-sub-type'),
- (SMILNS,u'accelerate'),
- (SMILNS,u'autoReverse'),
- (SMILNS,u'begin'),
- (SMILNS,u'decelerate'),
- (SMILNS,u'dur'),
- (SMILNS,u'end'),
- (SMILNS,u'endsync'),
- (SMILNS,u'fill'),
- (SMILNS,u'fillDefault'),
- (SMILNS,u'repeatCount'),
- (SMILNS,u'repeatDur'),
- (SMILNS,u'restart'),
- (SMILNS,u'restartDefault'),
- (SMILNS,u'targetElement'),
- (XMLNS,u'id'),
- ),
- (ANIMNS,u'par'):(
- (PRESENTATIONNS,u'node-type'),
- (SMILNS,u'decelerate'),
- (SMILNS,u'begin'),
- (SMILNS,u'end'),
- (PRESENTATIONNS,u'group-id'),
- (SMILNS,u'accelerate'),
- (SMILNS,u'repeatDur'),
- (SMILNS,u'repeatCount'),
- (SMILNS,u'autoReverse'),
- (PRESENTATIONNS,u'preset-class'),
- (SMILNS,u'fillDefault'),
- (PRESENTATIONNS,u'preset-id'),
- (PRESENTATIONNS,u'preset-sub-type'),
- (SMILNS,u'restartDefault'),
- (SMILNS,u'endsync'),
- (SMILNS,u'dur'),
- (SMILNS,u'fill'),
- (ANIMNS,u'id'),
- (SMILNS,u'restart'),
- (PRESENTATIONNS,u'master-element'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (ANIMNS,u'param'):(
- (ANIMNS,u'name'),
- (ANIMNS,u'value'),
- ),
- (ANIMNS,u'seq'):(
- (ANIMNS,u'id'),
- (PRESENTATIONNS,u'group-id'),
- (PRESENTATIONNS,u'master-element'),
- (PRESENTATIONNS,u'node-type'),
- (PRESENTATIONNS,u'preset-class'),
- (PRESENTATIONNS,u'preset-id'),
- (PRESENTATIONNS,u'preset-sub-type'),
- (SMILNS,u'accelerate'),
- (SMILNS,u'autoReverse'),
- (SMILNS,u'begin'),
- (SMILNS,u'decelerate'),
- (SMILNS,u'dur'),
- (SMILNS,u'end'),
- (SMILNS,u'endsync'),
- (SMILNS,u'fill'),
- (SMILNS,u'fillDefault'),
- (SMILNS,u'repeatCount'),
- (SMILNS,u'repeatDur'),
- (SMILNS,u'restart'),
- (SMILNS,u'restartDefault'),
- (XMLNS,u'id'),
- ),
- (ANIMNS,u'set'):(
- (ANIMNS,u'sub-item'),
- (SMILNS,u'accelerate'),
- (SMILNS,u'accumulate'),
- (SMILNS,u'autoReverse'),
- (SMILNS,u'additive'),
- (SMILNS,u'attributeName'),
- (SMILNS,u'begin'),
- (SMILNS,u'decelerate'),
- (SMILNS,u'dur'),
- (SMILNS,u'end'),
- (SMILNS,u'fill'),
- (SMILNS,u'fillDefault'),
- (SMILNS,u'repeatCount'),
- (SMILNS,u'repeatDur'),
- (SMILNS,u'restart'),
- (SMILNS,u'restartDefault'),
- (SMILNS,u'targetElement'),
- (SMILNS,u'to'),
-
- ),
-# allowed_attributes
- (ANIMNS,u'transitionFilter'):(
- (ANIMNS,u'formula'),
- (ANIMNS,u'sub-item'),
- (SMILNS,u'accelerate'),
- (SMILNS,u'accumulate'),
- (SMILNS,u'additive'),
- (SMILNS,u'autoReverse'),
- (SMILNS,u'begin'),
- (SMILNS,u'by'),
- (SMILNS,u'calcMode'),
- (SMILNS,u'decelerate'),
- (SMILNS,u'direction'),
- (SMILNS,u'dur'),
- (SMILNS,u'end'),
- (SMILNS,u'fadeColor'),
- (SMILNS,u'fill'),
- (SMILNS,u'fillDefault'),
- (SMILNS,u'from'),
- (SMILNS,u'mode'),
- (SMILNS,u'repeatCount'),
- (SMILNS,u'repeatDur'),
- (SMILNS,u'restart'),
- (SMILNS,u'restartDefault'),
- (SMILNS,u'subtype'),
- (SMILNS,u'targetElement'),
- (SMILNS,u'to'),
- (SMILNS,u'type'),
- (SMILNS,u'values'),
-
- ),
-# allowed_attributes
- (CHARTNS,u'axis'):(
- (CHARTNS,u'style-name'),
- (CHARTNS,u'dimension'),
- (CHARTNS,u'name'),
- ),
- (CHARTNS,u'categories'):(
- (TABLENS,u'cell-range-address'),
- ),
- (CHARTNS,u'chart'):(
- (CHARTNS,u'class'),
- (CHARTNS,u'column-mapping'),
- (CHARTNS,u'row-mapping'),
- (CHARTNS,u'style-name'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (XMLNS,u'id'),
- ),
- (CHARTNS,u'data-label'):(
- (CHARTNS,u'style-name'),
- (SVGNS,u'x'),
- (SVGNS,u'y'),
- ),
- (CHARTNS,u'data-point'):(
- (CHARTNS,u'repeated'),
- (CHARTNS,u'style-name'),
- (XMLNS,u'id'),
- ),
- (CHARTNS,u'domain'):(
- (TABLENS,u'cell-range-address'),
- ),
-# allowed_attributes
- (CHARTNS,u'equation'):(
- (CHARTNS,u'automatic-content'),
- (CHARTNS,u'display-equation'),
- (CHARTNS,u'display-r-square'),
- (CHARTNS,u'style-name'),
- (SVGNS,u'x'),
- (SVGNS,u'y'),
- ),
- (CHARTNS,u'error-indicator'):(
- (CHARTNS,u'dimension'),
- (CHARTNS,u'style-name'),
- ),
- (CHARTNS,u'floor'):(
- (SVGNS,u'width'),
- (CHARTNS,u'style-name'),
- ),
-# allowed_attributes
- (CHARTNS,u'footer'):(
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (TABLENS,u'cell-range'),
- (CHARTNS,u'style-name'),
- ),
- (CHARTNS,u'grid'):(
- (CHARTNS,u'style-name'),
- (CHARTNS,u'class'),
- ),
-# allowed_attributes
- (CHARTNS,u'label-separator'):(
- ),
- (CHARTNS,u'legend'):(
- (CHARTNS,u'legend-align'),
- (STYLENS,u'legend-expansion-aspect-ratio'),
- (STYLENS,u'legend-expansion'),
- (CHARTNS,u'legend-position'),
- (CHARTNS,u'style-name'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- ),
- (CHARTNS,u'mean-value'):(
- (CHARTNS,u'style-name'),
- ),
- (CHARTNS,u'plot-area'):(
- (CHARTNS,u'data-source-has-labels'),
- (CHARTNS,u'style-name'),
- (DR3DNS,u'ambient-color'),
- (DR3DNS,u'distance'),
- (DR3DNS,u'focal-length'),
- (DR3DNS,u'lighting-mode'),
- (DR3DNS,u'projection'),
- (DR3DNS,u'shade-mode'),
- (DR3DNS,u'shadow-slant'),
- (DR3DNS,u'transform'),
- (DR3DNS,u'vpn'),
- (DR3DNS,u'vrp'),
- (DR3DNS,u'vup'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (SVGNS,u'x'),
- (SVGNS,u'y'),
- (TABLENS,u'cell-range-address'),
- (XMLNS,u'id'),
- ),
- (CHARTNS,u'regression-curve'):(
- (CHARTNS,u'style-name'),
- ),
- (CHARTNS,u'series'):(
- (CHARTNS,u'style-name'),
- (CHARTNS,u'attached-axis'),
- (CHARTNS,u'values-cell-range-address'),
- (CHARTNS,u'label-cell-address'),
- (CHARTNS,u'class'),
- (XMLNS,u'id'),
- ),
- (CHARTNS,u'stock-gain-marker'):(
- (CHARTNS,u'style-name'),
- ),
-# allowed_attributes
- (CHARTNS,u'stock-loss-marker'):(
- (CHARTNS,u'style-name'),
- ),
- (CHARTNS,u'stock-range-line'):(
- (CHARTNS,u'style-name'),
- ),
- (CHARTNS,u'subtitle'):(
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (TABLENS,u'cell-range'),
- (CHARTNS,u'style-name'),
- ),
- (CHARTNS,u'symbol-image'):(
- (XLINKNS,u'href'),
- ),
- (CHARTNS,u'title'):(
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (TABLENS,u'cell-range'),
- (CHARTNS,u'style-name'),
- ),
- (CHARTNS,u'wall'):(
- (SVGNS,u'width'),
- (CHARTNS,u'style-name'),
- ),
- (CONFIGNS,u'config-item'):(
- (CONFIGNS,u'type'),
- (CONFIGNS,u'name'),
- ),
- (CONFIGNS,u'config-item-map-entry'):(
- (CONFIGNS,u'name'),
- ),
- (CONFIGNS,u'config-item-map-indexed'):(
- (CONFIGNS,u'name'),
- ),
- (CONFIGNS,u'config-item-map-named'):(
- (CONFIGNS,u'name'),
- ),
- (CONFIGNS,u'config-item-set'):(
- (CONFIGNS,u'name'),
- ),
-# allowed_attributes
- (NUMBERNS,u'am-pm'):(
- ),
- (NUMBERNS,u'boolean'):(
- ),
- (NUMBERNS,u'boolean-style'):(
- (NUMBERNS,u'country'),
- (NUMBERNS,u'language'),
- (NUMBERNS,u'rfc-language-tag'),
- (NUMBERNS,u'script'),
- (NUMBERNS,u'title'),
- (NUMBERNS,u'transliteration-country'),
- (NUMBERNS,u'transliteration-format'),
- (NUMBERNS,u'transliteration-language'),
- (NUMBERNS,u'transliteration-style'),
- (STYLENS,u'display-name'),
- (STYLENS,u'name'),
- (STYLENS,u'volatile'),
- ),
- (NUMBERNS,u'currency-style'):(
- (NUMBERNS,u'rfc-language-tag'),
- (NUMBERNS,u'script'),
- (NUMBERNS,u'automatic-order'),
- (NUMBERNS,u'country'),
- (NUMBERNS,u'language'),
- (NUMBERNS,u'rfc-language-tag'),
- (NUMBERNS,u'script'),
- (NUMBERNS,u'title'),
- (NUMBERNS,u'transliteration-country'),
- (NUMBERNS,u'transliteration-format'),
- (NUMBERNS,u'transliteration-language'),
- (NUMBERNS,u'transliteration-style'),
- (STYLENS,u'display-name'),
- (STYLENS,u'name'),
- (STYLENS,u'volatile'),
- ),
- (NUMBERNS,u'currency-symbol'):(
- (NUMBERNS,u'country'),
- (NUMBERNS,u'language'),
- (NUMBERNS,u'rfc-language-tag'),
- (NUMBERNS,u'script'),
- ),
-# allowed_attributes
- (NUMBERNS,u'date-style'):(
- (NUMBERNS,u'automatic-order'),
- (NUMBERNS,u'country'),
- (NUMBERNS,u'format-source'),
- (NUMBERNS,u'language'),
- (NUMBERNS,u'rfc-language-tag'),
- (NUMBERNS,u'script'),
- (NUMBERNS,u'title'),
- (NUMBERNS,u'transliteration-country'),
- (NUMBERNS,u'transliteration-format'),
- (NUMBERNS,u'transliteration-language'),
- (NUMBERNS,u'transliteration-style'),
- (STYLENS,u'display-name'),
- (STYLENS,u'name'),
- (STYLENS,u'volatile'),
- ),
- (NUMBERNS,u'day'):(
- (NUMBERNS,u'style'),
- (NUMBERNS,u'calendar'),
- ),
- (NUMBERNS,u'day-of-week'):(
- (NUMBERNS,u'style'),
- (NUMBERNS,u'calendar'),
- ),
- (NUMBERNS,u'embedded-text'):(
- (NUMBERNS,u'position'),
- ),
- (NUMBERNS,u'era'):(
- (NUMBERNS,u'style'),
- (NUMBERNS,u'calendar'),
- ),
- (NUMBERNS,u'fraction'):(
- (NUMBERNS,u'grouping'),
- (NUMBERNS,u'min-denominator-digits'),
- (NUMBERNS,u'min-numerator-digits'),
- (NUMBERNS,u'min-integer-digits'),
- (NUMBERNS,u'denominator-value'),
- ),
- (NUMBERNS,u'hours'):(
- (NUMBERNS,u'style'),
- ),
-# allowed_attributes
- (NUMBERNS,u'minutes'):(
- (NUMBERNS,u'style'),
- ),
- (NUMBERNS,u'month'):(
- (NUMBERNS,u'style'),
- (NUMBERNS,u'calendar'),
- (NUMBERNS,u'possessive-form'),
- (NUMBERNS,u'textual'),
- ),
- (NUMBERNS,u'number'):(
- (NUMBERNS,u'display-factor'),
- (NUMBERNS,u'decimal-places'),
- (NUMBERNS,u'decimal-replacement'),
- (NUMBERNS,u'min-integer-digits'),
- (NUMBERNS,u'grouping'),
- ),
- (NUMBERNS,u'number-style'):(
- (NUMBERNS,u'rfc-language-tag'),
- (NUMBERNS,u'script'),
- (NUMBERNS,u'transliteration-language'),
- (STYLENS,u'name'),
- (STYLENS,u'display-name'),
- (NUMBERNS,u'language'),
- (NUMBERNS,u'title'),
- (NUMBERNS,u'country'),
- (NUMBERNS,u'transliteration-format'),
- (NUMBERNS,u'transliteration-style'),
- (STYLENS,u'volatile'),
- (NUMBERNS,u'transliteration-country'),
- ),
-# allowed_attributes
- (NUMBERNS,u'percentage-style'):(
- (NUMBERNS,u'country'),
- (NUMBERNS,u'language'),
- (NUMBERNS,u'rfc-language-tag'),
- (NUMBERNS,u'script'),
- (NUMBERNS,u'title'),
- (NUMBERNS,u'transliteration-country'),
- (NUMBERNS,u'transliteration-format'),
- (NUMBERNS,u'transliteration-language'),
- (NUMBERNS,u'transliteration-style'),
- (STYLENS,u'display-name'),
- (STYLENS,u'name'),
- (STYLENS,u'volatile'),
- ),
- (NUMBERNS,u'quarter'):(
- (NUMBERNS,u'style'),
- (NUMBERNS,u'calendar'),
- ),
- (NUMBERNS,u'scientific-number'):(
- (NUMBERNS,u'min-exponent-digits'),
- (NUMBERNS,u'decimal-places'),
- (NUMBERNS,u'min-integer-digits'),
- (NUMBERNS,u'grouping'),
- ),
- (NUMBERNS,u'seconds'):(
- (NUMBERNS,u'style'),
- (NUMBERNS,u'decimal-places'),
- ),
- (NUMBERNS,u'text'):(
- ),
- (NUMBERNS,u'text-content'):(
- ),
- (NUMBERNS,u'text-style'):(
- (NUMBERNS,u'country'),
- (NUMBERNS,u'language'),
- (NUMBERNS,u'rfc-language-tag'),
- (NUMBERNS,u'script'),
- (NUMBERNS,u'title'),
- (NUMBERNS,u'transliteration-country'),
- (NUMBERNS,u'transliteration-format'),
- (NUMBERNS,u'transliteration-language'),
- (NUMBERNS,u'transliteration-style'),
- (STYLENS,u'display-name'),
- (STYLENS,u'name'),
- (STYLENS,u'volatile'),
- ),
- (NUMBERNS,u'time-style'):(
- (NUMBERNS,u'country'),
- (NUMBERNS,u'format-source'),
- (NUMBERNS,u'language'),
- (NUMBERNS,u'rfc-language-tag'),
- (NUMBERNS,u'script'),
- (NUMBERNS,u'title'),
- (NUMBERNS,u'transliteration-country'),
- (NUMBERNS,u'transliteration-format'),
- (NUMBERNS,u'transliteration-language'),
- (NUMBERNS,u'transliteration-style'),
- (NUMBERNS,u'truncate-on-overflow'),
- (STYLENS,u'display-name'),
- (STYLENS,u'name'),
- (STYLENS,u'volatile'),
- ),
- (NUMBERNS,u'week-of-year'):(
- (NUMBERNS,u'calendar'),
- ),
- (NUMBERNS,u'year'):(
- (NUMBERNS,u'style'),
- (NUMBERNS,u'calendar'),
- ),
- (DR3DNS,u'cube'):(
- (DR3DNS,u'min-edge'),
- (DR3DNS,u'max-edge'),
- (DRAWNS,u'layer'),
- (DR3DNS,u'transform'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (DRAWNS,u'id'),
- (XMLNS,u'id'),
- ),
- (DR3DNS,u'extrude'):(
- (DRAWNS,u'layer'),
- (SVGNS,u'd'),
- (DR3DNS,u'transform'),
- (SVGNS,u'viewBox'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (DRAWNS,u'id'),
- (XMLNS,u'id'),
- ),
- (DR3DNS,u'light'):(
- (DR3DNS,u'diffuse-color'),
- (DR3DNS,u'direction'),
- (DR3DNS,u'specular'),
- (DR3DNS,u'enabled'),
- ),
- (DR3DNS,u'rotate'):(
- (DRAWNS,u'layer'),
- (SVGNS,u'd'),
- (DR3DNS,u'transform'),
- (SVGNS,u'viewBox'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (DRAWNS,u'id'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DR3DNS,u'scene'):(
- (DR3DNS,u'ambient-color'),
- (DR3DNS,u'distance'),
- (DR3DNS,u'focal-length'),
- (DR3DNS,u'lighting-mode'),
- (DR3DNS,u'projection'),
- (DR3DNS,u'shade-mode'),
- (DR3DNS,u'shadow-slant'),
- (DR3DNS,u'transform'),
- (DR3DNS,u'vpn'),
- (DR3DNS,u'vrp'),
- (DR3DNS,u'vup'),
- (DRAWNS,u'id'),
- (DRAWNS,u'caption-id'),
- (DRAWNS,u'layer'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (PRESENTATIONNS,u'style-name'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (SVGNS,u'x'),
- (SVGNS,u'y'),
- (TABLENS,u'end-cell-address'),
- (TABLENS,u'end-x'),
- (TABLENS,u'end-y'),
- (TABLENS,u'table-background'),
- (TEXTNS,u'anchor-page-number'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DR3DNS,u'sphere'):(
- (DRAWNS,u'layer'),
- (DR3DNS,u'center'),
- (DR3DNS,u'transform'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (DRAWNS,u'id'),
- (DR3DNS,u'size'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'a'):(
- (OFFICENS,u'name'),
- (OFFICENS,u'server-map'),
- (OFFICENS,u'target-frame-name'),
- (OFFICENS,u'title'),
- (XLINKNS,u'actuate'),
- (XLINKNS,u'href'),
- (XLINKNS,u'show'),
- (XLINKNS,u'type'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'applet'):(
- (DRAWNS,u'code'),
- (XLINKNS,u'show'),
- (DRAWNS,u'object'),
- (XLINKNS,u'actuate'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (DRAWNS,u'archive'),
- (DRAWNS,u'may-script'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DRAWNS,u'area-circle'):(
- (OFFICENS,u'name'),
- (XLINKNS,u'show'),
- (SVGNS,u'cx'),
- (XLINKNS,u'type'),
- (DRAWNS,u'nohref'),
- (SVGNS,u'cy'),
- (XLINKNS,u'href'),
- (SVGNS,u'r'),
- (OFFICENS,u'target-frame-name'),
- ),
- (DRAWNS,u'area-polygon'):(
- (OFFICENS,u'name'),
- (XLINKNS,u'show'),
- (XLINKNS,u'type'),
- (SVGNS,u'height'),
- (DRAWNS,u'nohref'),
- (SVGNS,u'width'),
- (XLINKNS,u'href'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (OFFICENS,u'target-frame-name'),
- (SVGNS,u'viewBox'),
- (DRAWNS,u'points'),
- ),
- (DRAWNS,u'area-rectangle'):(
- (OFFICENS,u'name'),
- (XLINKNS,u'show'),
- (XLINKNS,u'type'),
- (SVGNS,u'height'),
- (DRAWNS,u'nohref'),
- (SVGNS,u'width'),
- (XLINKNS,u'href'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (OFFICENS,u'target-frame-name'),
- ),
- (DRAWNS,u'caption'):(
- (TABLENS,u'table-background'),
- (DRAWNS,u'layer'),
- (DRAWNS,u'caption-id'),
- (TABLENS,u'end-cell-address'),
- (DRAWNS,u'name'),
- (DRAWNS,u'text-style-name'),
- (DRAWNS,u'caption-point-y'),
- (DRAWNS,u'caption-point-x'),
- (DRAWNS,u'transform'),
- (TABLENS,u'end-y'),
- (DRAWNS,u'corner-radius'),
- (SVGNS,u'width'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (TABLENS,u'end-x'),
- (TEXTNS,u'anchor-page-number'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (SVGNS,u'height'),
- (DRAWNS,u'id'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DRAWNS,u'circle'):(
- (DRAWNS,u'end-angle'),
- (DRAWNS,u'id'),
- (DRAWNS,u'kind'),
- (DRAWNS,u'layer'),
- (DRAWNS,u'name'),
- (DRAWNS,u'start-angle'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (DRAWNS,u'caption-id'),
- (DRAWNS,u'text-style-name'),
- (DRAWNS,u'transform'),
- (DRAWNS,u'z-index'),
- (PRESENTATIONNS,u'class-names'),
- (PRESENTATIONNS,u'style-name'),
- (SVGNS,u'cx'),
- (SVGNS,u'cy'),
- (SVGNS,u'height'),
- (SVGNS,u'r'),
- (SVGNS,u'width'),
- (SVGNS,u'x'),
- (SVGNS,u'y'),
- (TABLENS,u'end-cell-address'),
- (TABLENS,u'end-x'),
- (TABLENS,u'end-y'),
- (TABLENS,u'table-background'),
- (TEXTNS,u'anchor-page-number'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DRAWNS,u'connector'):(
- (DRAWNS,u'caption-id'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'end-glue-point'),
- (DRAWNS,u'end-shape'),
- (DRAWNS,u'id'),
- (DRAWNS,u'layer'),
- (DRAWNS,u'line-skew'),
- (DRAWNS,u'name'),
- (DRAWNS,u'start-glue-point'),
- (DRAWNS,u'start-shape'),
- (DRAWNS,u'style-name'),
- (DRAWNS,u'text-style-name'),
- (DRAWNS,u'transform'),
- (DRAWNS,u'type'),
- (DRAWNS,u'z-index'),
- (PRESENTATIONNS,u'class-names'),
- (PRESENTATIONNS,u'style-name'),
- (SVGNS,u'd'),
- (SVGNS,u'viewBox'),
- (SVGNS,u'x1'),
- (SVGNS,u'x2'),
- (SVGNS,u'y1'),
- (SVGNS,u'y2'),
- (TABLENS,u'end-cell-address'),
- (TABLENS,u'end-x'),
- (TABLENS,u'end-y'),
- (TABLENS,u'table-background'),
- (TEXTNS,u'anchor-page-number'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DRAWNS,u'contour-path'):(
- (SVGNS,u'd'),
- (SVGNS,u'width'),
- (DRAWNS,u'recreate-on-edit'),
- (SVGNS,u'viewBox'),
- (SVGNS,u'height'),
- ),
- (DRAWNS,u'contour-polygon'):(
- (SVGNS,u'width'),
- (DRAWNS,u'points'),
- (DRAWNS,u'recreate-on-edit'),
- (SVGNS,u'viewBox'),
- (SVGNS,u'height'),
- ),
- (DRAWNS,u'control'):(
- (DRAWNS,u'control'),
- (DRAWNS,u'layer'),
- (DRAWNS,u'caption-id'),
- (TABLENS,u'end-cell-address'),
- (DRAWNS,u'name'),
- (DRAWNS,u'text-style-name'),
- (TABLENS,u'table-background'),
- (DRAWNS,u'transform'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (TABLENS,u'end-x'),
- (TEXTNS,u'anchor-page-number'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (TABLENS,u'end-y'),
- (DRAWNS,u'id'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'custom-shape'):(
- (DRAWNS,u'engine'),
- (DRAWNS,u'caption-id'),
- (DRAWNS,u'layer'),
- (TABLENS,u'end-cell-address'),
- (DRAWNS,u'name'),
- (DRAWNS,u'text-style-name'),
- (TABLENS,u'table-background'),
- (DRAWNS,u'transform'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (TABLENS,u'end-x'),
- (TEXTNS,u'anchor-page-number'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (TABLENS,u'end-y'),
- (DRAWNS,u'data'),
- (DRAWNS,u'id'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DRAWNS,u'ellipse'):(
- (DRAWNS,u'layer'),
- (DRAWNS,u'start-angle'),
- (SVGNS,u'cy'),
- (SVGNS,u'cx'),
- (TABLENS,u'table-background'),
- (TABLENS,u'end-cell-address'),
- (SVGNS,u'rx'),
- (DRAWNS,u'transform'),
- (DRAWNS,u'id'),
- (SVGNS,u'width'),
- (TABLENS,u'end-y'),
- (TABLENS,u'end-x'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (DRAWNS,u'end-angle'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'caption-id'),
- (PRESENTATIONNS,u'style-name'),
- (SVGNS,u'height'),
- (TEXTNS,u'anchor-type'),
- (SVGNS,u'ry'),
- (DRAWNS,u'kind'),
- (DRAWNS,u'name'),
- (TEXTNS,u'anchor-page-number'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (DRAWNS,u'text-style-name'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DRAWNS,u'enhanced-geometry'):(
- (DR3DNS,u'projection'),
- (DR3DNS,u'shade-mode'),
- (DRAWNS,u'concentric-gradient-fill-allowed'),
- (DRAWNS,u'enhanced-path'),
- (DRAWNS,u'extrusion'),
- (DRAWNS,u'extrusion-allowed'),
- (DRAWNS,u'extrusion-brightness'),
- (DRAWNS,u'extrusion-color'),
- (DRAWNS,u'extrusion-depth'),
- (DRAWNS,u'extrusion-diffusion'),
- (DRAWNS,u'extrusion-first-light-direction'),
- (DRAWNS,u'extrusion-first-light-harsh'),
- (DRAWNS,u'extrusion-first-light-level'),
- (DRAWNS,u'extrusion-light-face'),
- (DRAWNS,u'extrusion-metal'),
- (DRAWNS,u'extrusion-number-of-line-segments'),
- (DRAWNS,u'extrusion-origin'),
- (DRAWNS,u'extrusion-rotation-angle'),
- (DRAWNS,u'extrusion-rotation-center'),
- (DRAWNS,u'extrusion-second-light-direction'),
- (DRAWNS,u'extrusion-second-light-harsh'),
- (DRAWNS,u'extrusion-second-light-level'),
- (DRAWNS,u'extrusion-shininess'),
- (DRAWNS,u'extrusion-skew'),
- (DRAWNS,u'extrusion-specularity'),
- (DRAWNS,u'extrusion-viewpoint'),
- (DRAWNS,u'glue-point-leaving-directions'),
- (DRAWNS,u'glue-points'),
- (DRAWNS,u'glue-point-type'),
- (DRAWNS,u'mirror-horizontal'),
- (DRAWNS,u'mirror-vertical'),
- (DRAWNS,u'modifiers'),
- (DRAWNS,u'path-stretchpoint-x'),
- (DRAWNS,u'path-stretchpoint-y'),
- (DRAWNS,u'text-areas'),
- (DRAWNS,u'text-path'),
- (DRAWNS,u'text-path-allowed'),
- (DRAWNS,u'text-path-mode'),
- (DRAWNS,u'text-path-same-letter-heights'),
- (DRAWNS,u'text-path-scale'),
- (DRAWNS,u'text-rotate-angle'),
- (DRAWNS,u'type'),
- (SVGNS,u'viewBox'),
- ),
-# allowed_attributes
- (DRAWNS,u'equation'):(
- (DRAWNS,u'formula'),
- (DRAWNS,u'name'),
- ),
- (DRAWNS,u'fill-image'):(
- (DRAWNS,u'name'),
- (XLINKNS,u'show'),
- (XLINKNS,u'actuate'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (XLINKNS,u'href'),
- (DRAWNS,u'display-name'),
- (XLINKNS,u'type'),
- ),
- (DRAWNS,u'floating-frame'):(
- (XLINKNS,u'href'),
- (XLINKNS,u'actuate'),
- (DRAWNS,u'frame-name'),
- (XLINKNS,u'type'),
- (XLINKNS,u'show'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'frame'):(
- (DRAWNS,u'copy-of'),
- (DRAWNS,u'id'),
- (DRAWNS,u'layer'),
- (DRAWNS,u'name'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'caption-id'),
- (DRAWNS,u'style-name'),
- (DRAWNS,u'text-style-name'),
- (DRAWNS,u'transform'),
- (DRAWNS,u'z-index'),
- (PRESENTATIONNS,u'class'),
- (PRESENTATIONNS,u'class-names'),
- (PRESENTATIONNS,u'placeholder'),
- (PRESENTATIONNS,u'style-name'),
- (PRESENTATIONNS,u'user-transformed'),
- (STYLENS,u'rel-height'),
- (STYLENS,u'rel-width'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (SVGNS,u'x'),
- (SVGNS,u'y'),
- (TABLENS,u'end-cell-address'),
- (TABLENS,u'end-x'),
- (TABLENS,u'end-y'),
- (TABLENS,u'table-background'),
- (TEXTNS,u'anchor-page-number'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DRAWNS,u'g'):(
- (DRAWNS,u'id'),
- (DRAWNS,u'caption-id'),
- (DRAWNS,u'name'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (DRAWNS,u'z-index'),
- (PRESENTATIONNS,u'class-names'),
- (PRESENTATIONNS,u'style-name'),
- (SVGNS,u'y'),
- (TABLENS,u'end-cell-address'),
- (TABLENS,u'end-x'),
- (TABLENS,u'end-y'),
- (TABLENS,u'table-background'),
- (TEXTNS,u'anchor-page-number'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'glue-point'):(
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (DRAWNS,u'align'),
- (DRAWNS,u'id'),
- (DRAWNS,u'escape-direction'),
- ),
- (DRAWNS,u'gradient'):(
- (DRAWNS,u'style'),
- (DRAWNS,u'angle'),
- (DRAWNS,u'name'),
- (DRAWNS,u'end-color'),
- (DRAWNS,u'start-color'),
- (DRAWNS,u'cy'),
- (DRAWNS,u'cx'),
- (DRAWNS,u'display-name'),
- (DRAWNS,u'border'),
- (DRAWNS,u'end-intensity'),
- (DRAWNS,u'start-intensity'),
- ),
- (DRAWNS,u'handle'):(
- (DRAWNS,u'handle-radius-range-minimum'),
- (DRAWNS,u'handle-switched'),
- (DRAWNS,u'handle-range-y-maximum'),
- (DRAWNS,u'handle-mirror-horizontal'),
- (DRAWNS,u'handle-range-x-maximum'),
- (DRAWNS,u'handle-mirror-vertical'),
- (DRAWNS,u'handle-range-y-minimum'),
- (DRAWNS,u'handle-radius-range-maximum'),
- (DRAWNS,u'handle-range-x-minimum'),
- (DRAWNS,u'handle-position'),
- (DRAWNS,u'handle-polar'),
- ),
- (DRAWNS,u'hatch'):(
- (DRAWNS,u'distance'),
- (DRAWNS,u'style'),
- (DRAWNS,u'name'),
- (DRAWNS,u'color'),
- (DRAWNS,u'display-name'),
- (DRAWNS,u'rotation'),
- ),
- (DRAWNS,u'image'):(
- (DRAWNS,u'filter-name'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (XLINKNS,u'actuate'),
- (XLINKNS,u'show'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'image-map'):(
- ),
- (DRAWNS,u'layer'):(
- (DRAWNS,u'protected'),
- (DRAWNS,u'name'),
- (DRAWNS,u'display'),
- ),
-# allowed_attributes
- (DRAWNS,u'layer-set'):(
- ),
- (DRAWNS,u'line'):(
- (DRAWNS,u'class-names'),
- (DRAWNS,u'id'),
- (DRAWNS,u'caption-id'),
- (DRAWNS,u'layer'),
- (DRAWNS,u'name'),
- (DRAWNS,u'style-name'),
- (DRAWNS,u'text-style-name'),
- (DRAWNS,u'transform'),
- (DRAWNS,u'z-index'),
- (PRESENTATIONNS,u'class-names'),
- (PRESENTATIONNS,u'style-name'),
- (SVGNS,u'x1'),
- (SVGNS,u'x2'),
- (SVGNS,u'y1'),
- (SVGNS,u'y2'),
- (TABLENS,u'end-cell-address'),
- (TABLENS,u'end-x'),
- (TABLENS,u'end-y'),
- (TABLENS,u'table-background'),
- (TEXTNS,u'anchor-page-number'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'marker'):(
- (SVGNS,u'd'),
- (DRAWNS,u'display-name'),
- (DRAWNS,u'name'),
- (SVGNS,u'viewBox'),
- ),
-# allowed_attributes
- (DRAWNS,u'measure'):(
- (TABLENS,u'end-cell-address'),
- (DRAWNS,u'layer'),
- (SVGNS,u'y2'),
- (DRAWNS,u'name'),
- (DRAWNS,u'text-style-name'),
- (DRAWNS,u'transform'),
- (TABLENS,u'table-background'),
- (SVGNS,u'x2'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (TABLENS,u'end-x'),
- (TEXTNS,u'anchor-page-number'),
- (SVGNS,u'y1'),
- (DRAWNS,u'caption-id'),
- (TABLENS,u'end-y'),
- (SVGNS,u'x1'),
- (DRAWNS,u'id'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'object'):(
- (XLINKNS,u'type'),
- (XLINKNS,u'href'),
- (DRAWNS,u'notify-on-update-of-ranges'),
- (XLINKNS,u'actuate'),
- (XLINKNS,u'show'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'object-ole'):(
- (XLINKNS,u'actuate'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (DRAWNS,u'class-id'),
- (XLINKNS,u'show'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'opacity'):(
- (DRAWNS,u'style'),
- (DRAWNS,u'angle'),
- (DRAWNS,u'name'),
- (DRAWNS,u'start'),
- (DRAWNS,u'cy'),
- (DRAWNS,u'cx'),
- (DRAWNS,u'end'),
- (DRAWNS,u'display-name'),
- (DRAWNS,u'border'),
- ),
- (DRAWNS,u'page'):(
- (PRESENTATIONNS,u'presentation-page-layout-name'),
- (DRAWNS,u'name'),
- (DRAWNS,u'nav-order'),
- (PRESENTATIONNS,u'use-footer-name'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'use-header-name'),
- (DRAWNS,u'master-page-name'),
- (DRAWNS,u'id'),
- (PRESENTATIONNS,u'use-date-time-name'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'page-thumbnail'):(
- (TABLENS,u'table-background'),
- (DRAWNS,u'caption-id'),
- (PRESENTATIONNS,u'user-transformed'),
- (DRAWNS,u'layer'),
- (TABLENS,u'end-cell-address'),
- (DRAWNS,u'name'),
- (DRAWNS,u'id'),
- (DRAWNS,u'transform'),
- (DRAWNS,u'page-number'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (TABLENS,u'end-x'),
- (TEXTNS,u'anchor-page-number'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (TABLENS,u'end-y'),
- (PRESENTATIONNS,u'placeholder'),
- (PRESENTATIONNS,u'class'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'param'):(
- (DRAWNS,u'name'),
- (DRAWNS,u'value'),
- ),
-# allowed_attributes
- (DRAWNS,u'path'):(
- (DRAWNS,u'caption-id'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'id'),
- (DRAWNS,u'layer'),
- (DRAWNS,u'name'),
- (DRAWNS,u'style-name'),
- (DRAWNS,u'text-style-name'),
- (DRAWNS,u'transform'),
- (DRAWNS,u'z-index'),
- (PRESENTATIONNS,u'class-names'),
- (PRESENTATIONNS,u'style-name'),
- (SVGNS,u'd'),
- (SVGNS,u'height'),
- (SVGNS,u'viewBox'),
- (SVGNS,u'width'),
- (SVGNS,u'x'),
- (SVGNS,u'y'),
- (TABLENS,u'end-cell-address'),
- (TABLENS,u'end-x'),
- (TABLENS,u'end-y'),
- (TABLENS,u'table-background'),
- (TEXTNS,u'anchor-page-number'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DRAWNS,u'plugin'):(
- (DRAWNS,u'mime-type'),
- (XLINKNS,u'type'),
- (XLINKNS,u'href'),
- (XLINKNS,u'actuate'),
- (XLINKNS,u'show'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'polygon'):(
- (DRAWNS,u'caption-id'),
- (TABLENS,u'table-background'),
- (DRAWNS,u'layer'),
- (TABLENS,u'end-cell-address'),
- (DRAWNS,u'name'),
- (DRAWNS,u'text-style-name'),
- (DRAWNS,u'id'),
- (DRAWNS,u'transform'),
- (PRESENTATIONNS,u'style-name'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'points'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (TABLENS,u'end-x'),
- (TEXTNS,u'anchor-page-number'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (TABLENS,u'end-y'),
- (SVGNS,u'viewBox'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DRAWNS,u'polyline'):(
- (TABLENS,u'table-background'),
- (DRAWNS,u'layer'),
- (TABLENS,u'end-cell-address'),
- (DRAWNS,u'name'),
- (DRAWNS,u'text-style-name'),
- (DRAWNS,u'id'),
- (DRAWNS,u'caption-id'),
- (DRAWNS,u'transform'),
- (PRESENTATIONNS,u'style-name'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'points'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (TABLENS,u'end-x'),
- (TEXTNS,u'anchor-page-number'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (TABLENS,u'end-y'),
- (SVGNS,u'viewBox'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DRAWNS,u'rect'):(
- (DRAWNS,u'corner-radius'),
- (DRAWNS,u'caption-id'),
- (DRAWNS,u'id'),
- (DRAWNS,u'layer'),
- (DRAWNS,u'name'),
- (DRAWNS,u'text-style-name'),
- (DRAWNS,u'transform'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (PRESENTATIONNS,u'style-name'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (SVGNS,u'rx'),
- (SVGNS,u'ry'),
- (SVGNS,u'x'),
- (SVGNS,u'y'),
- (TABLENS,u'end-cell-address'),
- (TABLENS,u'end-x'),
- (TABLENS,u'end-y'),
- (TABLENS,u'table-background'),
- (TEXTNS,u'anchor-page-number'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (DRAWNS,u'regular-polygon'):(
- (TABLENS,u'table-background'),
- (DRAWNS,u'layer'),
- (TABLENS,u'end-cell-address'),
- (DRAWNS,u'caption-id'),
- (DRAWNS,u'name'),
- (DRAWNS,u'text-style-name'),
- (TEXTNS,u'anchor-page-number'),
- (DRAWNS,u'concave'),
- (DRAWNS,u'sharpness'),
- (DRAWNS,u'transform'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (DRAWNS,u'z-index'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'style-name'),
- (PRESENTATIONNS,u'class-names'),
- (TABLENS,u'end-x'),
- (DRAWNS,u'corners'),
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (TABLENS,u'end-y'),
- (DRAWNS,u'id'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
- (DRAWNS,u'stroke-dash'):(
- (DRAWNS,u'distance'),
- (DRAWNS,u'dots1-length'),
- (DRAWNS,u'name'),
- (DRAWNS,u'dots2-length'),
- (DRAWNS,u'style'),
- (DRAWNS,u'dots1'),
- (DRAWNS,u'display-name'),
- (DRAWNS,u'dots2'),
- ),
- (DRAWNS,u'text-box'):(
- (FONS,u'min-width'),
- (DRAWNS,u'corner-radius'),
- (FONS,u'max-height'),
- (FONS,u'min-height'),
- (DRAWNS,u'chain-next-name'),
- (FONS,u'max-width'),
- (TEXTNS,u'id'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (FORMNS,u'button'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'focus-on-click'),
- (FORMNS,u'image-align'),
- (FORMNS,u'name'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'button-type'),
- (FORMNS,u'title'),
- (FORMNS,u'default-button'),
- (FORMNS,u'value'),
- (FORMNS,u'label'),
- (FORMNS,u'delay-for-repeat'),
- (FORMNS,u'repeat'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- (FORMNS,u'image-data'),
- (XLINKNS,u'href'),
- (FORMNS,u'toggle'),
- (FORMNS,u'xforms-submission'),
- (OFFICENS,u'target-frame'),
- (FORMNS,u'image-position'),
- ),
- (FORMNS,u'checkbox'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'image-align'),
- (FORMNS,u'name'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'data-field'),
- (FORMNS,u'title'),
- (FORMNS,u'is-tristate'),
- (FORMNS,u'current-state'),
- (FORMNS,u'value'),
- (FORMNS,u'label'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- (FORMNS,u'state'),
- (FORMNS,u'visual-effect'),
- (FORMNS,u'image-position'),
- ),
- (FORMNS,u'column'):(
- (FORMNS,u'control-implementation'),
- (FORMNS,u'text-style-name'),
- (FORMNS,u'name'),
- (FORMNS,u'label'),
- ),
-# allowed_attributes
- (FORMNS,u'combobox'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'auto-complete'),
- (FORMNS,u'control-implementation'),
- (FORMNS,u'convert-empty-to-null'),
- (FORMNS,u'current-value'),
- (FORMNS,u'data-field'),
- (FORMNS,u'disabled'),
- (FORMNS,u'dropdown'),
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'list-source'),
- (FORMNS,u'list-source-type'),
- (FORMNS,u'max-length'),
- (FORMNS,u'name'),
- (FORMNS,u'printable'),
- (FORMNS,u'readonly'),
- (FORMNS,u'size'),
- (FORMNS,u'source-cell-range'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'title'),
- (FORMNS,u'value'),
- (XFORMSNS,u'bind'),
- ),
-# allowed_attributes
- (FORMNS,u'connection-resource'):(
- (XLINKNS,u'href'),
- ),
- (FORMNS,u'date'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'control-implementation'),
- (FORMNS,u'convert-empty-to-null'),
- (FORMNS,u'current-value'),
- (FORMNS,u'data-field'),
- (FORMNS,u'delay-for-repeat'),
- (FORMNS,u'disabled'),
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'max-length'),
- (FORMNS,u'max-value'),
- (FORMNS,u'min-value'),
- (FORMNS,u'name'),
- (FORMNS,u'printable'),
- (FORMNS,u'readonly'),
- (FORMNS,u'repeat'),
- (FORMNS,u'spin-button'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'title'),
- (FORMNS,u'value'),
- (XFORMSNS,u'bind'),
- ),
- (FORMNS,u'file'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'max-length'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'name'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'title'),
- (FORMNS,u'value'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- (FORMNS,u'readonly'),
- (FORMNS,u'current-value'),
- ),
- (FORMNS,u'fixed-text'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'name'),
- (FORMNS,u'for'),
- (FORMNS,u'title'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'multi-line'),
- (FORMNS,u'label'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- ),
-# allowed_attributes
- (FORMNS,u'form'):(
- (XLINKNS,u'actuate'),
- (XLINKNS,u'href'),
- (FORMNS,u'allow-deletes'),
- (FORMNS,u'command-type'),
- (FORMNS,u'apply-filter'),
- (XLINKNS,u'type'),
- (FORMNS,u'method'),
- (OFFICENS,u'target-frame'),
- (FORMNS,u'navigation-mode'),
- (FORMNS,u'detail-fields'),
- (FORMNS,u'master-fields'),
- (FORMNS,u'allow-updates'),
- (FORMNS,u'name'),
- (FORMNS,u'tab-cycle'),
- (FORMNS,u'control-implementation'),
- (FORMNS,u'escape-processing'),
- (FORMNS,u'filter'),
- (FORMNS,u'command'),
- (FORMNS,u'datasource'),
- (FORMNS,u'enctype'),
- (FORMNS,u'allow-inserts'),
- (FORMNS,u'ignore-result'),
- (FORMNS,u'order'),
- ),
-# allowed_attributes
- (FORMNS,u'formatted-text'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'control-implementation'),
- (FORMNS,u'convert-empty-to-null'),
- (FORMNS,u'current-value'),
- (FORMNS,u'data-field'),
- (FORMNS,u'delay-for-repeat'),
- (FORMNS,u'disabled'),
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'max-length'),
- (FORMNS,u'max-value'),
- (FORMNS,u'min-value'),
- (FORMNS,u'name'),
- (FORMNS,u'printable'),
- (FORMNS,u'readonly'),
- (FORMNS,u'repeat'),
- (FORMNS,u'spin-button'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'title'),
- (FORMNS,u'validation'),
- (FORMNS,u'value'),
- (XFORMSNS,u'bind'),
- ),
- (FORMNS,u'frame'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'name'),
- (FORMNS,u'for'),
- (FORMNS,u'title'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'label'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- ),
-# allowed_attributes
- (FORMNS,u'generic-control'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'name'),
- ),
- (FORMNS,u'grid'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'name'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'title'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- ),
- (FORMNS,u'hidden'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'name'),
- (FORMNS,u'value'),
- ),
- (FORMNS,u'image'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'name'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'button-type'),
- (FORMNS,u'title'),
- (FORMNS,u'value'),
- (OFFICENS,u'target-frame'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- (FORMNS,u'image-data'),
- (XLINKNS,u'href'),
- ),
- (FORMNS,u'image-frame'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'name'),
- (FORMNS,u'title'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'data-field'),
- (FORMNS,u'readonly'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- (FORMNS,u'image-data'),
- ),
- (FORMNS,u'item'):(
- (FORMNS,u'label'),
- ),
- (FORMNS,u'list-property'):(
- (FORMNS,u'property-name'),
- (OFFICENS,u'value-type'),
- ),
- (FORMNS,u'list-value'):(
- (OFFICENS,u'string-value'),
- ),
-# allowed_attributes
- (FORMNS,u'listbox'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'bound-column'),
- (FORMNS,u'control-implementation'),
- (FORMNS,u'data-field'),
- (FORMNS,u'disabled'),
- (FORMNS,u'dropdown'),
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'list-linkage-type'),
- (FORMNS,u'list-source'),
- (FORMNS,u'list-source-type'),
- (FORMNS,u'multiple'),
- (FORMNS,u'name'),
- (FORMNS,u'printable'),
- (FORMNS,u'size'),
- (FORMNS,u'source-cell-range'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'title'),
- (FORMNS,u'xforms-list-source'),
- (XFORMSNS,u'bind'),
- ),
- (FORMNS,u'number'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'control-implementation'),
- (FORMNS,u'convert-empty-to-null'),
- (FORMNS,u'current-value'),
- (FORMNS,u'data-field'),
- (FORMNS,u'delay-for-repeat'),
- (FORMNS,u'disabled'),
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'max-length'),
- (FORMNS,u'max-value'),
- (FORMNS,u'min-value'),
- (FORMNS,u'name'),
- (FORMNS,u'printable'),
- (FORMNS,u'readonly'),
- (FORMNS,u'repeat'),
- (FORMNS,u'spin-button'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'title'),
- (FORMNS,u'value'),
- (XFORMSNS,u'bind'),
- ),
- (FORMNS,u'option'):(
- (FORMNS,u'current-selected'),
- (FORMNS,u'selected'),
- (FORMNS,u'value'),
- (FORMNS,u'label'),
- ),
- (FORMNS,u'password'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'convert-empty-to-null'),
- (FORMNS,u'max-length'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'name'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'title'),
- (FORMNS,u'value'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- (FORMNS,u'echo-char'),
- ),
- (FORMNS,u'properties'):(
- ),
- (FORMNS,u'property'):(
- (OFFICENS,u'string-value'),
- (OFFICENS,u'value'),
- (OFFICENS,u'boolean-value'),
- (FORMNS,u'property-name'),
- (OFFICENS,u'currency'),
- (OFFICENS,u'date-value'),
- (OFFICENS,u'value-type'),
- (OFFICENS,u'time-value'),
- ),
- (FORMNS,u'radio'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'selected'),
- (FORMNS,u'image-align'),
- (FORMNS,u'name'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'data-field'),
- (FORMNS,u'current-selected'),
- (FORMNS,u'value'),
- (FORMNS,u'label'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- (FORMNS,u'title'),
- (FORMNS,u'visual-effect'),
- (FORMNS,u'image-position'),
- ),
- (FORMNS,u'text'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'convert-empty-to-null'),
- (FORMNS,u'max-length'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'name'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'data-field'),
- (FORMNS,u'title'),
- (FORMNS,u'value'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- (FORMNS,u'readonly'),
- (FORMNS,u'current-value'),
- ),
- (FORMNS,u'textarea'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'convert-empty-to-null'),
- (FORMNS,u'max-length'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'name'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'data-field'),
- (FORMNS,u'title'),
- (FORMNS,u'value'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- (FORMNS,u'readonly'),
- (FORMNS,u'current-value'),
- ),
- (FORMNS,u'time'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'control-implementation'),
- (FORMNS,u'convert-empty-to-null'),
- (FORMNS,u'current-value'),
- (FORMNS,u'data-field'),
- (FORMNS,u'delay-for-repeat'),
- (FORMNS,u'disabled'),
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'max-length'),
- (FORMNS,u'max-value'),
- (FORMNS,u'min-value'),
- (FORMNS,u'name'),
- (FORMNS,u'printable'),
- (FORMNS,u'readonly'),
- (FORMNS,u'repeat'),
- (FORMNS,u'spin-button'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'title'),
- (FORMNS,u'value'),
- (XFORMSNS,u'bind'),
- ),
- (FORMNS,u'value-range'):(
- (XMLNS,u'id'), # First choice
- (FORMNS,u'id'),
- (FORMNS,u'linked-cell'),
- (FORMNS,u'tab-stop'),
- (FORMNS,u'max-value'),
- (FORMNS,u'name'),
- (FORMNS,u'tab-index'),
- (FORMNS,u'control-implementation'),
- (XFORMSNS,u'bind'),
- (FORMNS,u'title'),
- (FORMNS,u'value'),
- (FORMNS,u'disabled'),
- (FORMNS,u'printable'),
- (FORMNS,u'orientation'),
- (FORMNS,u'page-step-size'),
- (FORMNS,u'delay-for-repeat'),
- (FORMNS,u'repeat'),
- (FORMNS,u'min-value'),
- (FORMNS,u'step-size'),
- ),
- (MANIFESTNS,'algorithm') : (
- (MANIFESTNS,'algorithm-name'),
- (MANIFESTNS,'initialisation-vector'),
- ),
- (MANIFESTNS,'encryption-data') : (
- (MANIFESTNS,'checksum-type'),
- (MANIFESTNS,'checksum'),
- ),
- (MANIFESTNS,'file-entry') : (
- (MANIFESTNS,'full-path'),
- (MANIFESTNS,'media-type'),
- (MANIFESTNS,'preferred-view-mode'),
- (MANIFESTNS,'size'),
- (MANIFESTNS,'version'),
- ),
- (MANIFESTNS,'key-derivation') : (
- (MANIFESTNS,'key-derivation-name'),
- (MANIFESTNS,'salt'),
- (MANIFESTNS,'iteration-count'),
- ),
- (MANIFESTNS,u'manifest'):(
- ),
-# allowed_attributes
- (METANS,u'auto-reload'):(
- (METANS,u'delay'),
- (XLINKNS,u'actuate'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (XLINKNS,u'show'),
- ),
- (METANS,u'creation-date'):(
- ),
- (METANS,u'date-string'):(
- ),
- (METANS,u'document-statistic'):(
- (METANS,u'non-whitespace-character-count'),
- (METANS,u'ole-object-count'),
- (METANS,u'table-count'),
- (METANS,u'row-count'),
- (METANS,u'character-count'),
- (METANS,u'sentence-count'),
- (METANS,u'draw-count'),
- (METANS,u'paragraph-count'),
- (METANS,u'word-count'),
- (METANS,u'object-count'),
- (METANS,u'syllable-count'),
- (METANS,u'image-count'),
- (METANS,u'page-count'),
- (METANS,u'frame-count'),
- (METANS,u'cell-count'),
- ),
- (METANS,u'editing-cycles'):(
- ),
- (METANS,u'editing-duration'):(
- ),
- (METANS,u'generator'):(
- ),
-# allowed_attributes
- (METANS,u'hyperlink-behaviour'):(
- (OFFICENS,u'target-frame-name'),
- (XLINKNS,u'show'),
- ),
- (METANS,u'initial-creator'):(
- ),
- (METANS,u'keyword'):(
- ),
- (METANS,u'print-date'):(
- ),
- (METANS,u'printed-by'):(
- ),
- (METANS,u'template'):(
- (METANS,u'date'),
- (XLINKNS,u'actuate'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (XLINKNS,u'title'),
- ),
- (METANS,u'user-defined'):(
- (METANS,u'name'),
- (METANS,u'value-type'),
- ),
-# allowed_attributes
- (OFFICENS,u'annotation'):(
- (DRAWNS,u'caption-point-x'),
- (DRAWNS,u'caption-point-y'),
- (DRAWNS,u'class-names'),
- (DRAWNS,u'corner-radius'),
- (DRAWNS,u'id'),
- (DRAWNS,u'layer'),
- (DRAWNS,u'name'),
- (DRAWNS,u'style-name'),
- (DRAWNS,u'text-style-name'),
- (DRAWNS,u'transform'),
- (DRAWNS,u'z-index'),
- (OFFICENS,u'display'),
- (OFFICENS,u'name'),
- (PRESENTATIONNS,u'class-names'),
- (PRESENTATIONNS,u'style-name'),
- (SVGNS,u'height'),
- (SVGNS,u'width'),
- (SVGNS,u'x'),
- (SVGNS,u'y'),
- (TABLENS,u'end-cell-address'),
- (TABLENS,u'end-x'),
- (TABLENS,u'end-y'),
- (TABLENS,u'table-background'),
- (TEXTNS,u'anchor-page-number'),
- (TEXTNS,u'anchor-type'),
- (XMLNS,u'id'),
- ),
- (OFFICENS,u'annotation-end'): (
- (OFFICENS,u'name'),
- ),
- (OFFICENS,u'automatic-styles'):(
- ),
- (OFFICENS,u'binary-data'):(
- ),
- (OFFICENS,u'body'):(
- ),
- (OFFICENS,u'change-info'):(
- ),
- (OFFICENS,u'chart'):(
- ),
-# allowed_attributes
- (OFFICENS,u'dde-source'):(
- (OFFICENS,u'dde-application'),
- (OFFICENS,u'automatic-update'),
- (OFFICENS,u'conversion-mode'),
- (OFFICENS,u'dde-item'),
- (OFFICENS,u'dde-topic'),
- (OFFICENS,u'name'),
- ),
- (OFFICENS,u'document'):(
- (OFFICENS,u'mimetype'),
- (OFFICENS,u'version'),
- (GRDDLNS,u'transformation'),
- ),
- (OFFICENS,u'document-content'):(
- (OFFICENS,u'version'),
- (GRDDLNS,u'transformation'),
- ),
- (OFFICENS,u'document-meta'):(
- (OFFICENS,u'version'),
- (GRDDLNS,u'transformation'),
- ),
- (OFFICENS,u'document-settings'):(
- (OFFICENS,u'version'),
- (GRDDLNS,u'transformation'),
- ),
- (OFFICENS,u'document-styles'):(
- (OFFICENS,u'version'),
- (GRDDLNS,u'transformation'),
- ),
- (OFFICENS,u'drawing'):(
- ),
- (OFFICENS,u'event-listeners'):(
- ),
- (OFFICENS,u'font-face-decls'):(
- ),
- (OFFICENS,u'forms'):(
- (FORMNS,u'automatic-focus'),
- (FORMNS,u'apply-design-mode'),
- ),
- (OFFICENS,u'image'):(
- ),
-# allowed_attributes
- (OFFICENS,u'master-styles'):(
- ),
- (OFFICENS,u'meta'):(
- ),
- (OFFICENS,u'presentation'):(
- ),
- (OFFICENS,u'script'):(
- (SCRIPTNS,u'language'),
- ),
- (OFFICENS,u'scripts'):(
- ),
- (OFFICENS,u'settings'):(
- ),
- (OFFICENS,u'spreadsheet'):(
- (TABLENS,u'structure-protected'),
- (TABLENS,u'protection-key'),
- (TABLENS,u'protection-key-digest-algorithm'),
- ),
- (OFFICENS,u'styles'):(
- ),
- (OFFICENS,u'text'):(
- (TEXTNS,u'global'),
- (TEXTNS,u'use-soft-page-breaks'),
- ),
- (PRESENTATIONNS,u'animation-group'):(
- ),
- (PRESENTATIONNS,u'animations'):(
- ),
- (PRESENTATIONNS,u'date-time'):(
- ),
- (PRESENTATIONNS,u'date-time-decl'):(
- (PRESENTATIONNS,u'source'),
- (STYLENS,u'data-style-name'),
- (PRESENTATIONNS,u'name'),
- ),
- (PRESENTATIONNS,u'dim'):(
- (DRAWNS,u'color'),
- (DRAWNS,u'shape-id'),
- ),
- (PRESENTATIONNS,u'event-listener'):(
- (PRESENTATIONNS,u'direction'),
- (XLINKNS,u'show'),
- (XLINKNS,u'type'),
- (XLINKNS,u'actuate'),
- (PRESENTATIONNS,u'effect'),
- (SCRIPTNS,u'event-name'),
- (PRESENTATIONNS,u'start-scale'),
- (XLINKNS,u'href'),
- (PRESENTATIONNS,u'verb'),
- (PRESENTATIONNS,u'action'),
- (PRESENTATIONNS,u'speed'),
- ),
- (PRESENTATIONNS,u'footer'):(
- ),
- (PRESENTATIONNS,u'footer-decl'):(
- (PRESENTATIONNS,u'name'),
- ),
- (PRESENTATIONNS,u'header'):(
- ),
- (PRESENTATIONNS,u'header-decl'):(
- (PRESENTATIONNS,u'name'),
- ),
- (PRESENTATIONNS,u'hide-shape'):(
- (PRESENTATIONNS,u'direction'),
- (PRESENTATIONNS,u'effect'),
- (PRESENTATIONNS,u'delay'),
- (PRESENTATIONNS,u'start-scale'),
- (PRESENTATIONNS,u'path-id'),
- (PRESENTATIONNS,u'speed'),
- (DRAWNS,u'shape-id'),
- ),
-# allowed_attributes
- (PRESENTATIONNS,u'hide-text'):(
- (PRESENTATIONNS,u'direction'),
- (PRESENTATIONNS,u'effect'),
- (PRESENTATIONNS,u'delay'),
- (PRESENTATIONNS,u'start-scale'),
- (PRESENTATIONNS,u'path-id'),
- (PRESENTATIONNS,u'speed'),
- (DRAWNS,u'shape-id'),
- ),
- (PRESENTATIONNS,u'notes'):(
- (STYLENS,u'page-layout-name'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'use-header-name'),
- (PRESENTATIONNS,u'use-date-time-name'),
- (PRESENTATIONNS,u'use-footer-name'),
- ),
- (PRESENTATIONNS,u'placeholder'):(
- (SVGNS,u'y'),
- (SVGNS,u'x'),
- (SVGNS,u'height'),
- (PRESENTATIONNS,u'object'),
- (SVGNS,u'width'),
- ),
- (PRESENTATIONNS,u'play'):(
- (PRESENTATIONNS,u'speed'),
- (DRAWNS,u'shape-id'),
- ),
-# allowed_attributes
- (PRESENTATIONNS,u'settings'):(
- (PRESENTATIONNS,u'animations'),
- (PRESENTATIONNS,u'endless'),
- (PRESENTATIONNS,u'force-manual'),
- (PRESENTATIONNS,u'full-screen'),
- (PRESENTATIONNS,u'mouse-as-pen'),
- (PRESENTATIONNS,u'mouse-visible'),
- (PRESENTATIONNS,u'pause'),
- (PRESENTATIONNS,u'show'),
- (PRESENTATIONNS,u'show-end-of-presentation-slide'),
- (PRESENTATIONNS,u'show-logo'),
- (PRESENTATIONNS,u'start-page'),
- (PRESENTATIONNS,u'start-with-navigator'),
- (PRESENTATIONNS,u'stay-on-top'),
- (PRESENTATIONNS,u'transition-on-click'),
- ),
- (PRESENTATIONNS,u'show'):(
- (PRESENTATIONNS,u'name'),
- (PRESENTATIONNS,u'pages'),
- ),
- (PRESENTATIONNS,u'show-shape'):(
- (PRESENTATIONNS,u'direction'),
- (PRESENTATIONNS,u'effect'),
- (PRESENTATIONNS,u'delay'),
- (PRESENTATIONNS,u'start-scale'),
- (PRESENTATIONNS,u'path-id'),
- (PRESENTATIONNS,u'speed'),
- (DRAWNS,u'shape-id'),
- ),
- (PRESENTATIONNS,u'show-text'):(
- (PRESENTATIONNS,u'direction'),
- (PRESENTATIONNS,u'effect'),
- (PRESENTATIONNS,u'delay'),
- (PRESENTATIONNS,u'start-scale'),
- (PRESENTATIONNS,u'path-id'),
- (PRESENTATIONNS,u'speed'),
- (DRAWNS,u'shape-id'),
- ),
- (PRESENTATIONNS,u'sound'):(
- (XLINKNS,u'actuate'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (PRESENTATIONNS,u'play-full'),
- (XLINKNS,u'show'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (SCRIPTNS,u'event-listener'):(
- (SCRIPTNS,u'language'),
- (SCRIPTNS,u'macro-name'),
- (XLINKNS,u'actuate'),
- (SCRIPTNS,u'event-name'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (STYLENS,u'background-image'):(
- (DRAWNS,u'opacity'),
- (STYLENS,u'repeat'),
- (XLINKNS,u'show'),
- (XLINKNS,u'actuate'),
- (STYLENS,u'filter-name'),
- (XLINKNS,u'href'),
- (STYLENS,u'position'),
- (XLINKNS,u'type'),
- ),
-# allowed_attributes
- (STYLENS,u'chart-properties'): (
- (CHARTNS,u'angle-offset'),
- (CHARTNS,u'auto-position'),
- (CHARTNS,u'auto-size'),
- (CHARTNS,u'axis-label-position'),
- (CHARTNS,u'axis-position'),
- (CHARTNS,u'connect-bars'),
- (CHARTNS,u'data-label-number'),
- (CHARTNS,u'data-label-symbol'),
- (CHARTNS,u'data-label-text'),
- (CHARTNS,u'deep'),
- (CHARTNS,u'display-label'),
- (CHARTNS,u'error-category'),
- (CHARTNS,u'error-lower-indicator'),
- (CHARTNS,u'error-lower-limit'),
- (CHARTNS,u'error-lower-range'),
- (CHARTNS,u'error-margin'),
- (CHARTNS,u'error-percentage'),
- (CHARTNS,u'error-upper-indicator'),
- (CHARTNS,u'error-upper-limit'),
- (CHARTNS,u'error-upper-range'),
- (CHARTNS,u'gap-width'),
- (CHARTNS,u'group-bars-per-axis'),
- (CHARTNS,u'hole-size'),
- (CHARTNS,u'include-hidden-cells'),
- (CHARTNS,u'interpolation'),
- (CHARTNS,u'interval-major'),
- (CHARTNS,u'interval-minor-divisor'),
- (CHARTNS,u'japanese-candle-stick'),
- (CHARTNS,u'label-arrangement'),
- (CHARTNS,u'label-position'),
- (CHARTNS,u'label-position-negative'),
- (CHARTNS,u'lines'),
- (CHARTNS,u'link-data-style-to-source'),
- (CHARTNS,u'logarithmic'),
- (CHARTNS,u'maximum'),
- (CHARTNS,u'mean-value'),
- (CHARTNS,u'minimum'),
- (CHARTNS,u'origin'),
- (CHARTNS,u'overlap'),
- (CHARTNS,u'percentage'),
- (CHARTNS,u'pie-offset'),
- (CHARTNS,u'regression-type'),
- (CHARTNS,u'reverse-direction'),
- (CHARTNS,u'right-angled-axes'),
- (CHARTNS,u'scale-text'),
- (CHARTNS,u'series-source'),
- (CHARTNS,u'solid-type'),
- (CHARTNS,u'sort-by-x-values'),
- (CHARTNS,u'spline-order'),
- (CHARTNS,u'spline-resolution'),
- (CHARTNS,u'stacked'),
- (CHARTNS,u'symbol-height'),
- (CHARTNS,u'symbol-name'),
- (CHARTNS,u'symbol-type'),
- (CHARTNS,u'symbol-width'),
- (CHARTNS,u'text-overlap'),
- (CHARTNS,u'three-dimensional'),
- (CHARTNS,u'tick-mark-position'),
- (CHARTNS,u'tick-marks-major-inner'),
- (CHARTNS,u'tick-marks-major-outer'),
- (CHARTNS,u'tick-marks-minor-inner'),
- (CHARTNS,u'tick-marks-minor-outer'),
- (CHARTNS,u'treat-empty-cells'),
- (CHARTNS,u'vertical'),
- (CHARTNS,u'visible'),
- (STYLENS,u'direction'),
- (STYLENS,u'rotation-angle'),
- (TEXTNS,u'line-break'),
- ),
- (STYLENS,u'column'):(
- (FONS,u'end-indent'),
- (FONS,u'space-before'),
- (FONS,u'start-indent'),
- (FONS,u'space-after'),
- (STYLENS,u'rel-width'),
- ),
- (STYLENS,u'column-sep'):(
- (STYLENS,u'color'),
- (STYLENS,u'width'),
- (STYLENS,u'style'),
- (STYLENS,u'vertical-align'),
- (STYLENS,u'height'),
- ),
- (STYLENS,u'columns'):(
- (FONS,u'column-count'),
- (FONS,u'column-gap'),
- ),
-# allowed_attributes
- (STYLENS,u'default-page-layout'):(
- ),
- (STYLENS,u'default-style'):(
- (STYLENS,u'family'),
- ),
-# allowed_attributes
- (STYLENS,u'drawing-page-properties'): (
- (DRAWNS,u'fill'),
- (DRAWNS,u'fill-color'),
- (DRAWNS,u'secondary-fill-color'),
- (DRAWNS,u'fill-gradient-name'),
- (DRAWNS,u'gradient-step-count'),
- (DRAWNS,u'fill-hatch-name'),
- (DRAWNS,u'fill-hatch-solid'),
- (DRAWNS,u'fill-image-name'),
- (STYLENS,u'repeat'),
- (DRAWNS,u'fill-image-width'),
- (DRAWNS,u'fill-image-height'),
- (DRAWNS,u'fill-image-ref-point-x'),
- (DRAWNS,u'fill-image-ref-point-y'),
- (DRAWNS,u'fill-image-ref-point'),
- (DRAWNS,u'tile-repeat-offset'),
- (DRAWNS,u'opacity'),
- (DRAWNS,u'opacity-name'),
- (SVGNS,u'fill-rule'),
- (PRESENTATIONNS,u'transition-type'),
- (PRESENTATIONNS,u'transition-style'),
- (PRESENTATIONNS,u'transition-speed'),
- (SMILNS,u'type'),
- (SMILNS,u'subtype'),
- (SMILNS,u'direction'),
- (SMILNS,u'fadeColor'),
- (PRESENTATIONNS,u'duration'),
- (PRESENTATIONNS,u'visibility'),
- (DRAWNS,u'background-size'),
- (PRESENTATIONNS,u'background-objects-visible'),
- (PRESENTATIONNS,u'background-visible'),
- (PRESENTATIONNS,u'display-header'),
- (PRESENTATIONNS,u'display-footer'),
- (PRESENTATIONNS,u'display-page-number'),
- (PRESENTATIONNS,u'display-date-time'),
- ),
- (STYLENS,u'drop-cap'):(
- (STYLENS,u'distance'),
- (STYLENS,u'length'),
- (STYLENS,u'style-name'),
- (STYLENS,u'lines'),
- ),
-# allowed_attributes
- (STYLENS,u'font-face'):(
- (STYLENS,u'font-adornments'),
- (STYLENS,u'font-charset'),
- (STYLENS,u'font-family-generic'),
- (STYLENS,u'font-pitch'),
- (STYLENS,u'name'),
- (SVGNS,u'accent-height'),
- (SVGNS,u'alphabetic'),
- (SVGNS,u'ascent'),
- (SVGNS,u'bbox'),
- (SVGNS,u'cap-height'),
- (SVGNS,u'descent'),
- (SVGNS,u'font-family'),
- (SVGNS,u'font-size'),
- (SVGNS,u'font-stretch'),
- (SVGNS,u'font-style'),
- (SVGNS,u'font-variant'),
- (SVGNS,u'font-weight'),
- (SVGNS,u'hanging'),
- (SVGNS,u'ideographic'),
- (SVGNS,u'mathematical'),
- (SVGNS,u'overline-position'),
- (SVGNS,u'overline-thickness'),
- (SVGNS,u'panose-1'),
- (SVGNS,u'slope'),
- (SVGNS,u'stemh'),
- (SVGNS,u'stemv'),
- (SVGNS,u'strikethrough-position'),
- (SVGNS,u'strikethrough-thickness'),
- (SVGNS,u'underline-position'),
- (SVGNS,u'underline-thickness'),
- (SVGNS,u'unicode-range'),
- (SVGNS,u'units-per-em'),
- (SVGNS,u'v-alphabetic'),
- (SVGNS,u'v-hanging'),
- (SVGNS,u'v-ideographic'),
- (SVGNS,u'v-mathematical'),
- (SVGNS,u'widths'),
- (SVGNS,u'x-height'),
- ),
- (STYLENS,u'footer'):(
- (STYLENS,u'display'),
- ),
- (STYLENS,u'footer-left'):(
- (STYLENS,u'display'),
- ),
- (STYLENS,u'footer-style'):(
- ),
- (STYLENS,u'footnote-sep'):(
- (STYLENS,u'distance-after-sep'),
- (STYLENS,u'color'),
- (STYLENS,u'rel-width'),
- (STYLENS,u'width'),
- (STYLENS,u'distance-before-sep'),
- (STYLENS,u'line-style'),
- (STYLENS,u'adjustment'),
- ),
-# allowed_attributes
- (STYLENS,u'graphic-properties'): (
- (DR3DNS,u'ambient-color'),
- (DR3DNS,u'back-scale'),
- (DR3DNS,u'backface-culling'),
- (DR3DNS,u'close-back'),
- (DR3DNS,u'close-front'),
- (DR3DNS,u'depth'),
- (DR3DNS,u'diffuse-color'),
- (DR3DNS,u'edge-rounding'),
- (DR3DNS,u'edge-rounding-mode'),
- (DR3DNS,u'emissive-color'),
- (DR3DNS,u'end-angle'),
- (DR3DNS,u'horizontal-segments'),
- (DR3DNS,u'lighting-mode'),
- (DR3DNS,u'normals-direction'),
- (DR3DNS,u'normals-kind'),
- (DR3DNS,u'shadow'),
- (DR3DNS,u'shininess'),
- (DR3DNS,u'specular-color'),
- (DR3DNS,u'texture-filter'),
- (DR3DNS,u'texture-generation-mode-x'),
- (DR3DNS,u'texture-generation-mode-y'),
- (DR3DNS,u'texture-kind'),
- (DR3DNS,u'texture-mode'),
- (DR3DNS,u'vertical-segments'),
- (DRAWNS,u'auto-grow-height'),
- (DRAWNS,u'auto-grow-width'),
- (DRAWNS,u'blue'),
- (DRAWNS,u'caption-angle'),
- (DRAWNS,u'caption-angle-type'),
- (DRAWNS,u'caption-escape'),
- (DRAWNS,u'caption-escape-direction'),
- (DRAWNS,u'caption-fit-line-length'),
- (DRAWNS,u'caption-gap'),
- (DRAWNS,u'caption-line-length'),
- (DRAWNS,u'caption-type'),
- (DRAWNS,u'color-inversion'),
- (DRAWNS,u'color-mode'),
- (DRAWNS,u'contrast'),
- (DRAWNS,u'decimal-places'),
- (DRAWNS,u'draw-aspect'),
- (DRAWNS,u'end-guide'),
- (DRAWNS,u'end-line-spacing-horizontal'),
- (DRAWNS,u'end-line-spacing-vertical'),
- (DRAWNS,u'fill'),
- (DRAWNS,u'fill-color'),
- (DRAWNS,u'fill-gradient-name'),
- (DRAWNS,u'fill-hatch-name'),
- (DRAWNS,u'fill-hatch-solid'),
- (DRAWNS,u'fill-image-height'),
- (DRAWNS,u'fill-image-name'),
- (DRAWNS,u'fill-image-ref-point'),
- (DRAWNS,u'fill-image-ref-point-x'),
- (DRAWNS,u'fill-image-ref-point-y'),
- (DRAWNS,u'fill-image-width'),
-# allowed_attributes
- (DRAWNS,u'fit-to-contour'),
- (DRAWNS,u'fit-to-size'),
- (DRAWNS,u'frame-display-border'),
- (DRAWNS,u'frame-display-scrollbar'),
- (DRAWNS,u'frame-margin-horizontal'),
- (DRAWNS,u'frame-margin-vertical'),
- (DRAWNS,u'gamma'),
- (DRAWNS,u'gradient-step-count'),
- (DRAWNS,u'green'),
- (DRAWNS,u'guide-distance'),
- (DRAWNS,u'guide-overhang'),
- (DRAWNS,u'image-opacity'),
- (DRAWNS,u'line-distance'),
- (DRAWNS,u'luminance'),
- (DRAWNS,u'marker-end'),
- (DRAWNS,u'marker-end-center'),
- (DRAWNS,u'marker-end-width'),
- (DRAWNS,u'marker-start'),
- (DRAWNS,u'marker-start-center'),
- (DRAWNS,u'marker-start-width'),
- (DRAWNS,u'measure-align'),
- (DRAWNS,u'measure-vertical-align'),
- (DRAWNS,u'ole-draw-aspect'),
- (DRAWNS,u'opacity'),
- (DRAWNS,u'opacity-name'),
- (DRAWNS,u'parallel'),
- (DRAWNS,u'placing'),
- (DRAWNS,u'red'),
- (DRAWNS,u'secondary-fill-color'),
- (DRAWNS,u'shadow'),
- (DRAWNS,u'shadow-color'),
- (DRAWNS,u'shadow-offset-x'),
- (DRAWNS,u'shadow-offset-y'),
- (DRAWNS,u'shadow-opacity'),
- (DRAWNS,u'show-unit'),
- (DRAWNS,u'start-guide'),
- (DRAWNS,u'start-line-spacing-horizontal'),
- (DRAWNS,u'start-line-spacing-vertical'),
- (DRAWNS,u'stroke'),
- (DRAWNS,u'stroke-dash'),
- (DRAWNS,u'stroke-dash-names'),
- (DRAWNS,u'stroke-linejoin'),
- (DRAWNS,u'symbol-color'),
- (DRAWNS,u'textarea-horizontal-align'),
- (DRAWNS,u'textarea-vertical-align'),
- (DRAWNS,u'tile-repeat-offset'),
- (DRAWNS,u'unit'),
- (DRAWNS,u'visible-area-height'),
- (DRAWNS,u'visible-area-left'),
- (DRAWNS,u'visible-area-top'),
- (DRAWNS,u'visible-area-width'),
- (DRAWNS,u'wrap-influence-on-position'),
-# allowed_attributes
- (FONS,u'background-color'),
- (FONS,u'border'),
- (FONS,u'border-bottom'),
- (FONS,u'border-left'),
- (FONS,u'border-right'),
- (FONS,u'border-top'),
- (FONS,u'clip'),
- (FONS,u'margin'),
- (FONS,u'margin-bottom'),
- (FONS,u'margin-left'),
- (FONS,u'margin-right'),
- (FONS,u'margin-top'),
- (FONS,u'max-height'),
- (FONS,u'max-width'),
- (FONS,u'min-height'),
- (FONS,u'min-width'),
- (FONS,u'padding'),
- (FONS,u'padding-bottom'),
- (FONS,u'padding-left'),
- (FONS,u'padding-right'),
- (FONS,u'padding-top'),
- (FONS,u'wrap-option'),
- (STYLENS,u'background-transparency'),
- (STYLENS,u'border-line-width'),
- (STYLENS,u'border-line-width-bottom'),
- (STYLENS,u'border-line-width-left'),
- (STYLENS,u'border-line-width-right'),
- (STYLENS,u'border-line-width-top'),
- (STYLENS,u'editable'),
- (STYLENS,u'flow-with-text'),
- (STYLENS,u'horizontal-pos'),
- (STYLENS,u'horizontal-rel'),
- (STYLENS,u'mirror'),
- (STYLENS,u'number-wrapped-paragraphs'),
- (STYLENS,u'overflow-behavior'),
- (STYLENS,u'print-content'),
- (STYLENS,u'protect'),
- (STYLENS,u'rel-height'),
- (STYLENS,u'rel-width'),
- (STYLENS,u'repeat'),
- (STYLENS,u'run-through'),
- (STYLENS,u'shadow'),
- (STYLENS,u'shrink-to-fit'),
- (STYLENS,u'vertical-pos'),
- (STYLENS,u'vertical-rel'),
- (STYLENS,u'wrap'),
- (STYLENS,u'wrap-contour'),
- (STYLENS,u'wrap-contour-mode'),
- (STYLENS,u'wrap-dynamic-threshold'),
- (STYLENS,u'writing-mode'),
- (SVGNS,u'fill-rule'),
- (SVGNS,u'height'),
- (SVGNS,u'stroke-color'),
- (SVGNS,u'stroke-linecap'),
- (SVGNS,u'stroke-opacity'),
- (SVGNS,u'stroke-width'),
- (SVGNS,u'width'),
- (SVGNS,u'x'),
- (SVGNS,u'y'),
- (TEXTNS,u'anchor-page-number'),
- (TEXTNS,u'anchor-type'),
- (TEXTNS,u'animation'),
- (TEXTNS,u'animation-delay'),
- (TEXTNS,u'animation-direction'),
- (TEXTNS,u'animation-repeat'),
- (TEXTNS,u'animation-start-inside'),
- (TEXTNS,u'animation-steps'),
- (TEXTNS,u'animation-stop-inside'),
- ),
- (STYLENS,u'handout-master'):(
- (PRESENTATIONNS,u'presentation-page-layout-name'),
- (STYLENS,u'page-layout-name'),
- (PRESENTATIONNS,u'use-footer-name'),
- (DRAWNS,u'style-name'),
- (PRESENTATIONNS,u'use-header-name'),
- (PRESENTATIONNS,u'use-date-time-name'),
- ),
-# allowed_attributes
- (STYLENS,u'header'):(
- (STYLENS,u'display'),
- ),
- (STYLENS,u'header-footer-properties'): (
- (FONS,u'background-color'),
- (FONS,u'border'),
- (FONS,u'border-bottom'),
- (FONS,u'border-left'),
- (FONS,u'border-right'),
- (FONS,u'border-top'),
- (FONS,u'margin'),
- (FONS,u'margin-bottom'),
- (FONS,u'margin-left'),
- (FONS,u'margin-right'),
- (FONS,u'margin-top'),
- (FONS,u'min-height'),
- (FONS,u'padding'),
- (FONS,u'padding-bottom'),
- (FONS,u'padding-left'),
- (FONS,u'padding-right'),
- (FONS,u'padding-top'),
- (STYLENS,u'border-line-width'),
- (STYLENS,u'border-line-width-bottom'),
- (STYLENS,u'border-line-width-left'),
- (STYLENS,u'border-line-width-right'),
- (STYLENS,u'border-line-width-top'),
- (STYLENS,u'dynamic-spacing'),
- (STYLENS,u'shadow'),
- (SVGNS,u'height'),
- ),
- (STYLENS,u'header-left'):(
- (STYLENS,u'display'),
- ),
- (STYLENS,u'header-style'):(
- ),
- (STYLENS,u'list-level-label-alignment'):(
- (FONS,u'text-indent'),
- (TEXTNS,u'label-followed-by'),
- (TEXTNS,u'list-tab-stop-position'),
- (FONS,u'margin-left'),
- ),
-# allowed_attributes
- (STYLENS,u'list-level-properties'): (
- (FONS,u'height'),
- (FONS,u'text-align'),
- (FONS,u'width'),
- (STYLENS,u'font-name'),
- (STYLENS,u'vertical-pos'),
- (STYLENS,u'vertical-rel'),
- (SVGNS,u'y'),
- (TEXTNS,u'list-level-position-and-space-mode'),
- (TEXTNS,u'min-label-distance'),
- (TEXTNS,u'min-label-width'),
- (TEXTNS,u'space-before'),
- ),
- (STYLENS,u'map'):(
- (STYLENS,u'apply-style-name'),
- (STYLENS,u'base-cell-address'),
- (STYLENS,u'condition'),
- ),
- (STYLENS,u'master-page'):(
- (STYLENS,u'page-layout-name'),
- (STYLENS,u'display-name'),
- (DRAWNS,u'style-name'),
- (STYLENS,u'name'),
- (STYLENS,u'next-style-name'),
- ),
- (STYLENS,u'page-layout'):(
- (STYLENS,u'name'),
- (STYLENS,u'page-usage'),
- ),
-# allowed_attributes
- (STYLENS,u'page-layout-properties'): (
- (FONS,u'background-color'),
- (FONS,u'border'),
- (FONS,u'border-bottom'),
- (FONS,u'border-left'),
- (FONS,u'border-right'),
- (FONS,u'border-top'),
- (FONS,u'margin'),
- (FONS,u'margin-bottom'),
- (FONS,u'margin-left'),
- (FONS,u'margin-right'),
- (FONS,u'margin-top'),
- (FONS,u'padding'),
- (FONS,u'padding-bottom'),
- (FONS,u'padding-left'),
- (FONS,u'padding-right'),
- (FONS,u'padding-top'),
- (FONS,u'page-height'),
- (FONS,u'page-width'),
- (STYLENS,u'border-line-width'),
- (STYLENS,u'border-line-width-bottom'),
- (STYLENS,u'border-line-width-left'),
- (STYLENS,u'border-line-width-right'),
- (STYLENS,u'border-line-width-top'),
- (STYLENS,u'first-page-number'),
- (STYLENS,u'footnote-max-height'),
- (STYLENS,u'layout-grid-base-height'),
- (STYLENS,u'layout-grid-base-width'),
- (STYLENS,u'layout-grid-color'),
- (STYLENS,u'layout-grid-display'),
- (STYLENS,u'layout-grid-lines'),
- (STYLENS,u'layout-grid-mode'),
- (STYLENS,u'layout-grid-print'),
- (STYLENS,u'layout-grid-ruby-below'),
- (STYLENS,u'layout-grid-ruby-height'),
- (STYLENS,u'layout-grid-snap-to'),
- (STYLENS,u'layout-grid-standard-mode'),
- (STYLENS,u'num-format'),
- (STYLENS,u'num-letter-sync'),
- (STYLENS,u'num-prefix'),
- (STYLENS,u'num-suffix'),
- (STYLENS,u'paper-tray-name'),
- (STYLENS,u'print'),
- (STYLENS,u'print-orientation'),
- (STYLENS,u'print-page-order'),
- (STYLENS,u'register-truth-ref-style-name'),
- (STYLENS,u'scale-to'),
- (STYLENS,u'scale-to-pages'),
- (STYLENS,u'shadow'),
- (STYLENS,u'table-centering'),
- (STYLENS,u'writing-mode'),
- ),
-# allowed_attributes
- (STYLENS,u'paragraph-properties'): (
- (FONS,u'background-color'),
- (FONS,u'border'),
- (FONS,u'border-bottom'),
- (FONS,u'border-left'),
- (FONS,u'border-right'),
- (FONS,u'border-top'),
- (FONS,u'break-after'),
- (FONS,u'break-before'),
- (FONS,u'hyphenation-keep'),
- (FONS,u'hyphenation-ladder-count'),
- (FONS,u'keep-together'),
- (FONS,u'keep-with-next'),
- (FONS,u'line-height'),
- (FONS,u'margin'),
- (FONS,u'margin-bottom'),
- (FONS,u'margin-left'),
- (FONS,u'margin-right'),
- (FONS,u'margin-top'),
- (FONS,u'orphans'),
- (FONS,u'padding'),
- (FONS,u'padding-bottom'),
- (FONS,u'padding-left'),
- (FONS,u'padding-right'),
- (FONS,u'padding-top'),
- (FONS,u'text-align'),
- (FONS,u'text-align-last'),
- (FONS,u'text-indent'),
- (FONS,u'widows'),
- (STYLENS,u'auto-text-indent'),
- (STYLENS,u'background-transparency'),
- (STYLENS,u'border-line-width'),
- (STYLENS,u'border-line-width-bottom'),
- (STYLENS,u'border-line-width-left'),
- (STYLENS,u'border-line-width-right'),
- (STYLENS,u'border-line-width-top'),
- (STYLENS,u'font-independent-line-spacing'),
- (STYLENS,u'join-border'),
- (STYLENS,u'justify-single-word'),
- (STYLENS,u'line-break'),
- (STYLENS,u'line-height-at-least'),
- (STYLENS,u'line-spacing'),
- (STYLENS,u'page-number'),
- (STYLENS,u'punctuation-wrap'),
- (STYLENS,u'register-true'),
- (STYLENS,u'shadow'),
- (STYLENS,u'snap-to-layout-grid'),
- (STYLENS,u'tab-stop-distance'),
- (STYLENS,u'text-autospace'),
- (STYLENS,u'vertical-align'),
- (STYLENS,u'writing-mode'),
- (STYLENS,u'writing-mode-automatic'),
- (TEXTNS,u'line-number'),
- (TEXTNS,u'number-lines'),
- ),
- (STYLENS,u'presentation-page-layout'):(
- (STYLENS,u'display-name'),
- (STYLENS,u'name'),
- ),
-# allowed_attributes
- (STYLENS,u'region-center'):(
- ),
- (STYLENS,u'region-left'):(
- ),
- (STYLENS,u'region-right'):(
- ),
- (STYLENS,u'ruby-properties'): (
- (STYLENS,u'ruby-position'),
- (STYLENS,u'ruby-align'),
- ),
- (STYLENS,u'section-properties'): (
- (FONS,u'background-color'),
- (FONS,u'margin-left'),
- (FONS,u'margin-right'),
- (STYLENS,u'editable'),
- (STYLENS,u'protect'),
- (STYLENS,u'writing-mode'),
- (TEXTNS,u'dont-balance-text-columns'),
- ),
- (STYLENS,u'style'):(
- (STYLENS,u'auto-update'),
- (STYLENS,u'class'),
- (STYLENS,u'data-style-name'),
- (STYLENS,u'default-outline-level'),
- (STYLENS,u'display-name'),
- (STYLENS,u'family'),
- (STYLENS,u'list-level'),
- (STYLENS,u'list-style-name'),
- (STYLENS,u'master-page-name'),
- (STYLENS,u'name'),
- (STYLENS,u'next-style-name'),
- (STYLENS,u'parent-style-name'),
- (STYLENS,u'percentage-data-style-name'),
- ),
-# allowed_attributes
- (STYLENS,u'tab-stop'):(
- (STYLENS,u'leader-text-style'),
- (STYLENS,u'leader-width'),
- (STYLENS,u'leader-style'),
- (STYLENS,u'char'),
- (STYLENS,u'leader-color'),
- (STYLENS,u'position'),
- (STYLENS,u'leader-text'),
- (STYLENS,u'type'),
- (STYLENS,u'leader-type'),
- ),
- (STYLENS,u'tab-stops'):(
- ),
- (STYLENS,u'table-cell-properties'): (
- (FONS,u'background-color'),
- (FONS,u'border'),
- (FONS,u'border-bottom'),
- (FONS,u'border-left'),
- (FONS,u'border-right'),
- (FONS,u'border-top'),
- (FONS,u'padding'),
- (FONS,u'padding-bottom'),
- (FONS,u'padding-left'),
- (FONS,u'padding-right'),
- (FONS,u'padding-top'),
- (FONS,u'wrap-option'),
- (STYLENS,u'border-line-width'),
- (STYLENS,u'border-line-width-bottom'),
- (STYLENS,u'border-line-width-left'),
- (STYLENS,u'border-line-width-right'),
- (STYLENS,u'border-line-width-top'),
- (STYLENS,u'cell-protect'),
- (STYLENS,u'decimal-places'),
- (STYLENS,u'diagonal-bl-tr'),
- (STYLENS,u'diagonal-bl-tr-widths'),
- (STYLENS,u'diagonal-tl-br'),
- (STYLENS,u'diagonal-tl-br-widths'),
- (STYLENS,u'direction'),
- (STYLENS,u'glyph-orientation-vertical'),
- (STYLENS,u'print-content'),
- (STYLENS,u'repeat-content'),
- (STYLENS,u'rotation-align'),
- (STYLENS,u'rotation-angle'),
- (STYLENS,u'shadow'),
- (STYLENS,u'shrink-to-fit'),
- (STYLENS,u'text-align-source'),
- (STYLENS,u'vertical-align'),
- (STYLENS,u'writing-mode'),
- ),
-# allowed_attributes
- (STYLENS,u'table-column-properties'): (
- (FONS,u'break-after'),
- (FONS,u'break-before'),
- (STYLENS,u'column-width'),
- (STYLENS,u'rel-column-width'),
- (STYLENS,u'use-optimal-column-width'),
- ),
- (STYLENS,u'table-properties'): (
- (FONS,u'background-color'),
- (FONS,u'break-after'),
- (FONS,u'break-before'),
- (FONS,u'keep-with-next'),
- (FONS,u'margin'),
- (FONS,u'margin-bottom'),
- (FONS,u'margin-left'),
- (FONS,u'margin-right'),
- (FONS,u'margin-top'),
- (STYLENS,u'may-break-between-rows'),
- (STYLENS,u'page-number'),
- (STYLENS,u'rel-width'),
- (STYLENS,u'shadow'),
- (STYLENS,u'width'),
- (STYLENS,u'writing-mode'),
- (TABLENS,u'align'),
- (TABLENS,u'border-model'),
- (TABLENS,u'display'),
- ),
- (STYLENS,u'table-row-properties'): (
- (FONS,u'background-color'),
- (FONS,u'break-after'),
- (FONS,u'break-before'),
- (FONS,u'keep-together'),
- (STYLENS,u'min-row-height'),
- (STYLENS,u'row-height'),
- (STYLENS,u'use-optimal-row-height'),
- ),
-# allowed_attributes
- (STYLENS,u'text-properties'): (
- (FONS,u'background-color'),
- (FONS,u'color'),
- (FONS,u'country'),
- (FONS,u'font-family'),
- (FONS,u'font-size'),
- (FONS,u'font-style'),
- (FONS,u'font-variant'),
- (FONS,u'font-weight'),
- (FONS,u'hyphenate'),
- (FONS,u'hyphenation-push-char-count'),
- (FONS,u'hyphenation-remain-char-count'),
- (FONS,u'language'),
- (FONS,u'letter-spacing'),
- (FONS,u'script'),
- (FONS,u'text-shadow'),
- (FONS,u'text-transform'),
- (STYLENS,u'country-asian'),
- (STYLENS,u'country-complex'),
- (STYLENS,u'font-charset'),
- (STYLENS,u'font-charset-asian'),
- (STYLENS,u'font-charset-complex'),
- (STYLENS,u'font-family-asian'),
- (STYLENS,u'font-family-complex'),
- (STYLENS,u'font-family-generic'),
- (STYLENS,u'font-family-generic-asian'),
- (STYLENS,u'font-family-generic-complex'),
- (STYLENS,u'font-name'),
- (STYLENS,u'font-name-asian'),
- (STYLENS,u'font-name-complex'),
- (STYLENS,u'font-pitch'),
- (STYLENS,u'font-pitch-asian'),
- (STYLENS,u'font-pitch-complex'),
- (STYLENS,u'font-relief'),
- (STYLENS,u'font-size-asian'),
- (STYLENS,u'font-size-complex'),
- (STYLENS,u'font-size-rel'),
- (STYLENS,u'font-size-rel-asian'),
- (STYLENS,u'font-size-rel-complex'),
- (STYLENS,u'font-style-asian'),
- (STYLENS,u'font-style-complex'),
- (STYLENS,u'font-style-name'),
- (STYLENS,u'font-style-name-asian'),
- (STYLENS,u'font-style-name-complex'),
- (STYLENS,u'font-weight-asian'),
- (STYLENS,u'font-weight-complex'),
- (STYLENS,u'language-asian'),
- (STYLENS,u'language-complex'),
- (STYLENS,u'letter-kerning'),
- (STYLENS,u'rfc-language-tag'),
- (STYLENS,u'rfc-language-tag-asian'),
- (STYLENS,u'rfc-language-tag-complex'),
- (STYLENS,u'script-asian'),
- (STYLENS,u'script-complex'),
- (STYLENS,u'script-type'),
- (STYLENS,u'text-blinking'),
- (STYLENS,u'text-combine'),
- (STYLENS,u'text-combine-end-char'),
- (STYLENS,u'text-combine-start-char'),
- (STYLENS,u'text-emphasize'),
- (STYLENS,u'text-line-through-color'),
- (STYLENS,u'text-line-through-mode'),
- (STYLENS,u'text-line-through-style'),
- (STYLENS,u'text-line-through-text'),
- (STYLENS,u'text-line-through-text-style'),
- (STYLENS,u'text-line-through-type'),
- (STYLENS,u'text-line-through-width'),
- (STYLENS,u'text-outline'),
- (STYLENS,u'text-overline-color'),
- (STYLENS,u'text-overline-mode'),
- (STYLENS,u'text-overline-style'),
- (STYLENS,u'text-overline-type'),
- (STYLENS,u'text-overline-width'),
- (STYLENS,u'text-position'),
- (STYLENS,u'text-rotation-angle'),
- (STYLENS,u'text-rotation-scale'),
- (STYLENS,u'text-scale'),
- (STYLENS,u'text-underline-color'),
- (STYLENS,u'text-underline-mode'),
- (STYLENS,u'text-underline-style'),
- (STYLENS,u'text-underline-type'),
- (STYLENS,u'text-underline-width'),
- (STYLENS,u'use-window-font-color'),
- (TEXTNS,u'condition'),
- (TEXTNS,u'display'),
- ),
- (SVGNS,u'definition-src'):(
- (XLINKNS,u'actuate'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (SVGNS,u'desc'):(
- ),
- (SVGNS,u'font-face-format'):(
- (SVGNS,u'string'),
- ),
-# allowed_attributes
- (SVGNS,u'font-face-name'):(
- (SVGNS,u'name'),
- ),
- (SVGNS,u'font-face-src'):(
- ),
- (SVGNS,u'font-face-uri'):(
- (XLINKNS,u'actuate'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (SVGNS,u'linearGradient'):(
- (SVGNS,u'y2'),
- (DRAWNS,u'name'),
- (SVGNS,u'spreadMethod'),
- (SVGNS,u'gradientUnits'),
- (SVGNS,u'x2'),
- (SVGNS,u'gradientTransform'),
- (SVGNS,u'y1'),
- (DRAWNS,u'display-name'),
- (SVGNS,u'x1'),
- ),
- (SVGNS,u'radialGradient'):(
- (DRAWNS,u'name'),
- (SVGNS,u'fx'),
- (SVGNS,u'fy'),
- (SVGNS,u'spreadMethod'),
- (SVGNS,u'gradientUnits'),
- (SVGNS,u'cy'),
- (SVGNS,u'cx'),
- (SVGNS,u'gradientTransform'),
- (DRAWNS,u'display-name'),
- (SVGNS,u'r'),
- ),
- (SVGNS,u'stop'):(
- (SVGNS,u'stop-color'),
- (SVGNS,u'stop-opacity'),
- (SVGNS,u'offset'),
- ),
- (SVGNS,u'title'):(
- ),
-# allowed_attributes
- (TABLENS,u'background'):(
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'body'):(
- (TABLENS,u'paragraph-style-name'),
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'calculation-settings'):(
- (TABLENS,u'automatic-find-labels'),
- (TABLENS,u'case-sensitive'),
- (TABLENS,u'search-criteria-must-apply-to-whole-cell'),
- (TABLENS,u'precision-as-shown'),
- (TABLENS,u'use-regular-expressions'),
- (TABLENS,u'use-wildcards'),
- (TABLENS,u'null-year'),
- ),
- (TABLENS,u'cell-address'):(
- (TABLENS,u'column'),
- (TABLENS,u'table'),
- (TABLENS,u'row'),
- ),
- (TABLENS,u'cell-content-change'):(
- (TABLENS,u'id'),
- (TABLENS,u'rejecting-change-id'),
- (TABLENS,u'acceptance-state'),
- ),
-# allowed_attributes
- (TABLENS,u'cell-content-deletion'):(
- (TABLENS,u'id'),
- ),
- (TABLENS,u'cell-range-source'):(
- (TABLENS,u'last-row-spanned'),
- (TABLENS,u'last-column-spanned'),
- (TABLENS,u'name'),
- (TABLENS,u'filter-options'),
- (XLINKNS,u'actuate'),
- (TABLENS,u'filter-name'),
- (XLINKNS,u'href'),
- (TABLENS,u'refresh-delay'),
- (XLINKNS,u'type'),
- ),
- (TABLENS,u'change-deletion'):(
- (TABLENS,u'id'),
- ),
- (TABLENS,u'change-track-table-cell'):(
- (OFFICENS,u'string-value'),
- (TABLENS,u'cell-address'),
- (TABLENS,u'number-matrix-columns-spanned'),
- (TABLENS,u'number-matrix-rows-spanned'),
- (TABLENS,u'matrix-covered'),
- (OFFICENS,u'value-type'),
- (OFFICENS,u'boolean-value'),
- (OFFICENS,u'currency'),
- (OFFICENS,u'date-value'),
- (OFFICENS,u'value'),
- (TABLENS,u'formula'),
- (OFFICENS,u'time-value'),
- ),
- (TABLENS,u'consolidation'):(
- (TABLENS,u'function'),
- (TABLENS,u'source-cell-range-addresses'),
- (TABLENS,u'target-cell-address'),
- (TABLENS,u'link-to-source-data'),
- (TABLENS,u'use-labels'),
- ),
- (TABLENS,u'content-validation'):(
- (TABLENS,u'base-cell-address'),
- (TABLENS,u'display-list'),
- (TABLENS,u'allow-empty-cell'),
- (TABLENS,u'name'),
- (TABLENS,u'condition'),
- ),
- (TABLENS,u'content-validations'):(
- ),
-# allowed_attributes
- (TABLENS,u'covered-table-cell'):(
- (OFFICENS,u'boolean-value'),
- (OFFICENS,u'currency'),
- (OFFICENS,u'date-value'),
- (OFFICENS,u'string-value'),
- (OFFICENS,u'time-value'),
- (OFFICENS,u'value'),
- (OFFICENS,u'value-type'),
- (TABLENS,u'content-validation-name'),
- (TABLENS,u'formula'),
- (TABLENS,u'number-columns-repeated'),
- (TABLENS,u'protect'),
- (TABLENS,u'protected'),
- (TABLENS,u'style-name'),
- (XHTMLNS,u'about'),
- (XHTMLNS,u'content'),
- (XHTMLNS,u'datatype'),
- (XHTMLNS,u'property'),
- (XMLNS,u'id'),
- ),
- (TABLENS,u'cut-offs'):(
- ),
- (TABLENS,u'data-pilot-display-info'):(
- (TABLENS,u'member-count'),
- (TABLENS,u'data-field'),
- (TABLENS,u'enabled'),
- (TABLENS,u'display-member-mode'),
- ),
- (TABLENS,u'data-pilot-field'):(
- (TABLENS,u'selected-page'),
- (TABLENS,u'function'),
- (TABLENS,u'orientation'),
- (TABLENS,u'used-hierarchy'),
- (TABLENS,u'is-data-layout-field'),
- (TABLENS,u'source-field-name'),
- ),
- (TABLENS,u'data-pilot-field-reference'):(
- (TABLENS,u'member-name'),
- (TABLENS,u'field-name'),
- (TABLENS,u'member-type'),
- (TABLENS,u'type'),
- ),
-# allowed_attributes
- (TABLENS,u'data-pilot-group'):(
- (TABLENS,u'name'),
- ),
- (TABLENS,u'data-pilot-group-member'):(
- (TABLENS,u'name'),
- ),
- (TABLENS,u'data-pilot-groups'):(
- (TABLENS,u'date-end'),
- (TABLENS,u'end'),
- (TABLENS,u'start'),
- (TABLENS,u'source-field-name'),
- (TABLENS,u'step'),
- (TABLENS,u'date-start'),
- (TABLENS,u'grouped-by'),
- ),
- (TABLENS,u'data-pilot-layout-info'):(
- (TABLENS,u'add-empty-lines'),
- (TABLENS,u'layout-mode'),
- ),
- (TABLENS,u'data-pilot-level'):(
- (TABLENS,u'show-empty'),
- ),
-# allowed_attributes
- (TABLENS,u'data-pilot-member'):(
- (TABLENS,u'show-details'),
- (TABLENS,u'name'),
- (TABLENS,u'display'),
- ),
- (TABLENS,u'data-pilot-members'):(
- ),
- (TABLENS,u'data-pilot-sort-info'):(
- (TABLENS,u'data-field'),
- (TABLENS,u'sort-mode'),
- (TABLENS,u'order'),
- ),
- (TABLENS,u'data-pilot-subtotal'):(
- (TABLENS,u'function'),
- ),
- (TABLENS,u'data-pilot-subtotals'):(
- ),
- (TABLENS,u'data-pilot-table'):(
- (TABLENS,u'buttons'),
- (TABLENS,u'application-data'),
- (TABLENS,u'name'),
- (TABLENS,u'drill-down-on-double-click'),
- (TABLENS,u'target-range-address'),
- (TABLENS,u'ignore-empty-rows'),
- (TABLENS,u'identify-categories'),
- (TABLENS,u'show-filter-button'),
- (TABLENS,u'grand-total'),
- ),
-# allowed_attributes
- (TABLENS,u'data-pilot-tables'):(
- ),
- (TABLENS,u'database-range'):(
- (TABLENS,u'orientation'),
- (TABLENS,u'target-range-address'),
- (TABLENS,u'contains-header'),
- (TABLENS,u'on-update-keep-size'),
- (TABLENS,u'name'),
- (TABLENS,u'is-selection'),
- (TABLENS,u'refresh-delay'),
- (TABLENS,u'display-filter-buttons'),
- (TABLENS,u'has-persistent-data'),
- (TABLENS,u'on-update-keep-styles'),
- ),
- (TABLENS,u'database-ranges'):(
- ),
- (TABLENS,u'database-source-query'):(
- (TABLENS,u'query-name'),
- (TABLENS,u'database-name'),
- ),
-# allowed_attributes
- (TABLENS,u'database-source-sql'):(
- (TABLENS,u'parse-sql-statement'),
- (TABLENS,u'database-name'),
- (TABLENS,u'sql-statement'),
- ),
- (TABLENS,u'database-source-table'):(
- (TABLENS,u'database-table-name'),
- (TABLENS,u'database-name'),
- ),
- (TABLENS,u'dde-link'):(
- ),
- (TABLENS,u'dde-links'):(
- ),
- (TABLENS,u'deletion'):(
- (TABLENS,u'rejecting-change-id'),
- (TABLENS,u'multi-deletion-spanned'),
- (TABLENS,u'acceptance-state'),
- (TABLENS,u'table'),
- (TABLENS,u'position'),
- (TABLENS,u'type'),
- (TABLENS,u'id'),
- ),
-# allowed_attributes
- (TABLENS,u'deletions'):(
- ),
- (TABLENS,u'dependencies'):(
- ),
- (TABLENS,u'dependency'):(
- (TABLENS,u'id'),
- ),
- (TABLENS,u'desc'):(
- ),
- (TABLENS,u'detective'):(
- ),
- (TABLENS,u'error-macro'):(
- (TABLENS,u'execute'),
- ),
- (TABLENS,u'error-message'):(
- (TABLENS,u'display'),
- (TABLENS,u'message-type'),
- (TABLENS,u'title'),
- ),
- (TABLENS,u'even-columns'):(
- (TABLENS,u'paragraph-style-name'),
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'even-rows'):(
- (TABLENS,u'paragraph-style-name'),
- (TABLENS,u'style-name'),
- ),
-# allowed_attributes
- (TABLENS,u'filter'):(
- (TABLENS,u'target-range-address'),
- (TABLENS,u'display-duplicates'),
- (TABLENS,u'condition-source-range-address'),
- (TABLENS,u'condition-source'),
- ),
- (TABLENS,u'filter-and'):(
- ),
- (TABLENS,u'filter-condition'):(
- (TABLENS,u'operator'),
- (TABLENS,u'field-number'),
- (TABLENS,u'data-type'),
- (TABLENS,u'case-sensitive'),
- (TABLENS,u'value'),
- ),
- (TABLENS,u'filter-or'):(
- ),
-# allowed_attributes
- (TABLENS,u'filter-set-item'):(
- (TABLENS,u'value'),
- ),
- (TABLENS,u'first-column'):(
- (TABLENS,u'paragraph-style-name'),
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'first-row'):(
- (TABLENS,u'paragraph-style-name'),
- (TABLENS,u'style-name'),
- ),
-# allowed_attributes
- (TABLENS,u'help-message'):(
- (TABLENS,u'display'),
- (TABLENS,u'title'),
- ),
- (TABLENS,u'highlighted-range'):(
- (TABLENS,u'contains-error'),
- (TABLENS,u'direction'),
- (TABLENS,u'marked-invalid'),
- (TABLENS,u'cell-range-address'),
- ),
- (TABLENS,u'insertion'):(
- (TABLENS,u'count'),
- (TABLENS,u'rejecting-change-id'),
- (TABLENS,u'acceptance-state'),
- (TABLENS,u'table'),
- (TABLENS,u'position'),
- (TABLENS,u'type'),
- (TABLENS,u'id'),
- ),
- (TABLENS,u'insertion-cut-off'):(
- (TABLENS,u'position'),
- (TABLENS,u'id'),
- ),
- (TABLENS,u'iteration'):(
- (TABLENS,u'status'),
- (TABLENS,u'maximum-difference'),
- (TABLENS,u'steps'),
- ),
-# allowed_attributes
- (TABLENS,u'label-range'):(
- (TABLENS,u'label-cell-range-address'),
- (TABLENS,u'data-cell-range-address'),
- (TABLENS,u'orientation'),
- ),
- (TABLENS,u'label-ranges'):(
- ),
- (TABLENS,u'last-column'):(
- (TABLENS,u'paragraph-style-name'),
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'last-row'):(
- (TABLENS,u'paragraph-style-name'),
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'movement'):(
- (TABLENS,u'id'),
- (TABLENS,u'rejecting-change-id'),
- (TABLENS,u'acceptance-state'),
- ),
- (TABLENS,u'movement-cut-off'):(
- (TABLENS,u'position'),
- (TABLENS,u'end-position'),
- (TABLENS,u'start-position'),
- ),
- (TABLENS,u'named-expression'):(
- (TABLENS,u'base-cell-address'),
- (TABLENS,u'expression'),
- (TABLENS,u'name'),
- ),
- (TABLENS,u'named-expressions'):(
- ),
- (TABLENS,u'named-range'):(
- (TABLENS,u'range-usable-as'),
- (TABLENS,u'base-cell-address'),
- (TABLENS,u'name'),
- (TABLENS,u'cell-range-address'),
- ),
- (TABLENS,u'null-date'):(
- (TABLENS,u'date-value'),
- (TABLENS,u'value-type'),
- ),
- (TABLENS,u'odd-columns'):(
- (TABLENS,u'paragraph-style-name'),
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'odd-rows'):(
- (TABLENS,u'paragraph-style-name'),
- (TABLENS,u'style-name'),
- ),
- (TABLENS,u'operation'):(
- (TABLENS,u'index'),
- (TABLENS,u'name'),
- ),
- (TABLENS,u'previous'):(
- (TABLENS,u'id'),
- ),
- (TABLENS,u'scenario'):(
- (TABLENS,u'comment'),
- (TABLENS,u'border-color'),
- (TABLENS,u'copy-back'),
- (TABLENS,u'is-active'),
- (TABLENS,u'protected'),
- (TABLENS,u'copy-formulas'),
- (TABLENS,u'copy-styles'),
- (TABLENS,u'scenario-ranges'),
- (TABLENS,u'display-border'),
- ),
- (TABLENS,u'shapes'):(
- ),
-# allowed_attributes
- (TABLENS,u'sort'):(
- (TABLENS,u'case-sensitive'),
- (TABLENS,u'embedded-number-behavior'),
- (TABLENS,u'algorithm'),
- (TABLENS,u'target-range-address'),
- (TABLENS,u'country'),
- (TABLENS,u'language'),
- (TABLENS,u'bind-styles-to-content'),
- (TABLENS,u'rfc-language-tag'),
- (TABLENS,u'script'),
- ),
- (TABLENS,u'sort-by'):(
- (TABLENS,u'field-number'),
- (TABLENS,u'data-type'),
- (TABLENS,u'order'),
- ),
- (TABLENS,u'sort-groups'):(
- (TABLENS,u'data-type'),
- (TABLENS,u'order'),
- ),
- (TABLENS,u'source-cell-range'):(
- (TABLENS,u'cell-range-address'),
- ),
- (TABLENS,u'source-range-address'):(
- (TABLENS,u'column'),
- (TABLENS,u'end-column'),
- (TABLENS,u'start-table'),
- (TABLENS,u'end-row'),
- (TABLENS,u'table'),
- (TABLENS,u'start-row'),
- (TABLENS,u'row'),
- (TABLENS,u'end-table'),
- (TABLENS,u'start-column'),
- ),
-# allowed_attributes
- (TABLENS,u'source-service'):(
- (TABLENS,u'user-name'),
- (TABLENS,u'source-name'),
- (TABLENS,u'password'),
- (TABLENS,u'object-name'),
- (TABLENS,u'name'),
- ),
- (TABLENS,u'subtotal-field'):(
- (TABLENS,u'function'),
- (TABLENS,u'field-number'),
- ),
- (TABLENS,u'subtotal-rule'):(
- (TABLENS,u'group-by-field-number'),
- ),
- (TABLENS,u'subtotal-rules'):(
- (TABLENS,u'bind-styles-to-content'),
- (TABLENS,u'page-breaks-on-group-change'),
- (TABLENS,u'case-sensitive'),
- ),
- (TABLENS,u'table'):(
- (TABLENS,u'is-sub-table'),
- (TABLENS,u'name'),
- (TABLENS,u'print'),
- (TABLENS,u'print-ranges'),
- (TABLENS,u'protected'),
- (TABLENS,u'protection-key'),
- (TABLENS,u'protection-key-digest-algorithm'),
- (TABLENS,u'style-name'),
- (TABLENS,u'template-name'),
- (TABLENS,u'use-banding-columns-styles'),
- (TABLENS,u'use-banding-rows-styles'),
- (TABLENS,u'use-first-column-styles'),
- (TABLENS,u'use-first-row-styles'),
- (TABLENS,u'use-last-column-styles'),
- (TABLENS,u'use-last-row-styles'),
- (XMLNS,u'id'),
- ),
- (TABLENS,u'table-cell'):(
- (OFFICENS,u'boolean-value'),
- (OFFICENS,u'currency'),
- (OFFICENS,u'date-value'),
- (OFFICENS,u'string-value'),
- (OFFICENS,u'time-value'),
- (OFFICENS,u'value'),
- (OFFICENS,u'value-type'),
- (TABLENS,u'content-validation-name'),
- (TABLENS,u'formula'),
- (TABLENS,u'number-columns-repeated'),
- (TABLENS,u'number-columns-spanned'),
- (TABLENS,u'number-matrix-columns-spanned'),
- (TABLENS,u'number-matrix-rows-spanned'),
- (TABLENS,u'number-rows-spanned'),
- (TABLENS,u'protect'),
- (TABLENS,u'protected'),
- (TABLENS,u'style-name'),
- (XHTMLNS,u'about'),
- (XHTMLNS,u'content'),
- (XHTMLNS,u'datatype'),
- (XHTMLNS,u'property'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (TABLENS,u'table-column'):(
- (TABLENS,u'style-name'),
- (TABLENS,u'default-cell-style-name'),
- (TABLENS,u'visibility'),
- (TABLENS,u'number-columns-repeated'),
- (XMLNS,u'id'),
- ),
- (TABLENS,u'table-column-group'):(
- (TABLENS,u'display'),
- ),
- (TABLENS,u'table-columns'):(
- ),
- (TABLENS,u'table-header-columns'):(
- ),
- (TABLENS,u'table-header-rows'):(
- ),
- (TABLENS,u'table-row'):(
- (TABLENS,u'number-rows-repeated'),
- (TABLENS,u'style-name'),
- (TABLENS,u'visibility'),
- (TABLENS,u'default-cell-style-name'),
- (XMLNS,u'id'),
- ),
- (TABLENS,u'table-row-group'):(
- (TABLENS,u'display'),
- ),
- (TABLENS,u'table-rows'):(
- ),
- (TABLENS,u'table-source'):(
- (TABLENS,u'filter-options'),
- (XLINKNS,u'actuate'),
- (TABLENS,u'filter-name'),
- (XLINKNS,u'href'),
- (TABLENS,u'mode'),
- (TABLENS,u'table-name'),
- (XLINKNS,u'type'),
- (TABLENS,u'refresh-delay'),
- ),
-# allowed_attributes
- (TABLENS,u'table-template'):(
- (TABLENS,u'last-row-end-column'),
- (TABLENS,u'first-row-end-column'),
- (TABLENS,u'name'),
- (TABLENS,u'last-row-start-column'),
- (TABLENS,u'first-row-start-column'),
- ),
- (TABLENS,u'target-range-address'):(
- (TABLENS,u'column'),
- (TABLENS,u'end-column'),
- (TABLENS,u'start-table'),
- (TABLENS,u'end-row'),
- (TABLENS,u'table'),
- (TABLENS,u'start-row'),
- (TABLENS,u'row'),
- (TABLENS,u'end-table'),
- (TABLENS,u'start-column'),
- ),
- (TABLENS,u'title'):(
- ),
- (TABLENS,u'tracked-changes'):(
- (TABLENS,u'track-changes'),
- ),
-# allowed_attributes
- (TEXTNS,u'a'):(
- (OFFICENS,u'name'),
- (OFFICENS,u'target-frame-name'),
- (OFFICENS,u'title'),
- (TEXTNS,u'style-name'),
- (TEXTNS,u'visited-style-name'),
- (XLINKNS,u'actuate'),
- (XLINKNS,u'href'),
- (XLINKNS,u'show'),
- (XLINKNS,u'type'),
- ),
- (TEXTNS,u'alphabetical-index'):(
- (TEXTNS,u'name'),
- (TEXTNS,u'protected'),
- (TEXTNS,u'protection-key'),
- (TEXTNS,u'protection-key-digest-algorithm'),
- (TEXTNS,u'style-name'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'alphabetical-index-auto-mark-file'):(
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- ),
- (TEXTNS,u'alphabetical-index-entry-template'):(
- (TEXTNS,u'style-name'),
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'alphabetical-index-mark'):(
- (TEXTNS,u'main-entry'),
- (TEXTNS,u'key1-phonetic'),
- (TEXTNS,u'key2'),
- (TEXTNS,u'key1'),
- (TEXTNS,u'string-value'),
- (TEXTNS,u'key2-phonetic'),
- (TEXTNS,u'string-value-phonetic'),
- ),
-# allowed_attributes
- (TEXTNS,u'alphabetical-index-mark-end'):(
- (TEXTNS,u'id'),
- ),
- (TEXTNS,u'alphabetical-index-mark-start'):(
- (TEXTNS,u'main-entry'),
- (TEXTNS,u'key1-phonetic'),
- (TEXTNS,u'key2'),
- (TEXTNS,u'key1'),
- (TEXTNS,u'string-value-phonetic'),
- (TEXTNS,u'key2-phonetic'),
- (TEXTNS,u'id'),
- ),
- (TEXTNS,u'alphabetical-index-source'):(
- (FONS,u'country'),
- (FONS,u'language'),
- (FONS,u'script'),
- (STYLENS,u'rfc-language-tag'),
- (TEXTNS,u'alphabetical-separators'),
- (TEXTNS,u'capitalize-entries'),
- (TEXTNS,u'combine-entries'),
- (TEXTNS,u'combine-entries-with-dash'),
- (TEXTNS,u'combine-entries-with-pp'),
- (TEXTNS,u'comma-separated'),
- (TEXTNS,u'ignore-case'),
- (TEXTNS,u'index-scope'),
- (TEXTNS,u'main-entry-style-name'),
- (TEXTNS,u'relative-tab-stop-position'),
- (TEXTNS,u'sort-algorithm'),
- (TEXTNS,u'use-keys-as-entries'),
- ),
-# allowed_attributes
- (TEXTNS,u'author-initials'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'author-name'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'bibliography'):(
- (TEXTNS,u'protected'),
- (TEXTNS,u'style-name'),
- (TEXTNS,u'name'),
- (TEXTNS,u'protection-key'),
- (TEXTNS,u'protection-key-digest-algorithm'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'bibliography-configuration'):(
- (FONS,u'country'),
- (FONS,u'language'),
- (FONS,u'script'),
- (STYLENS,u'rfc-language-tag'),
- (TEXTNS,u'numbered-entries'),
- (TEXTNS,u'prefix'),
- (TEXTNS,u'sort-algorithm'),
- (TEXTNS,u'sort-by-position'),
- (TEXTNS,u'suffix'),
- ),
- (TEXTNS,u'bibliography-entry-template'):(
- (TEXTNS,u'style-name'),
- (TEXTNS,u'bibliography-type'),
- ),
-# allowed_attributes
- (TEXTNS,u'bibliography-mark'):(
- (TEXTNS,u'address'),
- (TEXTNS,u'annote'),
- (TEXTNS,u'author'),
- (TEXTNS,u'bibliography-type'),
- (TEXTNS,u'booktitle'),
- (TEXTNS,u'chapter'),
- (TEXTNS,u'custom1'),
- (TEXTNS,u'custom2'),
- (TEXTNS,u'custom3'),
- (TEXTNS,u'custom4'),
- (TEXTNS,u'custom5'),
- (TEXTNS,u'edition'),
- (TEXTNS,u'editor'),
- (TEXTNS,u'howpublished'),
- (TEXTNS,u'identifier'),
- (TEXTNS,u'institution'),
- (TEXTNS,u'isbn'),
- (TEXTNS,u'issn'),
- (TEXTNS,u'journal'),
- (TEXTNS,u'month'),
- (TEXTNS,u'note'),
- (TEXTNS,u'number'),
- (TEXTNS,u'organizations'),
- (TEXTNS,u'pages'),
- (TEXTNS,u'publisher'),
- (TEXTNS,u'report-type'),
- (TEXTNS,u'school'),
- (TEXTNS,u'series'),
- (TEXTNS,u'title'),
- (TEXTNS,u'url'),
- (TEXTNS,u'volume'),
- (TEXTNS,u'year'),
- ),
- (TEXTNS,u'bibliography-source'):(
- ),
- (TEXTNS,u'bookmark'):(
- (TEXTNS,u'name'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'bookmark-end'):(
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'bookmark-ref'):(
- (TEXTNS,u'ref-name'),
- (TEXTNS,u'reference-format'),
- ),
- (TEXTNS,u'bookmark-start'):(
- (XHTMLNS,u'about'),
- (XHTMLNS,u'content'),
- (XHTMLNS,u'datatype'),
- (XHTMLNS,u'property'),
- (TEXTNS,u'name'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (TEXTNS,u'change'):(
- (TEXTNS,u'change-id'),
- ),
- (TEXTNS,u'change-end'):(
- (TEXTNS,u'change-id'),
- ),
- (TEXTNS,u'change-start'):(
- (TEXTNS,u'change-id'),
- ),
- (TEXTNS,u'changed-region'):(
- (TEXTNS,u'id'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'chapter'):(
- (TEXTNS,u'display'),
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'conditional-text'):(
- (TEXTNS,u'string-value-if-true'),
- (TEXTNS,u'current-value'),
- (TEXTNS,u'string-value-if-false'),
- (TEXTNS,u'condition'),
- ),
- (TEXTNS,u'creation-date'):(
- (TEXTNS,u'date-value'),
- (TEXTNS,u'fixed'),
- (STYLENS,u'data-style-name'),
- ),
- (TEXTNS,u'creation-time'):(
- (TEXTNS,u'fixed'),
- (TEXTNS,u'time-value'),
- (STYLENS,u'data-style-name'),
- ),
- (TEXTNS,u'creator'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'database-display'):(
- (TEXTNS,u'column-name'),
- (TEXTNS,u'table-name'),
- (TEXTNS,u'table-type'),
- (TEXTNS,u'database-name'),
- (STYLENS,u'data-style-name'),
- ),
- (TEXTNS,u'database-name'):(
- (TEXTNS,u'table-name'),
- (TEXTNS,u'table-type'),
- (TEXTNS,u'database-name'),
- ),
- (TEXTNS,u'database-next'):(
- (TEXTNS,u'table-name'),
- (TEXTNS,u'table-type'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'condition'),
- ),
- (TEXTNS,u'database-row-number'):(
- (STYLENS,u'num-format'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'value'),
- (STYLENS,u'num-letter-sync'),
- (TEXTNS,u'table-name'),
- (TEXTNS,u'table-type'),
- ),
- (TEXTNS,u'database-row-select'):(
- (TEXTNS,u'row-number'),
- (TEXTNS,u'table-name'),
- (TEXTNS,u'table-type'),
- (TEXTNS,u'database-name'),
- (TEXTNS,u'condition'),
- ),
-# allowed_attributes
- (TEXTNS,u'date'):(
- (TEXTNS,u'date-value'),
- (TEXTNS,u'fixed'),
- (TEXTNS,u'date-adjust'),
- (STYLENS,u'data-style-name'),
- ),
- (TEXTNS,u'dde-connection'):(
- (TEXTNS,u'connection-name'),
- ),
- (TEXTNS,u'dde-connection-decl'):(
- (OFFICENS,u'automatic-update'),
- (OFFICENS,u'dde-topic'),
- (OFFICENS,u'dde-application'),
- (OFFICENS,u'name'),
- (OFFICENS,u'dde-item'),
- ),
- (TEXTNS,u'dde-connection-decls'):(
- ),
- (TEXTNS,u'deletion'):(
- ),
- (TEXTNS,u'description'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'editing-cycles'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'editing-duration'):(
- (TEXTNS,u'duration'),
- (TEXTNS,u'fixed'),
- (STYLENS,u'data-style-name'),
- ),
- (TEXTNS,u'execute-macro'):(
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'expression'):(
- (TEXTNS,u'display'),
- (OFFICENS,u'string-value'),
- (OFFICENS,u'value'),
- (OFFICENS,u'boolean-value'),
- (OFFICENS,u'currency'),
- (OFFICENS,u'date-value'),
- (STYLENS,u'data-style-name'),
- (OFFICENS,u'value-type'),
- (TEXTNS,u'formula'),
- (OFFICENS,u'time-value'),
- ),
- (TEXTNS,u'file-name'):(
- (TEXTNS,u'fixed'),
- (TEXTNS,u'display'),
- ),
-# allowed_attributes
- (TEXTNS,u'format-change'):(
- ),
- (TEXTNS,u'h'):(
- (TEXTNS,u'restart-numbering'),
- (TEXTNS,u'cond-style-name'),
- (TEXTNS,u'is-list-header'),
- (TEXTNS,u'style-name'),
- (TEXTNS,u'class-names'),
- (TEXTNS,u'start-value'),
- (TEXTNS,u'id'),
- (TEXTNS,u'outline-level'),
- (XHTMLNS,u'about'),
- (XHTMLNS,u'content'),
- (XHTMLNS,u'datatype'),
- (XHTMLNS,u'property'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'hidden-paragraph'):(
- (TEXTNS,u'is-hidden'),
- (TEXTNS,u'condition'),
- ),
- (TEXTNS,u'hidden-text'):(
- (TEXTNS,u'string-value'),
- (TEXTNS,u'is-hidden'),
- (TEXTNS,u'condition'),
- ),
- (TEXTNS,u'illustration-index'):(
- (TEXTNS,u'protected'),
- (TEXTNS,u'style-name'),
- (TEXTNS,u'name'),
- (TEXTNS,u'protection-key'),
- (TEXTNS,u'protection-key-digest-algorithm'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'illustration-index-entry-template'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'illustration-index-source'):(
- (TEXTNS,u'index-scope'),
- (TEXTNS,u'caption-sequence-name'),
- (TEXTNS,u'use-caption'),
- (TEXTNS,u'caption-sequence-format'),
- (TEXTNS,u'relative-tab-stop-position'),
- ),
- (TEXTNS,u'index-body'):(
- ),
- (TEXTNS,u'index-entry-bibliography'):(
- (TEXTNS,u'bibliography-data-field'),
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'index-entry-chapter'):(
- (TEXTNS,u'style-name'),
- (TEXTNS,u'outline-level'),
- (TEXTNS,u'display'),
- ),
-# allowed_attributes
- (TEXTNS,u'index-entry-link-end'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'index-entry-link-start'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'index-entry-page-number'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'index-entry-span'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'index-entry-tab-stop'):(
- (STYLENS,u'position'),
- (TEXTNS,u'style-name'),
- (STYLENS,u'type'),
- (STYLENS,u'leader-char'),
- ),
- (TEXTNS,u'index-entry-text'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'index-source-style'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'index-source-styles'):(
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'index-title'):(
- (TEXTNS,u'protected'),
- (TEXTNS,u'style-name'),
- (TEXTNS,u'name'),
- (TEXTNS,u'protection-key'),
- (TEXTNS,u'protection-key-digest-algorithm'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'index-title-template'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'initial-creator'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'insertion'):(
- ),
-# allowed_attributes
- (TEXTNS,u'keywords'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'line-break'):(
- ),
- (TEXTNS,u'linenumbering-configuration'):(
- (TEXTNS,u'number-position'),
- (TEXTNS,u'number-lines'),
- (STYLENS,u'num-format'),
- (TEXTNS,u'count-empty-lines'),
- (TEXTNS,u'count-in-text-boxes'),
- (TEXTNS,u'style-name'),
- (STYLENS,u'num-letter-sync'),
- (TEXTNS,u'increment'),
- (TEXTNS,u'offset'),
- (TEXTNS,u'restart-on-page'),
- ),
- (TEXTNS,u'linenumbering-separator'):(
- (TEXTNS,u'increment'),
- ),
- (TEXTNS,u'list'):(
- (TEXTNS,u'style-name'),
- (TEXTNS,u'continue-numbering'),
- (TEXTNS,u'continue-list'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'list-header'):(
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (TEXTNS,u'list-item'):(
- (TEXTNS,u'start-value'),
- (TEXTNS,u'style-override'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'list-level-style-bullet'):(
- (TEXTNS,u'level'),
- (STYLENS,u'num-prefix'),
- (STYLENS,u'num-suffix'),
- (TEXTNS,u'bullet-relative-size'),
- (TEXTNS,u'style-name'),
- (TEXTNS,u'bullet-char'),
- ),
- (TEXTNS,u'list-level-style-image'):(
- (XLINKNS,u'show'),
- (XLINKNS,u'actuate'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (TEXTNS,u'level'),
- ),
- (TEXTNS,u'list-level-style-number'):(
- (TEXTNS,u'level'),
- (TEXTNS,u'display-levels'),
- (STYLENS,u'num-format'),
- (STYLENS,u'num-suffix'),
- (TEXTNS,u'style-name'),
- (STYLENS,u'num-prefix'),
- (STYLENS,u'num-letter-sync'),
- (TEXTNS,u'start-value'),
- ),
-# allowed_attributes
- (TEXTNS,u'list-style'):(
- (TEXTNS,u'consecutive-numbering'),
- (STYLENS,u'display-name'),
- (STYLENS,u'name'),
- ),
- (TEXTNS,u'measure'):(
- (TEXTNS,u'kind'),
- ),
-# allowed_attributes
- (TEXTNS,u'meta'):(
- (XHTMLNS,u'about'),
- (XHTMLNS,u'content'),
- (XMLNS,u'id'),
- (XHTMLNS,u'property'),
- (XHTMLNS,u'datatype'),
- ),
-# allowed_attributes
- (TEXTNS,u'meta-field'):(
- (STYLENS,u'data-style-name'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'modification-date'):(
- (TEXTNS,u'date-value'),
- (TEXTNS,u'fixed'),
- (STYLENS,u'data-style-name'),
- ),
- (TEXTNS,u'modification-time'):(
- (TEXTNS,u'fixed'),
- (TEXTNS,u'time-value'),
- (STYLENS,u'data-style-name'),
- ),
- (TEXTNS,u'note'):(
- (TEXTNS,u'note-class'),
- (TEXTNS,u'id'),
- ),
- (TEXTNS,u'note-body'):(
- ),
- (TEXTNS,u'note-citation'):(
- (TEXTNS,u'label'),
- ),
- (TEXTNS,u'note-continuation-notice-backward'):(
- ),
- (TEXTNS,u'note-continuation-notice-forward'):(
- ),
- (TEXTNS,u'note-ref'):(
- (TEXTNS,u'ref-name'),
- (TEXTNS,u'note-class'),
- (TEXTNS,u'reference-format'),
- ),
- (TEXTNS,u'notes-configuration'):(
- (TEXTNS,u'citation-body-style-name'),
- (STYLENS,u'num-format'),
- (TEXTNS,u'default-style-name'),
- (STYLENS,u'num-suffix'),
- (TEXTNS,u'start-numbering-at'),
- (STYLENS,u'num-prefix'),
- (STYLENS,u'num-letter-sync'),
- (TEXTNS,u'citation-style-name'),
- (TEXTNS,u'footnotes-position'),
- (TEXTNS,u'master-page-name'),
- (TEXTNS,u'start-value'),
- (TEXTNS,u'note-class'),
- ),
- (TEXTNS,u'number'):(
- ),
- (TEXTNS,u'numbered-paragraph'):(
- (TEXTNS,u'continue-numbering'),
- (TEXTNS,u'level'),
- (TEXTNS,u'list-id'),
- (TEXTNS,u'start-value'),
- (TEXTNS,u'style-name'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'object-count'):(
- (STYLENS,u'num-format'),
- (STYLENS,u'num-letter-sync'),
- ),
- (TEXTNS,u'object-index'):(
- (TEXTNS,u'protected'),
- (TEXTNS,u'style-name'),
- (TEXTNS,u'name'),
- (TEXTNS,u'protection-key'),
- (TEXTNS,u'protection-key-digest-algorithm'),
- (XMLNS,u'id'),
- ),
-# allowed_attributes
- (TEXTNS,u'object-index-entry-template'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'object-index-source'):(
- (TEXTNS,u'use-draw-objects'),
- (TEXTNS,u'use-math-objects'),
- (TEXTNS,u'relative-tab-stop-position'),
- (TEXTNS,u'use-chart-objects'),
- (TEXTNS,u'index-scope'),
- (TEXTNS,u'use-spreadsheet-objects'),
- (TEXTNS,u'use-other-objects'),
- ),
- (TEXTNS,u'outline-level-style'):(
- (TEXTNS,u'level'),
- (TEXTNS,u'display-levels'),
- (STYLENS,u'num-format'),
- (STYLENS,u'num-suffix'),
- (TEXTNS,u'style-name'),
- (STYLENS,u'num-prefix'),
- (STYLENS,u'num-letter-sync'),
- (TEXTNS,u'start-value'),
- ),
- (TEXTNS,u'outline-style'):(
- (STYLENS,u'name'),
- ),
-# allowed_attributes
- (TEXTNS,u'p'):(
- (TEXTNS,u'class-names'),
- (TEXTNS,u'cond-style-name'),
- (TEXTNS,u'id'),
- (TEXTNS,u'style-name'),
- (XHTMLNS,u'about'),
- (XHTMLNS,u'content'),
- (XHTMLNS,u'datatype'),
- (XHTMLNS,u'property'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'page'):(
- (TEXTNS,u'master-page-name'),
- ),
- (TEXTNS,u'page-continuation'):(
- (TEXTNS,u'string-value'),
- (TEXTNS,u'select-page'),
- ),
- (TEXTNS,u'page-number'):(
- (TEXTNS,u'page-adjust'),
- (STYLENS,u'num-format'),
- (TEXTNS,u'fixed'),
- (STYLENS,u'num-letter-sync'),
- (TEXTNS,u'select-page'),
- ),
- (TEXTNS,u'page-sequence'):(
- ),
- (TEXTNS,u'page-variable-get'):(
- (STYLENS,u'num-format'),
- (STYLENS,u'num-letter-sync'),
- ),
- (TEXTNS,u'page-variable-set'):(
- (TEXTNS,u'active'),
- (TEXTNS,u'page-adjust'),
- ),
- (TEXTNS,u'placeholder'):(
- (TEXTNS,u'placeholder-type'),
- (TEXTNS,u'description'),
- ),
- (TEXTNS,u'print-date'):(
- (TEXTNS,u'date-value'),
- (TEXTNS,u'fixed'),
- (STYLENS,u'data-style-name'),
- ),
- (TEXTNS,u'print-time'):(
- (TEXTNS,u'fixed'),
- (TEXTNS,u'time-value'),
- (STYLENS,u'data-style-name'),
- ),
- (TEXTNS,u'printed-by'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'reference-mark'):(
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'reference-mark-end'):(
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'reference-mark-start'):(
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'ruby'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'ruby-base'):(
- ),
- (TEXTNS,u'ruby-text'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u's'):(
- (TEXTNS,u'c'),
- ),
- (TEXTNS,u'script'):(
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (SCRIPTNS,u'language'),
- ),
-# allowed_attributes
- (TEXTNS,u'section'):(
- (TEXTNS,u'condition'),
- (TEXTNS,u'display'),
- (TEXTNS,u'name'),
- (TEXTNS,u'protected'),
- (TEXTNS,u'protection-key'),
- (TEXTNS,u'protection-key-digest-algorithm'),
- (TEXTNS,u'style-name'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'section-source'):(
- (TEXTNS,u'filter-name'),
- (XLINKNS,u'href'),
- (XLINKNS,u'type'),
- (TEXTNS,u'section-name'),
- (XLINKNS,u'show'),
- ),
- (TEXTNS,u'sender-city'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-company'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-country'):(
- (TEXTNS,u'fixed'),
- ),
-# allowed_attributes
- (TEXTNS,u'sender-email'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-fax'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-firstname'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-initials'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-lastname'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-phone-private'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-phone-work'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-position'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-postal-code'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-state-or-province'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-street'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sender-title'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'sequence'):(
- (TEXTNS,u'formula'),
- (STYLENS,u'num-format'),
- (STYLENS,u'num-letter-sync'),
- (TEXTNS,u'name'),
- (TEXTNS,u'ref-name'),
- ),
- (TEXTNS,u'sequence-decl'):(
- (TEXTNS,u'separation-character'),
- (TEXTNS,u'display-outline-level'),
- (TEXTNS,u'name'),
- ),
- (TEXTNS,u'sequence-decls'):(
- ),
- (TEXTNS,u'sequence-ref'):(
- (TEXTNS,u'ref-name'),
- (TEXTNS,u'reference-format'),
- ),
- (TEXTNS,u'sheet-name'):(
- ),
- (TEXTNS,u'soft-page-break'):(
- ),
- (TEXTNS,u'sort-key'):(
- (TEXTNS,u'sort-ascending'),
- (TEXTNS,u'key'),
- ),
-# allowed_attributes
- (TEXTNS,u'span'):(
- (TEXTNS,u'style-name'),
- (TEXTNS,u'class-names'),
- ),
- (TEXTNS,u'subject'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'tab'):(
- (TEXTNS,u'tab-ref'),
- ),
- (TEXTNS,u'table-formula'):(
- (TEXTNS,u'formula'),
- (STYLENS,u'data-style-name'),
- (TEXTNS,u'display'),
- ),
- (TEXTNS,u'table-index'):(
- (TEXTNS,u'protected'),
- (TEXTNS,u'style-name'),
- (TEXTNS,u'name'),
- (TEXTNS,u'protection-key'),
- (TEXTNS,u'protection-key-digest-algorithm'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'table-index-entry-template'):(
- (TEXTNS,u'style-name'),
- ),
- (TEXTNS,u'table-index-source'):(
- (TEXTNS,u'index-scope'),
- (TEXTNS,u'caption-sequence-name'),
- (TEXTNS,u'use-caption'),
- (TEXTNS,u'caption-sequence-format'),
- (TEXTNS,u'relative-tab-stop-position'),
- ),
-# allowed_attributes
- (TEXTNS,u'table-of-content'):(
- (TEXTNS,u'protected'),
- (TEXTNS,u'style-name'),
- (TEXTNS,u'name'),
- (TEXTNS,u'protection-key'),
- (TEXTNS,u'protection-key-digest-algorithm'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'table-of-content-entry-template'):(
- (TEXTNS,u'style-name'),
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'table-of-content-source'):(
- (TEXTNS,u'index-scope'),
- (TEXTNS,u'outline-level'),
- (TEXTNS,u'relative-tab-stop-position'),
- (TEXTNS,u'use-index-marks'),
- (TEXTNS,u'use-outline-level'),
- (TEXTNS,u'use-index-source-styles'),
- ),
- (TEXTNS,u'template-name'):(
- (TEXTNS,u'display'),
- ),
- (TEXTNS,u'text-input'):(
- (TEXTNS,u'description'),
- ),
- (TEXTNS,u'time'):(
- (TEXTNS,u'time-adjust'),
- (TEXTNS,u'fixed'),
- (TEXTNS,u'time-value'),
- (STYLENS,u'data-style-name'),
- ),
- (TEXTNS,u'title'):(
- (TEXTNS,u'fixed'),
- ),
- (TEXTNS,u'toc-mark'):(
- (TEXTNS,u'string-value'),
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'toc-mark-end'):(
- (TEXTNS,u'id'),
- ),
- (TEXTNS,u'toc-mark-start'):(
- (TEXTNS,u'id'),
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'tracked-changes'):(
- (TEXTNS,u'track-changes'),
- ),
- (TEXTNS,u'user-defined'):(
- (TEXTNS,u'name'),
- (OFFICENS,u'string-value'),
- (OFFICENS,u'value'),
- (OFFICENS,u'boolean-value'),
- (OFFICENS,u'date-value'),
- (STYLENS,u'data-style-name'),
- (TEXTNS,u'fixed'),
- (OFFICENS,u'time-value'),
- ),
- (TEXTNS,u'user-field-decl'):(
- (TEXTNS,u'name'),
- (OFFICENS,u'string-value'),
- (OFFICENS,u'value'),
- (OFFICENS,u'boolean-value'),
- (OFFICENS,u'currency'),
- (OFFICENS,u'date-value'),
- (OFFICENS,u'value-type'),
- (TEXTNS,u'formula'),
- (OFFICENS,u'time-value'),
- ),
- (TEXTNS,u'user-field-decls'):(
- ),
- (TEXTNS,u'user-field-get'):(
- (STYLENS,u'data-style-name'),
- (TEXTNS,u'name'),
- (TEXTNS,u'display'),
- ),
-# allowed_attributes
- (TEXTNS,u'user-field-input'):(
- (STYLENS,u'data-style-name'),
- (TEXTNS,u'name'),
- (TEXTNS,u'description'),
- ),
- (TEXTNS,u'user-index'):(
- (TEXTNS,u'protected'),
- (TEXTNS,u'style-name'),
- (TEXTNS,u'name'),
- (TEXTNS,u'protection-key'),
- (TEXTNS,u'protection-key-digest-algorithm'),
- (XMLNS,u'id'),
- ),
- (TEXTNS,u'user-index-entry-template'):(
- (TEXTNS,u'style-name'),
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'user-index-mark'):(
- (TEXTNS,u'index-name'),
- (TEXTNS,u'string-value'),
- (TEXTNS,u'outline-level'),
- ),
- (TEXTNS,u'user-index-mark-end'):(
- (TEXTNS,u'id'),
- ),
- (TEXTNS,u'user-index-mark-start'):(
- (TEXTNS,u'index-name'),
- (TEXTNS,u'id'),
- (TEXTNS,u'outline-level'),
- ),
-# allowed_attributes
- (TEXTNS,u'user-index-source'):(
- (TEXTNS,u'copy-outline-levels'),
- (TEXTNS,u'index-name'),
- (TEXTNS,u'index-scope'),
- (TEXTNS,u'relative-tab-stop-position'),
- (TEXTNS,u'use-floating-frames'),
- (TEXTNS,u'use-graphics'),
- (TEXTNS,u'use-index-marks'),
- (TEXTNS,u'use-index-source-styles'),
- (TEXTNS,u'use-objects'),
- (TEXTNS,u'use-tables'),
- ),
- (TEXTNS,u'variable-decl'):(
- (TEXTNS,u'name'),
- (OFFICENS,u'value-type'),
- ),
- (TEXTNS,u'variable-decls'):(
- ),
- (TEXTNS,u'variable-get'):(
- (STYLENS,u'data-style-name'),
- (TEXTNS,u'name'),
- (TEXTNS,u'display'),
- ),
- (TEXTNS,u'variable-input'):(
- (STYLENS,u'data-style-name'),
- (TEXTNS,u'display'),
- (TEXTNS,u'name'),
- (OFFICENS,u'value-type'),
- (TEXTNS,u'description'),
- ),
- (TEXTNS,u'variable-set'):(
- (TEXTNS,u'name'),
- (TEXTNS,u'display'),
- (OFFICENS,u'string-value'),
- (OFFICENS,u'value'),
- (OFFICENS,u'boolean-value'),
- (OFFICENS,u'currency'),
- (OFFICENS,u'date-value'),
- (STYLENS,u'data-style-name'),
- (OFFICENS,u'value-type'),
- (TEXTNS,u'formula'),
- (OFFICENS,u'time-value'),
- ),
-# allowed_attributes
-}
diff --git a/libs/odf/load.py b/libs/odf/load.py
deleted file mode 100644
index 35bdb82..0000000
--- a/libs/odf/load.py
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2008 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-# This script is to be embedded in opendocument.py later
-# The purpose is to read an ODT/ODP/ODS file and create the datastructure
-# in memory. The user should then be able to make operations and then save
-# the structure again.
-
-from xml.sax import make_parser,handler
-from xml.sax.xmlreader import InputSource
-import xml.sax.saxutils
-from element import Element
-from namespaces import OFFICENS
-try:
- from cStringIO import StringIO
-except ImportError:
- from io import StringIO
-
-#
-# Parse the XML files
-#
-class LoadParser(handler.ContentHandler):
- """ Extract headings from content.xml of an ODT file """
- triggers = (
- (OFFICENS, 'automatic-styles'), (OFFICENS, 'body'),
- (OFFICENS, 'font-face-decls'), (OFFICENS, 'master-styles'),
- (OFFICENS, 'meta'), (OFFICENS, 'scripts'),
- (OFFICENS, 'settings'), (OFFICENS, 'styles') )
-
- def __init__(self, document):
- self.doc = document
- self.data = []
- self.level = 0
- self.parse = False
-
- def characters(self, data):
- if self.parse == False:
- return
- self.data.append(data)
-
- def startElementNS(self, tag, qname, attrs):
- if tag in self.triggers:
- self.parse = True
- if self.doc._parsing != "styles.xml" and tag == (OFFICENS, 'font-face-decls'):
- self.parse = False
- if self.parse == False:
- return
-
- self.level = self.level + 1
- # Add any accumulated text content
- content = ''.join(self.data)
- if len(content.strip()) > 0:
- self.parent.addText(content, check_grammar=False)
- self.data = []
- # Create the element
- attrdict = {}
- for (att,value) in attrs.items():
- attrdict[att] = value
- try:
- e = Element(qname = tag, qattributes=attrdict, check_grammar=False)
- self.curr = e
- except AttributeError as v:
- print ("Error: %s" % v)
-
- if tag == (OFFICENS, 'automatic-styles'):
- e = self.doc.automaticstyles
- elif tag == (OFFICENS, 'body'):
- e = self.doc.body
- elif tag == (OFFICENS, 'master-styles'):
- e = self.doc.masterstyles
- elif tag == (OFFICENS, 'meta'):
- e = self.doc.meta
- elif tag == (OFFICENS,'scripts'):
- e = self.doc.scripts
- elif tag == (OFFICENS,'settings'):
- e = self.doc.settings
- elif tag == (OFFICENS,'styles'):
- e = self.doc.styles
- elif self.doc._parsing == "styles.xml" and tag == (OFFICENS, 'font-face-decls'):
- e = self.doc.fontfacedecls
- elif hasattr(self,'parent'):
- self.parent.addElement(e, check_grammar=False)
- self.parent = e
-
-
- def endElementNS(self, tag, qname):
- if self.parse == False:
- return
- self.level = self.level - 1
- str = ''.join(self.data)
- if len(str.strip()) > 0:
- self.curr.addText(str, check_grammar=False)
- self.data = []
- self.curr = self.curr.parentNode
- self.parent = self.curr
- if tag in self.triggers:
- self.parse = False
diff --git a/libs/odf/manifest.py b/libs/odf/manifest.py
deleted file mode 100644
index 1d5524f..0000000
--- a/libs/odf/manifest.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-#
-
-import sys, os.path
-sys.path.append(os.path.dirname(__file__))
-
-from namespaces import MANIFESTNS
-from element import Element
-
-# Autogenerated
-def Manifest(**args):
- return Element(qname = (MANIFESTNS,'manifest'), **args)
-
-def FileEntry(**args):
- return Element(qname = (MANIFESTNS,'file-entry'), **args)
-
-def EncryptionData(**args):
- return Element(qname = (MANIFESTNS,'encryption-data'), **args)
-
-def Algorithm(**args):
- return Element(qname = (MANIFESTNS,'algorithm'), **args)
-
-def KeyDerivation(**args):
- return Element(qname = (MANIFESTNS,'key-derivation'), **args)
-
diff --git a/libs/odf/math.py b/libs/odf/math.py
deleted file mode 100644
index 5dc38df..0000000
--- a/libs/odf/math.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import MATHNS
-from element import Element
-
-# ODF 1.0 section 12.5
-# Mathematical content is represented by MathML 2.0
-
-# Autogenerated
-def Math(**args):
- return Element(qname = (MATHNS,'math'), **args)
-
diff --git a/libs/odf/meta.py b/libs/odf/meta.py
deleted file mode 100644
index 68b1d19..0000000
--- a/libs/odf/meta.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import METANS
-from element import Element
-
-# Autogenerated
-def AutoReload(**args):
- return Element(qname = (METANS,'auto-reload'), **args)
-
-def CreationDate(**args):
- return Element(qname = (METANS,'creation-date'), **args)
-
-def DateString(**args):
- return Element(qname = (METANS,'date-string'), **args)
-
-def DocumentStatistic(**args):
- return Element(qname = (METANS,'document-statistic'), **args)
-
-def EditingCycles(**args):
- return Element(qname = (METANS,'editing-cycles'), **args)
-
-def EditingDuration(**args):
- return Element(qname = (METANS,'editing-duration'), **args)
-
-def Generator(**args):
- return Element(qname = (METANS,'generator'), **args)
-
-def HyperlinkBehaviour(**args):
- return Element(qname = (METANS,'hyperlink-behaviour'), **args)
-
-def InitialCreator(**args):
- return Element(qname = (METANS,'initial-creator'), **args)
-
-def Keyword(**args):
- return Element(qname = (METANS,'keyword'), **args)
-
-def PrintDate(**args):
- return Element(qname = (METANS,'print-date'), **args)
-
-def PrintedBy(**args):
- return Element(qname = (METANS,'printed-by'), **args)
-
-def Template(**args):
- args.setdefault('type', 'simple')
- return Element(qname = (METANS,'template'), **args)
-
-def UserDefined(**args):
- return Element(qname = (METANS,'user-defined'), **args)
-
diff --git a/libs/odf/namespaces.py b/libs/odf/namespaces.py
deleted file mode 100644
index 9568e98..0000000
--- a/libs/odf/namespaces.py
+++ /dev/null
@@ -1,107 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2013 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-TOOLSVERSION = u"ODFPY/1.3.1dev"
-
-ANIMNS = u"urn:oasis:names:tc:opendocument:xmlns:animation:1.0"
-CHARTNS = u"urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
-CHARTOOONS = u"http://openoffice.org/2010/chart"
-CONFIGNS = u"urn:oasis:names:tc:opendocument:xmlns:config:1.0"
-CSS3TNS = u"http://www.w3.org/TR/css3-text/"
-#DBNS = u"http://openoffice.org/2004/database"
-DBNS = u"urn:oasis:names:tc:opendocument:xmlns:database:1.0"
-DCNS = u"http://purl.org/dc/elements/1.1/"
-DOMNS = u"http://www.w3.org/2001/xml-events"
-DR3DNS = u"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
-DRAWNS = u"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
-FIELDNS = u"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
-FONS = u"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
-FORMNS = u"urn:oasis:names:tc:opendocument:xmlns:form:1.0"
-FORMXNS = u"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
-GRDDLNS = u"http://www.w3.org/2003/g/data-view#"
-KOFFICENS = u"http://www.koffice.org/2005/"
-MANIFESTNS = u"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"
-MATHNS = u"http://www.w3.org/1998/Math/MathML"
-METANS = u"urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
-NUMBERNS = u"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
-OFFICENS = u"urn:oasis:names:tc:opendocument:xmlns:office:1.0"
-OFNS = u"urn:oasis:names:tc:opendocument:xmlns:of:1.2"
-OOOCNS = u"http://openoffice.org/2004/calc"
-OOONS = u"http://openoffice.org/2004/office"
-OOOWNS = u"http://openoffice.org/2004/writer"
-PRESENTATIONNS = u"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
-RDFANS = u"http://docs.oasis-open.org/opendocument/meta/rdfa#"
-RPTNS = u"http://openoffice.org/2005/report"
-SCRIPTNS = u"urn:oasis:names:tc:opendocument:xmlns:script:1.0"
-SMILNS = u"urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0"
-STYLENS = u"urn:oasis:names:tc:opendocument:xmlns:style:1.0"
-SVGNS = u"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
-TABLENS = u"urn:oasis:names:tc:opendocument:xmlns:table:1.0"
-TABLEOOONS = u"http://openoffice.org/2009/table"
-TEXTNS = u"urn:oasis:names:tc:opendocument:xmlns:text:1.0"
-XFORMSNS = u"http://www.w3.org/2002/xforms"
-XHTMLNS = u"http://www.w3.org/1999/xhtml"
-XLINKNS = u"http://www.w3.org/1999/xlink"
-XMLNS = u"http://www.w3.org/XML/1998/namespace"
-XSDNS = u"http://www.w3.org/2001/XMLSchema"
-XSINS = u"http://www.w3.org/2001/XMLSchema-instance"
-
-nsdict = {
- ANIMNS: u'anim',
- CHARTNS: u'chart',
- CHARTOOONS: u'chartooo',
- CONFIGNS: u'config',
- CSS3TNS: u'css3t',
- DBNS: u'db',
- DCNS: u'dc',
- DOMNS: u'dom',
- DR3DNS: u'dr3d',
- DRAWNS: u'draw',
- FIELDNS: u'field',
- FONS: u'fo',
- FORMNS: u'form',
- FORMXNS: u'formx',
- GRDDLNS: u'grddl',
- KOFFICENS: u'koffice',
- MANIFESTNS: u'manifest',
- MATHNS: u'math',
- METANS: u'meta',
- NUMBERNS: u'number',
- OFFICENS: u'office',
- OFNS: u'of',
- OOONS: u'ooo',
- OOOWNS: u'ooow',
- OOOCNS: u'oooc',
- PRESENTATIONNS: u'presentation',
- RDFANS: u'rdfa',
- RPTNS: u'rpt',
- SCRIPTNS: u'script',
- SMILNS: u'smil',
- STYLENS: u'style',
- SVGNS: u'svg',
- TABLENS: u'table',
- TABLEOOONS: u'tableooo',
- TEXTNS: u'text',
- XFORMSNS: u'xforms',
- XLINKNS: u'xlink',
- XHTMLNS: u'xhtml',
- XMLNS: u'xml',
- XSDNS: u'xsd',
- XSINS: u'xsi',
-}
diff --git a/libs/odf/number.py b/libs/odf/number.py
deleted file mode 100644
index 12d81cb..0000000
--- a/libs/odf/number.py
+++ /dev/null
@@ -1,104 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import NUMBERNS
-from element import Element
-from style import StyleElement
-
-
-# Autogenerated
-def AmPm(**args):
- return Element(qname = (NUMBERNS,'am-pm'), **args)
-
-def Boolean(**args):
- return Element(qname = (NUMBERNS,'boolean'), **args)
-
-def BooleanStyle(**args):
- return StyleElement(qname = (NUMBERNS,'boolean-style'), **args)
-
-def CurrencyStyle(**args):
- return StyleElement(qname = (NUMBERNS,'currency-style'), **args)
-
-def CurrencySymbol(**args):
- return Element(qname = (NUMBERNS,'currency-symbol'), **args)
-
-def DateStyle(**args):
- return StyleElement(qname = (NUMBERNS,'date-style'), **args)
-
-def Day(**args):
- return Element(qname = (NUMBERNS,'day'), **args)
-
-def DayOfWeek(**args):
- return Element(qname = (NUMBERNS,'day-of-week'), **args)
-
-def EmbeddedText(**args):
- return Element(qname = (NUMBERNS,'embedded-text'), **args)
-
-def Era(**args):
- return Element(qname = (NUMBERNS,'era'), **args)
-
-def Fraction(**args):
- return Element(qname = (NUMBERNS,'fraction'), **args)
-
-def Hours(**args):
- return Element(qname = (NUMBERNS,'hours'), **args)
-
-def Minutes(**args):
- return Element(qname = (NUMBERNS,'minutes'), **args)
-
-def Month(**args):
- return Element(qname = (NUMBERNS,'month'), **args)
-
-def Number(**args):
- return Element(qname = (NUMBERNS,'number'), **args)
-
-def NumberStyle(**args):
- return StyleElement(qname = (NUMBERNS,'number-style'), **args)
-
-def PercentageStyle(**args):
- return StyleElement(qname = (NUMBERNS,'percentage-style'), **args)
-
-def Quarter(**args):
- return Element(qname = (NUMBERNS,'quarter'), **args)
-
-def ScientificNumber(**args):
- return Element(qname = (NUMBERNS,'scientific-number'), **args)
-
-def Seconds(**args):
- return Element(qname = (NUMBERNS,'seconds'), **args)
-
-def Text(**args):
- return Element(qname = (NUMBERNS,'text'), **args)
-
-def TextContent(**args):
- return Element(qname = (NUMBERNS,'text-content'), **args)
-
-def TextStyle(**args):
- return StyleElement(qname = (NUMBERNS,'text-style'), **args)
-
-def TimeStyle(**args):
- return StyleElement(qname = (NUMBERNS,'time-style'), **args)
-
-def WeekOfYear(**args):
- return Element(qname = (NUMBERNS,'week-of-year'), **args)
-
-def Year(**args):
- return Element(qname = (NUMBERNS,'year'), **args)
-
diff --git a/libs/odf/odf2moinmoin.py b/libs/odf/odf2moinmoin.py
deleted file mode 100644
index 167fcda..0000000
--- a/libs/odf/odf2moinmoin.py
+++ /dev/null
@@ -1,579 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2008 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# See http://trac.edgewall.org/wiki/WikiFormatting
-#
-# Contributor(s):
-#
-
-import sys, zipfile, xml.dom.minidom
-from namespaces import nsdict
-from elementtypes import *
-
-IGNORED_TAGS = [
- 'draw:a'
- 'draw:g',
- 'draw:line',
- 'draw:object-ole',
- 'office:annotation',
- 'presentation:notes',
- 'svg:desc',
-] + [ nsdict[item[0]]+":"+item[1] for item in empty_elements]
-
-INLINE_TAGS = [ nsdict[item[0]]+":"+item[1] for item in inline_elements]
-
-
-class TextProps:
- """ Holds properties for a text style. """
-
- def __init__(self):
-
- self.italic = False
- self.bold = False
- self.fixed = False
- self.underlined = False
- self.strikethrough = False
- self.superscript = False
- self.subscript = False
-
- def setItalic(self, value):
- if value == "italic":
- self.italic = True
- elif value == "normal":
- self.italic = False
-
- def setBold(self, value):
- if value == "bold":
- self.bold = True
- elif value == "normal":
- self.bold = False
-
- def setFixed(self, value):
- self.fixed = value
-
- def setUnderlined(self, value):
- if value and value != "none":
- self.underlined = True
-
- def setStrikethrough(self, value):
- if value and value != "none":
- self.strikethrough = True
-
- def setPosition(self, value):
- if value is None or value == '':
- return
- posisize = value.split(' ')
- textpos = posisize[0]
- if textpos.find('%') == -1:
- if textpos == "sub":
- self.superscript = False
- self.subscript = True
- elif textpos == "super":
- self.superscript = True
- self.subscript = False
- else:
- itextpos = int(textpos[:textpos.find('%')])
- if itextpos > 10:
- self.superscript = False
- self.subscript = True
- elif itextpos < -10:
- self.superscript = True
- self.subscript = False
-
- def __str__(self):
-
- return "[italic=%s, bold=i%s, fixed=%s]" % (str(self.italic),
- str(self.bold),
- str(self.fixed))
-
-class ParagraphProps:
- """ Holds properties of a paragraph style. """
-
- def __init__(self):
-
- self.blockquote = False
- self.headingLevel = 0
- self.code = False
- self.title = False
- self.indented = 0
-
- def setIndented(self, value):
- self.indented = value
-
- def setHeading(self, level):
- self.headingLevel = level
-
- def setTitle(self, value):
- self.title = value
-
- def setCode(self, value):
- self.code = value
-
-
- def __str__(self):
-
- return "[bq=%s, h=%d, code=%s]" % (str(self.blockquote),
- self.headingLevel,
- str(self.code))
-
-
-class ListProperties:
- """ Holds properties for a list style. """
-
- def __init__(self):
- self.ordered = False
-
- def setOrdered(self, value):
- self.ordered = value
-
-
-
-class ODF2MoinMoin(object):
-
-
- def __init__(self, filepath):
- self.footnotes = []
- self.footnoteCounter = 0
- self.textStyles = {"Standard": TextProps()}
- self.paragraphStyles = {"Standard": ParagraphProps()}
- self.listStyles = {}
- self.fixedFonts = []
- self.hasTitle = 0
- self.lastsegment = None
-
- # Tags
- self.elements = {
- 'draw:page': self.textToString,
- 'draw:frame': self.textToString,
- 'draw:image': self.draw_image,
- 'draw:text-box': self.textToString,
- 'text:a': self.text_a,
- 'text:note': self.text_note,
- }
- for tag in IGNORED_TAGS:
- self.elements[tag] = self.do_nothing
-
- for tag in INLINE_TAGS:
- self.elements[tag] = self.inline_markup
- self.elements['text:line-break'] = self.text_line_break
- self.elements['text:s'] = self.text_s
- self.elements['text:tab'] = self.text_tab
-
- self.load(filepath)
-
- def processFontDeclarations(self, fontDecl):
- """ Extracts necessary font information from a font-declaration
- element.
- """
- for fontFace in fontDecl.getElementsByTagName("style:font-face"):
- if fontFace.getAttribute("style:font-pitch") == "fixed":
- self.fixedFonts.append(fontFace.getAttribute("style:name"))
-
-
-
- def extractTextProperties(self, style, parent=None):
- """ Extracts text properties from a style element. """
-
- textProps = TextProps()
-
- if parent:
- parentProp = self.textStyles.get(parent, None)
- if parentProp:
- textProp = parentProp
-
- textPropEl = style.getElementsByTagName("style:text-properties")
- if not textPropEl: return textProps
-
- textPropEl = textPropEl[0]
-
- textProps.setItalic(textPropEl.getAttribute("fo:font-style"))
- textProps.setBold(textPropEl.getAttribute("fo:font-weight"))
- textProps.setUnderlined(textPropEl.getAttribute("style:text-underline-style"))
- textProps.setStrikethrough(textPropEl.getAttribute("style:text-line-through-style"))
- textProps.setPosition(textPropEl.getAttribute("style:text-position"))
-
- if textPropEl.getAttribute("style:font-name") in self.fixedFonts:
- textProps.setFixed(True)
-
- return textProps
-
- def extractParagraphProperties(self, style, parent=None):
- """ Extracts paragraph properties from a style element. """
-
- paraProps = ParagraphProps()
-
- name = style.getAttribute("style:name")
-
- if name.startswith("Heading_20_"):
- level = name[11:]
- try:
- level = int(level)
- paraProps.setHeading(level)
- except:
- level = 0
-
- if name == "Title":
- paraProps.setTitle(True)
-
- paraPropEl = style.getElementsByTagName("style:paragraph-properties")
- if paraPropEl:
- paraPropEl = paraPropEl[0]
- leftMargin = paraPropEl.getAttribute("fo:margin-left")
- if leftMargin:
- try:
- leftMargin = float(leftMargin[:-2])
- if leftMargin > 0.01:
- paraProps.setIndented(True)
- except:
- pass
-
- textProps = self.extractTextProperties(style)
- if textProps.fixed:
- paraProps.setCode(True)
-
- return paraProps
-
-
- def processStyles(self, styleElements):
- """ Runs through "style" elements extracting necessary information.
- """
-
- for style in styleElements:
-
- name = style.getAttribute("style:name")
-
- if name == "Standard": continue
-
- family = style.getAttribute("style:family")
- parent = style.getAttribute("style:parent-style-name")
-
- if family == "text":
- self.textStyles[name] = self.extractTextProperties(style, parent)
-
- elif family == "paragraph":
- self.paragraphStyles[name] = \
- self.extractParagraphProperties(style, parent)
- self.textStyles[name] = self.extractTextProperties(style, parent)
-
- def processListStyles(self, listStyleElements):
-
- for style in listStyleElements:
- name = style.getAttribute("style:name")
-
- prop = ListProperties()
- if style.hasChildNodes():
- subitems = [el for el in style.childNodes
- if el.nodeType == xml.dom.Node.ELEMENT_NODE
- and el.tagName == "text:list-level-style-number"]
- if len(subitems) > 0:
- prop.setOrdered(True)
-
- self.listStyles[name] = prop
-
-
- def load(self, filepath):
- """ Loads an ODT file. """
-
- zip = zipfile.ZipFile(filepath)
-
- styles_doc = xml.dom.minidom.parseString(zip.read("styles.xml"))
- fontfacedecls = styles_doc.getElementsByTagName("office:font-face-decls")
- if fontfacedecls:
- self.processFontDeclarations(fontfacedecls[0])
- self.processStyles(styles_doc.getElementsByTagName("style:style"))
- self.processListStyles(styles_doc.getElementsByTagName("text:list-style"))
-
- self.content = xml.dom.minidom.parseString(zip.read("content.xml"))
- fontfacedecls = self.content.getElementsByTagName("office:font-face-decls")
- if fontfacedecls:
- self.processFontDeclarations(fontfacedecls[0])
-
- self.processStyles(self.content.getElementsByTagName("style:style"))
- self.processListStyles(self.content.getElementsByTagName("text:list-style"))
-
- def compressCodeBlocks(self, text):
- """ Removes extra blank lines from code blocks. """
-
- return text
- lines = text.split("\n")
- buffer = []
- numLines = len(lines)
- for i in range(numLines):
-
- if (lines[i].strip() or i == numLines-1 or i == 0 or
- not ( lines[i-1].startswith(" ")
- and lines[i+1].startswith(" ") ) ):
- buffer.append("\n" + lines[i])
-
- return ''.join(buffer)
-
-#-----------------------------------
- def do_nothing(self, node):
- return ''
-
- def draw_image(self, node):
- """
- """
-
- link = node.getAttribute("xlink:href")
- if link and link[:2] == './': # Indicates a sub-object, which isn't supported
- return "%s\n" % link
- if link and link[:9] == 'Pictures/':
- link = link[9:]
- return "[[Image(%s)]]\n" % link
-
- def text_a(self, node):
- text = self.textToString(node)
- link = node.getAttribute("xlink:href")
- if link.strip() == text.strip():
- return "[%s] " % link.strip()
- else:
- return "[%s %s] " % (link.strip(), text.strip())
-
-
- def text_line_break(self, node):
- return "[[BR]]"
-
- def text_note(self, node):
- cite = (node.getElementsByTagName("text:note-citation")[0]
- .childNodes[0].nodeValue)
- body = (node.getElementsByTagName("text:note-body")[0]
- .childNodes[0])
- self.footnotes.append((cite, self.textToString(body)))
- return "^%s^" % cite
-
- def text_s(self, node):
- try:
- num = int(node.getAttribute("text:c"))
- return " "*num
- except:
- return " "
-
- def text_tab(self, node):
- return " "
-
- def inline_markup(self, node):
- text = self.textToString(node)
-
- if not text.strip():
- return '' # don't apply styles to white space
-
- styleName = node.getAttribute("text:style-name")
- style = self.textStyles.get(styleName, TextProps())
-
- if style.fixed:
- return "`" + text + "`"
-
- mark = []
- if style:
- if style.italic:
- mark.append("''")
- if style.bold:
- mark.append("'''")
- if style.underlined:
- mark.append("__")
- if style.strikethrough:
- mark.append("~~")
- if style.superscript:
- mark.append("^")
- if style.subscript:
- mark.append(",,")
- revmark = mark[:]
- revmark.reverse()
- return "%s%s%s" % (''.join(mark), text, ''.join(revmark))
-
-#-----------------------------------
- def listToString(self, listElement, indent = 0):
-
- self.lastsegment = listElement.tagName
- buffer = []
-
- styleName = listElement.getAttribute("text:style-name")
- props = self.listStyles.get(styleName, ListProperties())
-
- i = 0
- for item in listElement.childNodes:
- buffer.append(" "*indent)
- i += 1
- if props.ordered:
- number = str(i)
- number = " " + number + ". "
- buffer.append(" 1. ")
- else:
- buffer.append(" * ")
- subitems = [el for el in item.childNodes
- if el.tagName in ["text:p", "text:h", "text:list"]]
- for subitem in subitems:
- if subitem.tagName == "text:list":
- buffer.append("\n")
- buffer.append(self.listToString(subitem, indent+3))
- else:
- buffer.append(self.paragraphToString(subitem, indent+3))
- self.lastsegment = subitem.tagName
- self.lastsegment = item.tagName
- buffer.append("\n")
-
- return ''.join(buffer)
-
- def tableToString(self, tableElement):
- """ MoinMoin uses || to delimit table cells
- """
-
- self.lastsegment = tableElement.tagName
- buffer = []
-
- for item in tableElement.childNodes:
- self.lastsegment = item.tagName
- if item.tagName == "table:table-header-rows":
- buffer.append(self.tableToString(item))
- if item.tagName == "table:table-row":
- buffer.append("\n||")
- for cell in item.childNodes:
- buffer.append(self.inline_markup(cell))
- buffer.append("||")
- self.lastsegment = cell.tagName
- return ''.join(buffer)
-
-
- def toString(self):
- """ Converts the document to a string.
- FIXME: Result from second call differs from first call
- """
- body = self.content.getElementsByTagName("office:body")[0]
- text = body.childNodes[0]
-
- buffer = []
-
- paragraphs = [el for el in text.childNodes
- if el.tagName in ["draw:page", "text:p", "text:h","text:section",
- "text:list", "table:table"]]
-
- for paragraph in paragraphs:
- if paragraph.tagName == "text:list":
- text = self.listToString(paragraph)
- elif paragraph.tagName == "text:section":
- text = self.textToString(paragraph)
- elif paragraph.tagName == "table:table":
- text = self.tableToString(paragraph)
- else:
- text = self.paragraphToString(paragraph)
- if text:
- buffer.append(text)
-
- if self.footnotes:
-
- buffer.append("----")
- for cite, body in self.footnotes:
- buffer.append("%s: %s" % (cite, body))
-
-
- buffer.append("")
- return self.compressCodeBlocks('\n'.join(buffer))
-
-
- def textToString(self, element):
-
- buffer = []
-
- for node in element.childNodes:
-
- if node.nodeType == xml.dom.Node.TEXT_NODE:
- buffer.append(node.nodeValue)
-
- elif node.nodeType == xml.dom.Node.ELEMENT_NODE:
- tag = node.tagName
-
- if tag in ("draw:text-box", "draw:frame"):
- buffer.append(self.textToString(node))
-
- elif tag in ("text:p", "text:h"):
- text = self.paragraphToString(node)
- if text:
- buffer.append(text)
- elif tag == "text:list":
- buffer.append(self.listToString(node))
- else:
- method = self.elements.get(tag)
- if method:
- buffer.append(method(node))
- else:
- buffer.append(" {" + tag + "} ")
-
- return ''.join(buffer)
-
- def paragraphToString(self, paragraph, indent = 0):
-
- dummyParaProps = ParagraphProps()
-
- style_name = paragraph.getAttribute("text:style-name")
- paraProps = self.paragraphStyles.get(style_name, dummyParaProps)
- text = self.inline_markup(paragraph)
-
- if paraProps and not paraProps.code:
- text = text.strip()
-
- if paragraph.tagName == "text:p" and self.lastsegment == "text:p":
- text = "\n" + text
-
- self.lastsegment = paragraph.tagName
-
- if paraProps.title:
- self.hasTitle = 1
- return "= " + text + " =\n"
-
- outlinelevel = paragraph.getAttribute("text:outline-level")
- if outlinelevel:
-
- level = int(outlinelevel)
- if self.hasTitle: level += 1
-
- if level >= 1:
- return "=" * level + " " + text + " " + "=" * level + "\n"
-
- elif paraProps.code:
- return "{{{\n" + text + "\n}}}\n"
-
- if paraProps.indented:
- return self.wrapParagraph(text, indent = indent, blockquote = True)
-
- else:
- return self.wrapParagraph(text, indent = indent)
-
-
- def wrapParagraph(self, text, indent = 0, blockquote=False):
-
- counter = 0
- buffer = []
- LIMIT = 50
-
- if blockquote:
- buffer.append(" ")
-
- return ''.join(buffer) + text
- # Unused from here
- for token in text.split():
-
- if counter > LIMIT - indent:
- buffer.append("\n" + " "*indent)
- if blockquote:
- buffer.append(" ")
- counter = 0
-
- buffer.append(token + " ")
- counter += len(token)
-
- return ''.join(buffer)
diff --git a/libs/odf/odf2xhtml.py b/libs/odf/odf2xhtml.py
deleted file mode 100644
index 8c5fbb2..0000000
--- a/libs/odf/odf2xhtml.py
+++ /dev/null
@@ -1,1617 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2010 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-#import pdb
-#pdb.set_trace()
-
-import sys, os.path
-sys.path.append(os.path.dirname(__file__))
-from xml.sax import handler
-from xml.sax.saxutils import escape, quoteattr
-from xml.dom import Node
-
-from opendocument import load
-
-from namespaces import ANIMNS, CHARTNS, CONFIGNS, DCNS, DR3DNS, DRAWNS, FONS, \
- FORMNS, MATHNS, METANS, NUMBERNS, OFFICENS, PRESENTATIONNS, SCRIPTNS, \
- SMILNS, STYLENS, SVGNS, TABLENS, TEXTNS, XLINKNS
-
-# Handling of styles
-#
-# First there are font face declarations. These set up a font style that will be
-# referenced from a text-property. The declaration describes the font making
-# it possible for the application to find a similar font should the system not
-# have that particular one. The StyleToCSS stores these attributes to be used
-# for the CSS2 font declaration.
-#
-# Then there are default-styles. These set defaults for various style types:
-# "text", "paragraph", "section", "ruby", "table", "table-column", "table-row",
-# "table-cell", "graphic", "presentation", "drawing-page", "chart".
-# Since CSS2 can't refer to another style, ODF2XHTML add these to all
-# styles unless overridden.
-#
-# The real styles are declared in the element. They have a
-# family referring to the default-styles, and may have a parent style.
-#
-# Styles have scope. The same name can be used for both paragraph and
-# character etc. styles Since CSS2 has no scope we use a prefix. (Not elegant)
-# In ODF a style can have a parent, these parents can be chained.
-
-class StyleToCSS:
- """ The purpose of the StyleToCSS class is to contain the rules to convert
- ODF styles to CSS2. Since it needs the generic fonts, it would probably
- make sense to also contain the Styles in a dict as well..
- """
-
- def __init__(self):
- # Font declarations
- self.fontdict = {}
-
- # Fill-images from presentations for backgrounds
- self.fillimages = {}
-
- self.ruleconversions = {
- (DRAWNS,u'fill-image-name'): self.c_drawfillimage,
- (FONS,u"background-color"): self.c_fo,
- (FONS,u"border"): self.c_fo,
- (FONS,u"border-bottom"): self.c_fo,
- (FONS,u"border-left"): self.c_fo,
- (FONS,u"border-right"): self.c_fo,
- (FONS,u"border-top"): self.c_fo,
- (FONS,u"color"): self.c_fo,
- (FONS,u"font-family"): self.c_fo,
- (FONS,u"font-size"): self.c_fo,
- (FONS,u"font-style"): self.c_fo,
- (FONS,u"font-variant"): self.c_fo,
- (FONS,u"font-weight"): self.c_fo,
- (FONS,u"line-height"): self.c_fo,
- (FONS,u"margin"): self.c_fo,
- (FONS,u"margin-bottom"): self.c_fo,
- (FONS,u"margin-left"): self.c_fo,
- (FONS,u"margin-right"): self.c_fo,
- (FONS,u"margin-top"): self.c_fo,
- (FONS,u"min-height"): self.c_fo,
- (FONS,u"padding"): self.c_fo,
- (FONS,u"padding-bottom"): self.c_fo,
- (FONS,u"padding-left"): self.c_fo,
- (FONS,u"padding-right"): self.c_fo,
- (FONS,u"padding-top"): self.c_fo,
- (FONS,u"page-width"): self.c_page_width,
- (FONS,u"page-height"): self.c_page_height,
- (FONS,u"text-align"): self.c_text_align,
- (FONS,u"text-indent") :self.c_fo,
- (TABLENS,u'border-model') :self.c_border_model,
- (STYLENS,u'column-width') : self.c_width,
- (STYLENS,u"font-name"): self.c_fn,
- (STYLENS,u'horizontal-pos'): self.c_hp,
- (STYLENS,u'text-position'): self.c_text_position,
- (STYLENS,u'text-line-through-style'): self.c_text_line_through_style,
- (STYLENS,u'text-underline-style'): self.c_text_underline_style,
- (STYLENS,u'width') : self.c_width,
- # FIXME Should do style:vertical-pos here
- }
-
- def save_font(self, name, family, generic):
- """ It is possible that the HTML browser doesn't know how to
- show a particular font. Fortunately ODF provides generic fallbacks.
- Unfortunately they are not the same as CSS2.
- CSS2: serif, sans-serif, cursive, fantasy, monospace
- ODF: roman, swiss, modern, decorative, script, system
- This method put the font and fallback into a dictionary
- """
- htmlgeneric = "sans-serif"
- if generic == "roman": htmlgeneric = "serif"
- elif generic == "swiss": htmlgeneric = "sans-serif"
- elif generic == "modern": htmlgeneric = "monospace"
- elif generic == "decorative": htmlgeneric = "sans-serif"
- elif generic == "script": htmlgeneric = "monospace"
- elif generic == "system": htmlgeneric = "serif"
- self.fontdict[name] = (family, htmlgeneric)
-
- def c_drawfillimage(self, ruleset, sdict, rule, val):
- """ Fill a figure with an image. Since CSS doesn't let you resize images
- this should really be implemented as an absolutely position
- with a width and a height
- """
- sdict['background-image'] = "url('%s')" % self.fillimages[val]
-
- def c_fo(self, ruleset, sdict, rule, val):
- """ XSL formatting attributes """
- selector = rule[1]
- sdict[selector] = val
-
- def c_border_model(self, ruleset, sdict, rule, val):
- """ Convert to CSS2 border model """
- if val == 'collapsing':
- sdict['border-collapse'] ='collapse'
- else:
- sdict['border-collapse'] ='separate'
-
- def c_width(self, ruleset, sdict, rule, val):
- """ Set width of box """
- sdict['width'] = val
-
- def c_text_align(self, ruleset, sdict, rule, align):
- """ Text align """
- if align == "start": align = "left"
- if align == "end": align = "right"
- sdict['text-align'] = align
-
- def c_fn(self, ruleset, sdict, rule, fontstyle):
- """ Generate the CSS font family
- A generic font can be found in two ways. In a
- element or as a font-family-generic attribute in text-properties.
- """
- generic = ruleset.get((STYLENS,'font-family-generic') )
- if generic is not None:
- self.save_font(fontstyle, fontstyle, generic)
- family, htmlgeneric = self.fontdict.get(fontstyle, (fontstyle, 'serif'))
- sdict['font-family'] = '%s, %s' % (family, htmlgeneric)
-
- def c_text_position(self, ruleset, sdict, rule, tp):
- """ Text position. This is used e.g. to make superscript and subscript
- This attribute can have one or two values.
-
- The first value must be present and specifies the vertical
- text position as a percentage that relates to the current font
- height or it takes one of the values sub or super. Negative
- percentages or the sub value place the text below the
- baseline. Positive percentages or the super value place
- the text above the baseline. If sub or super is specified,
- the application can choose an appropriate text position.
-
- The second value is optional and specifies the font height
- as a percentage that relates to the current font-height. If
- this value is not specified, an appropriate font height is
- used. Although this value may change the font height that
- is displayed, it never changes the current font height that
- is used for additional calculations.
- """
- textpos = tp.split(' ')
- if len(textpos) == 2 and textpos[0] != "0%":
- # Bug in OpenOffice. If vertical-align is 0% - ignore the text size.
- sdict['font-size'] = textpos[1]
- if textpos[0] == "super":
- sdict['vertical-align'] = "33%"
- elif textpos[0] == "sub":
- sdict['vertical-align'] = "-33%"
- else:
- sdict['vertical-align'] = textpos[0]
-
- def c_hp(self, ruleset, sdict, rule, hpos):
- #FIXME: Frames wrap-style defaults to 'parallel', graphics to 'none'.
- # It is properly set in the parent-styles, but the program doesn't
- # collect the information.
- wrap = ruleset.get((STYLENS,'wrap'),'parallel')
- # Can have: from-left, left, center, right, from-inside, inside, outside
- if hpos == "center":
- sdict['margin-left'] = "auto"
- sdict['margin-right'] = "auto"
-# else:
-# # force it to be *something* then delete it
-# sdict['margin-left'] = sdict['margin-right'] = ''
-# del sdict['margin-left'], sdict['margin-right']
-
- if hpos in ("right","outside"):
- if wrap in ( "left", "parallel","dynamic"):
- sdict['float'] = "right"
- elif wrap == "run-through":
- sdict['position'] = "absolute" # Simulate run-through
- sdict['top'] = "0"
- sdict['right'] = "0";
- else: # No wrapping
- sdict['margin-left'] = "auto"
- sdict['margin-right'] = "0cm"
- elif hpos in ("left", "inside"):
- if wrap in ( "right", "parallel","dynamic"):
- sdict['float'] = "left"
- elif wrap == "run-through":
- sdict['position'] = "absolute" # Simulate run-through
- sdict['top'] = "0"
- sdict['left'] = "0"
- else: # No wrapping
- sdict['margin-left'] = "0cm"
- sdict['margin-right'] = "auto"
- elif hpos in ("from-left", "from-inside"):
- if wrap in ( "right", "parallel"):
- sdict['float'] = "left"
- else:
- sdict['position'] = "relative" # No wrapping
- if (SVGNS,'x') in ruleset:
- sdict['left'] = ruleset[(SVGNS,'x')]
-
- def c_page_width(self, ruleset, sdict, rule, val):
- """ Set width of box
- HTML doesn't really have a page-width. It is always 100% of the browser width
- """
- sdict['width'] = val
-
- def c_text_underline_style(self, ruleset, sdict, rule, val):
- """ Set underline decoration
- HTML doesn't really have a page-width. It is always 100% of the browser width
- """
- if val and val != "none":
- sdict['text-decoration'] = "underline"
-
- def c_text_line_through_style(self, ruleset, sdict, rule, val):
- """ Set underline decoration
- HTML doesn't really have a page-width. It is always 100% of the browser width
- """
- if val and val != "none":
- sdict['text-decoration'] = "line-through"
-
- def c_page_height(self, ruleset, sdict, rule, val):
- """ Set height of box """
- sdict['height'] = val
-
- def convert_styles(self, ruleset):
- """ Rule is a tuple of (namespace, name). If the namespace is '' then
- it is already CSS2
- """
- sdict = {}
- procedures=[]
- for rule,val in ruleset.items():
- if rule[0] == '':
- sdict[rule[1]] = val
- continue
- method = self.ruleconversions.get(rule, None )
- if method:
- procedures.append([method, ruleset, sdict, rule, val])
- # this ensures that the procedures for horizontal position
- # are run last! It is important since Python3 makes the order
- # of dictionaries unpredictable
- for p in filter(lambda x: x[0] != self.c_hp, procedures):
- method, ruleset, sdict, rule, val = p
- method(ruleset, sdict, rule, val)
- for p in filter(lambda x: x[0] == self.c_hp, procedures):
- method, ruleset, sdict, rule, val = p
- method(ruleset, sdict, rule, val)
-
- return sdict
-
-
-class TagStack:
- def __init__(self):
- self.stack = []
-
- def push(self, tag, attrs):
- self.stack.append( (tag, attrs) )
-
- def pop(self):
- item = self.stack.pop()
- return item
-
- def stackparent(self):
- item = self.stack[-1]
- return item[1]
-
- def rfindattr(self, attr):
- """ Find a tag with the given attribute """
- for tag, attrs in self.stack:
- if attr in attrs:
- return attrs[attr]
- return None
- def count_tags(self, tag):
- c = 0
- for ttag, tattrs in self.stack:
- if ttag == tag: c = c + 1
- return c
-
-special_styles = {
- 'S-Emphasis':'em',
- 'S-Citation':'cite',
- 'S-Strong_20_Emphasis':'strong',
- 'S-Variable':'var',
- 'S-Definition':'dfn',
- 'S-Teletype':'tt',
- 'P-Heading_20_1':'h1',
- 'P-Heading_20_2':'h2',
- 'P-Heading_20_3':'h3',
- 'P-Heading_20_4':'h4',
- 'P-Heading_20_5':'h5',
- 'P-Heading_20_6':'h6',
-# 'P-Caption':'caption',
- 'P-Addressee':'address',
-# 'P-List_20_Heading':'dt',
-# 'P-List_20_Contents':'dd',
- 'P-Preformatted_20_Text':'pre',
-# 'P-Table_20_Heading':'th',
-# 'P-Table_20_Contents':'td',
-# 'P-Text_20_body':'p'
-}
-
-#-----------------------------------------------------------------------------
-#
-# ODFCONTENTHANDLER
-#
-#-----------------------------------------------------------------------------
-class ODF2XHTML(handler.ContentHandler):
- """ The ODF2XHTML parses an ODF file and produces XHTML"""
-
- def __init__(self, generate_css=True, embedable=False):
- # Tags
- self.generate_css = generate_css
- self.elements = {
- (DCNS, 'title'): (self.s_processcont, self.e_dc_title),
- (DCNS, 'language'): (self.s_processcont, self.e_dc_contentlanguage),
- (DCNS, 'creator'): (self.s_processcont, self.e_dc_creator),
- (DCNS, 'description'): (self.s_processcont, self.e_dc_metatag),
- (DCNS, 'date'): (self.s_processcont, self.e_dc_metatag),
- (DRAWNS, 'custom-shape'): (self.s_custom_shape, self.e_custom_shape),
- (DRAWNS, 'frame'): (self.s_draw_frame, self.e_draw_frame),
- (DRAWNS, 'image'): (self.s_draw_image, None),
- (DRAWNS, 'fill-image'): (self.s_draw_fill_image, None),
- (DRAWNS, "layer-set"):(self.s_ignorexml, None),
- (DRAWNS, 'object'): (self.s_draw_object, None),
- (DRAWNS, 'object-ole'): (self.s_draw_object_ole, None),
- (DRAWNS, 'page'): (self.s_draw_page, self.e_draw_page),
- (DRAWNS, 'text-box'): (self.s_draw_textbox, self.e_draw_textbox),
- (METANS, 'creation-date'):(self.s_processcont, self.e_dc_metatag),
- (METANS, 'generator'):(self.s_processcont, self.e_dc_metatag),
- (METANS, 'initial-creator'): (self.s_processcont, self.e_dc_metatag),
- (METANS, 'keyword'): (self.s_processcont, self.e_dc_metatag),
- (NUMBERNS, "boolean-style"):(self.s_ignorexml, None),
- (NUMBERNS, "currency-style"):(self.s_ignorexml, None),
- (NUMBERNS, "date-style"):(self.s_ignorexml, None),
- (NUMBERNS, "number-style"):(self.s_ignorexml, None),
- (NUMBERNS, "text-style"):(self.s_ignorexml, None),
- (OFFICENS, "annotation"):(self.s_ignorexml, None),
- (OFFICENS, "automatic-styles"):(self.s_office_automatic_styles, None),
- (OFFICENS, "document"):(self.s_office_document_content, self.e_office_document_content),
- (OFFICENS, "document-content"):(self.s_office_document_content, self.e_office_document_content),
- (OFFICENS, "forms"):(self.s_ignorexml, None),
- (OFFICENS, "master-styles"):(self.s_office_master_styles, None),
- (OFFICENS, "meta"):(self.s_ignorecont, None),
- (OFFICENS, "presentation"):(self.s_office_presentation, self.e_office_presentation),
- (OFFICENS, "spreadsheet"):(self.s_office_spreadsheet, self.e_office_spreadsheet),
- (OFFICENS, "styles"):(self.s_office_styles, None),
- (OFFICENS, "text"):(self.s_office_text, self.e_office_text),
- (OFFICENS, "scripts"):(self.s_ignorexml, None),
- (OFFICENS, "settings"):(self.s_ignorexml, None),
- (PRESENTATIONNS, "notes"):(self.s_ignorexml, None),
-# (STYLENS, "default-page-layout"):(self.s_style_default_page_layout, self.e_style_page_layout),
- (STYLENS, "default-page-layout"):(self.s_ignorexml, None),
- (STYLENS, "default-style"):(self.s_style_default_style, self.e_style_default_style),
- (STYLENS, "drawing-page-properties"):(self.s_style_handle_properties, None),
- (STYLENS, "font-face"):(self.s_style_font_face, None),
-# (STYLENS, "footer"):(self.s_style_footer, self.e_style_footer),
-# (STYLENS, "footer-style"):(self.s_style_footer_style, None),
- (STYLENS, "graphic-properties"):(self.s_style_handle_properties, None),
- (STYLENS, "handout-master"):(self.s_ignorexml, None),
-# (STYLENS, "header"):(self.s_style_header, self.e_style_header),
-# (STYLENS, "header-footer-properties"):(self.s_style_handle_properties, None),
-# (STYLENS, "header-style"):(self.s_style_header_style, None),
- (STYLENS, "master-page"):(self.s_style_master_page, None),
- (STYLENS, "page-layout-properties"):(self.s_style_handle_properties, None),
- (STYLENS, "page-layout"):(self.s_style_page_layout, self.e_style_page_layout),
-# (STYLENS, "page-layout"):(self.s_ignorexml, None),
- (STYLENS, "paragraph-properties"):(self.s_style_handle_properties, None),
- (STYLENS, "style"):(self.s_style_style, self.e_style_style),
- (STYLENS, "table-cell-properties"):(self.s_style_handle_properties, None),
- (STYLENS, "table-column-properties"):(self.s_style_handle_properties, None),
- (STYLENS, "table-properties"):(self.s_style_handle_properties, None),
- (STYLENS, "text-properties"):(self.s_style_handle_properties, None),
- (SVGNS, 'desc'): (self.s_ignorexml, None),
- (TABLENS, 'covered-table-cell'): (self.s_ignorexml, None),
- (TABLENS, 'table-cell'): (self.s_table_table_cell, self.e_table_table_cell),
- (TABLENS, 'table-column'): (self.s_table_table_column, None),
- (TABLENS, 'table-row'): (self.s_table_table_row, self.e_table_table_row),
- (TABLENS, 'table'): (self.s_table_table, self.e_table_table),
- (TEXTNS, 'a'): (self.s_text_a, self.e_text_a),
- (TEXTNS, "alphabetical-index-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, "bibliography-configuration"):(self.s_ignorexml, None),
- (TEXTNS, "bibliography-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, 'bookmark'): (self.s_text_bookmark, None),
- (TEXTNS, 'bookmark-start'): (self.s_text_bookmark, None),
- (TEXTNS, 'bookmark-ref'): (self.s_text_bookmark_ref, self.e_text_a),
- (TEXTNS, 'bookmark-ref-start'): (self.s_text_bookmark_ref, None),
- (TEXTNS, 'h'): (self.s_text_h, self.e_text_h),
- (TEXTNS, "illustration-index-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, 'line-break'):(self.s_text_line_break, None),
- (TEXTNS, "linenumbering-configuration"):(self.s_ignorexml, None),
- (TEXTNS, "list"):(self.s_text_list, self.e_text_list),
- (TEXTNS, "list-item"):(self.s_text_list_item, self.e_text_list_item),
- (TEXTNS, "list-level-style-bullet"):(self.s_text_list_level_style_bullet, self.e_text_list_level_style_bullet),
- (TEXTNS, "list-level-style-number"):(self.s_text_list_level_style_number, self.e_text_list_level_style_number),
- (TEXTNS, "list-style"):(None, None),
- (TEXTNS, "note"):(self.s_text_note, None),
- (TEXTNS, "note-body"):(self.s_text_note_body, self.e_text_note_body),
- (TEXTNS, "note-citation"):(None, self.e_text_note_citation),
- (TEXTNS, "notes-configuration"):(self.s_ignorexml, None),
- (TEXTNS, "object-index-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, 'p'): (self.s_text_p, self.e_text_p),
- (TEXTNS, 's'): (self.s_text_s, None),
- (TEXTNS, 'span'): (self.s_text_span, self.e_text_span),
- (TEXTNS, 'tab'): (self.s_text_tab, None),
- (TEXTNS, "table-index-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, "table-of-content-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, "user-index-source"):(self.s_text_x_source, self.e_text_x_source),
- }
- if embedable:
- self.set_embedable()
- self._resetobject()
-
- def set_plain(self):
- """ Tell the parser to not generate CSS """
- self.generate_css = False
-
- def set_embedable(self):
- """ Tells the converter to only output the parts inside the """
- self.elements[(OFFICENS, u"text")] = (None,None)
- self.elements[(OFFICENS, u"spreadsheet")] = (None,None)
- self.elements[(OFFICENS, u"presentation")] = (None,None)
- self.elements[(OFFICENS, u"document-content")] = (None,None)
-
-
- def add_style_file(self, stylefilename, media=None):
- """ Add a link to an external style file.
- Also turns of the embedding of styles in the HTML
- """
- self.use_internal_css = False
- self.stylefilename = stylefilename
- if media:
- self.metatags.append(' \n' % (stylefilename,media))
- else:
- self.metatags.append(' \n' % (stylefilename))
-
- def _resetfootnotes(self):
- # Footnotes and endnotes
- self.notedict = {}
- self.currentnote = 0
- self.notebody = ''
-
- def _resetobject(self):
- self.lines = []
- self._wfunc = self._wlines
- self.xmlfile = ''
- self.title = ''
- self.language = ''
- self.creator = ''
- self.data = []
- self.tagstack = TagStack()
- self.htmlstack = []
- self.pstack = []
- self.processelem = True
- self.processcont = True
- self.listtypes = {}
- self.headinglevels = [0, 0,0,0,0,0, 0,0,0,0,0] # level 0 to 10
- self.use_internal_css = True
- self.cs = StyleToCSS()
- self.anchors = {}
-
- # Style declarations
- self.stylestack = []
- self.styledict = {}
- self.currentstyle = None
-
- self._resetfootnotes()
-
- # Tags from meta.xml
- self.metatags = []
-
-
- def writeout(self, s):
- if s != '':
- self._wfunc(s)
-
- def writedata(self):
- d = ''.join(self.data)
- if d != '':
- self.writeout(escape(d))
-
- def opentag(self, tag, attrs={}, block=False):
- """ Create an open HTML tag """
- self.htmlstack.append((tag,attrs,block))
- a = []
- for key,val in attrs.items():
- a.append('''%s=%s''' % (key, quoteattr(val)))
- if len(a) == 0:
- self.writeout("<%s>" % tag)
- else:
- self.writeout("<%s %s>" % (tag, " ".join(a)))
- if block == True:
- self.writeout("\n")
-
- def closetag(self, tag, block=True):
- """ Close an open HTML tag """
- self.htmlstack.pop()
- self.writeout("%s>" % tag)
- if block == True:
- self.writeout("\n")
-
- def emptytag(self, tag, attrs={}):
- a = []
- for key,val in attrs.items():
- a.append('''%s=%s''' % (key, quoteattr(val)))
- self.writeout("<%s %s/>\n" % (tag, " ".join(a)))
-
-#--------------------------------------------------
-# Interface to parser
-#--------------------------------------------------
- def characters(self, data):
- if self.processelem and self.processcont:
- self.data.append(data)
-
- def startElementNS(self, tag, qname, attrs):
- self.pstack.append( (self.processelem, self.processcont) )
- if self.processelem:
- method = self.elements.get(tag, (None, None) )[0]
- if method:
- self.handle_starttag(tag, method, attrs)
- else:
- self.unknown_starttag(tag,attrs)
- self.tagstack.push( tag, attrs )
-
- def endElementNS(self, tag, qname):
- stag, attrs = self.tagstack.pop()
- if self.processelem:
- method = self.elements.get(tag, (None, None) )[1]
- if method:
- self.handle_endtag(tag, attrs, method)
- else:
- self.unknown_endtag(tag, attrs)
- self.processelem, self.processcont = self.pstack.pop()
-
-#--------------------------------------------------
- def handle_starttag(self, tag, method, attrs):
- method(tag,attrs)
-
- def handle_endtag(self, tag, attrs, method):
- method(tag, attrs)
-
- def unknown_starttag(self, tag, attrs):
- pass
-
- def unknown_endtag(self, tag, attrs):
- pass
-
- def s_ignorexml(self, tag, attrs):
- """ Ignore this xml element and all children of it
- It will automatically stop ignoring
- """
- self.processelem = False
-
- def s_ignorecont(self, tag, attrs):
- """ Stop processing the text nodes """
- self.processcont = False
-
- def s_processcont(self, tag, attrs):
- """ Start processing the text nodes """
- self.processcont = True
-
- def classname(self, attrs):
- """ Generate a class name from a style name """
- c = attrs.get((TEXTNS,'style-name'),'')
- c = c.replace(".","_")
- return c
-
- def get_anchor(self, name):
- """ Create a unique anchor id for a href name """
- if name not in self.anchors:
- self.anchors[name] = "anchor%03d" % (len(self.anchors) + 1)
- return self.anchors.get(name)
-
-
-#--------------------------------------------------
-
- def purgedata(self):
- self.data = []
-
-#-----------------------------------------------------------------------------
-#
-# Handle meta data
-#
-#-----------------------------------------------------------------------------
- def e_dc_title(self, tag, attrs):
- """ Get the title from the meta data and create a HTML
- """
- self.title = ''.join(self.data)
- #self.metatags.append('%s \n' % escape(self.title))
- self.data = []
-
- def e_dc_metatag(self, tag, attrs):
- """ Any other meta data is added as a element
- """
- self.metatags.append(' \n' % (tag[1], quoteattr(''.join(self.data))))
- self.data = []
-
- def e_dc_contentlanguage(self, tag, attrs):
- """ Set the content language. Identifies the targeted audience
- """
- self.language = ''.join(self.data)
- self.metatags.append(' \n' % escape(self.language))
- self.data = []
-
- def e_dc_creator(self, tag, attrs):
- """ Set the content creator. Identifies the targeted audience
- """
- self.creator = ''.join(self.data)
- self.metatags.append(' \n' % escape(self.creator))
- self.data = []
-
- def s_custom_shape(self, tag, attrs):
- """ A is made into a in HTML which is then styled
- """
- anchor_type = attrs.get((TEXTNS,'anchor-type'),'notfound')
- htmltag = 'div'
- name = "G-" + attrs.get( (DRAWNS,'style-name'), "")
- if name == 'G-':
- name = "PR-" + attrs.get( (PRESENTATIONNS,'style-name'), "")
- name = name.replace(".","_")
- if anchor_type == "paragraph":
- style = 'position:absolute;'
- elif anchor_type == 'char':
- style = "position:absolute;"
- elif anchor_type == 'as-char':
- htmltag = 'div'
- style = ''
- else:
- style = "position: absolute;"
- if (SVGNS,"width")in attrs:
- style = style + "width:" + attrs[(SVGNS,"width")] + ";"
- if (SVGNS,"height") in attrs:
- style = style + "height:" + attrs[(SVGNS,"height")] + ";"
- if (SVGNS,"x") in attrs:
- style = style + "left:" + attrs[(SVGNS,"x")] + ";"
- if (SVGNS,"y") in attrs:
- style = style + "top:" + attrs[(SVGNS,"y")] + ";"
- if self.generate_css:
- self.opentag(htmltag, {'class': name, 'style': style})
- else:
- self.opentag(htmltag)
-
- def e_custom_shape(self, tag, attrs):
- """ End the
- """
- self.closetag('div')
-
- def s_draw_frame(self, tag, attrs):
- """ A is made into a in HTML which is then styled
- """
- anchor_type = attrs.get((TEXTNS,'anchor-type'),'notfound')
- htmltag = 'div'
- name = "G-" + attrs.get( (DRAWNS,'style-name'), "")
- if name == 'G-':
- name = "PR-" + attrs.get( (PRESENTATIONNS,'style-name'), "")
- name = name.replace(".","_")
- if anchor_type == "paragraph":
- style = 'position:relative;'
- elif anchor_type == 'char':
- style = "position:relative;"
- elif anchor_type == 'as-char':
- htmltag = 'div'
- style = ''
- else:
- style = "position:absolute;"
- if (SVGNS,"width") in attrs:
- style = style + "width:" + attrs[(SVGNS,"width")] + ";"
- if (SVGNS,"height") in attrs:
- style = style + "height:" + attrs[(SVGNS,"height")] + ";"
- if (SVGNS,"x") in attrs:
- style = style + "left:" + attrs[(SVGNS,"x")] + ";"
- if (SVGNS,"y") in attrs:
- style = style + "top:" + attrs[(SVGNS,"y")] + ";"
- if self.generate_css:
- self.opentag(htmltag, {'class': name, 'style': style})
- else:
- self.opentag(htmltag)
-
- def e_draw_frame(self, tag, attrs):
- """ End the
- """
- self.closetag('div')
-
- def s_draw_fill_image(self, tag, attrs):
- name = attrs.get( (DRAWNS,'name'), "NoName")
- imghref = attrs[(XLINKNS,"href")]
- imghref = self.rewritelink(imghref)
- self.cs.fillimages[name] = imghref
-
- def rewritelink(self, imghref):
- """ Intended to be overloaded if you don't store your pictures
- in a Pictures subfolder
- """
- return imghref
-
- def s_draw_image(self, tag, attrs):
- """ A becomes an element
- """
- parent = self.tagstack.stackparent()
- anchor_type = parent.get((TEXTNS,'anchor-type'))
- imghref = attrs[(XLINKNS,"href")]
- imghref = self.rewritelink(imghref)
- htmlattrs = {'alt':"", 'src':imghref }
- if self.generate_css:
- if anchor_type != "char":
- htmlattrs['style'] = "display: block;"
- self.emptytag('img', htmlattrs)
-
- def s_draw_object(self, tag, attrs):
- """ A is embedded object in the document (e.g. spreadsheet in presentation).
- """
- objhref = attrs[(XLINKNS,"href")]
- # Remove leading "./": from "./Object 1" to "Object 1"
-# objhref = objhref [2:]
-
- # Not using os.path.join since it fails to find the file on Windows.
-# objcontentpath = '/'.join([objhref, 'content.xml'])
-
- for c in self.document.childnodes:
- if c.folder == objhref:
- self._walknode(c.topnode)
-
- def s_draw_object_ole(self, tag, attrs):
- """ A is embedded OLE object in the document (e.g. MS Graph).
- """
- class_id = attrs[(DRAWNS,"class-id")]
- if class_id and class_id.lower() == "00020803-0000-0000-c000-000000000046": ## Microsoft Graph 97 Chart
- tagattrs = { 'name':'object_ole_graph', 'class':'ole-graph' }
- self.opentag('a', tagattrs)
- self.closetag('a', tagattrs)
-
- def s_draw_page(self, tag, attrs):
- """ A is a slide in a presentation. We use a element in HTML.
- Therefore if you convert a ODP file, you get a series of s.
- Override this for your own purpose.
- """
- name = attrs.get( (DRAWNS,'name'), "NoName")
- stylename = attrs.get( (DRAWNS,'style-name'), "")
- stylename = stylename.replace(".","_")
- masterpage = attrs.get( (DRAWNS,'master-page-name'),"")
- masterpage = masterpage.replace(".","_")
- if self.generate_css:
- self.opentag('fieldset', {'class':"DP-%s MP-%s" % (stylename, masterpage) })
- else:
- self.opentag('fieldset')
- self.opentag('legend')
- self.writeout(escape(name))
- self.closetag('legend')
-
- def e_draw_page(self, tag, attrs):
- self.closetag('fieldset')
-
- def s_draw_textbox(self, tag, attrs):
- style = ''
- if (FONS,"min-height") in attrs:
- style = style + "min-height:" + attrs[(FONS,"min-height")] + ";"
- self.opentag('div')
-# self.opentag('div', {'style': style})
-
- def e_draw_textbox(self, tag, attrs):
- """ End the
- """
- self.closetag('div')
-
- def html_body(self, tag, attrs):
- self.writedata()
- if self.generate_css and self.use_internal_css:
- self.opentag('style', {'type':"text/css"}, True)
- self.writeout('/**/\n')
- self.closetag('style')
- self.purgedata()
- self.closetag('head')
- self.opentag('body', block=True)
-
- default_styles = """
-img { width: 100%; height: 100%; }
-* { padding: 0; margin: 0; background-color:white; }
-body { margin: 0 1em; }
-ol, ul { padding-left: 2em; }
-"""
-
- def generate_stylesheet(self):
- for name in self.stylestack:
- styles = self.styledict.get(name)
- # Preload with the family's default style
- if '__style-family'in styles and styles['__style-family'] in self.styledict:
- familystyle = self.styledict[styles['__style-family']].copy()
- del styles['__style-family']
- for style, val in styles.items():
- familystyle[style] = val
- styles = familystyle
- # Resolve the remaining parent styles
- while '__parent-style-name' in styles and styles['__parent-style-name'] in self.styledict:
- parentstyle = self.styledict[styles['__parent-style-name']].copy()
- del styles['__parent-style-name']
- for style, val in styles.items():
- parentstyle[style] = val
- styles = parentstyle
- self.styledict[name] = styles
- # Write the styles to HTML
- self.writeout(self.default_styles)
- for name in self.stylestack:
- styles = self.styledict.get(name)
- css2 = self.cs.convert_styles(styles)
- self.writeout("%s {\n" % name)
- for style, val in css2.items():
- self.writeout("\t%s: %s;\n" % (style, val) )
- self.writeout("}\n")
-
- def generate_footnotes(self):
- if self.currentnote == 0:
- return
- if self.generate_css:
- self.opentag('ol', {'style':'border-top: 1px solid black'}, True)
- else:
- self.opentag('ol')
- for key in range(1,self.currentnote+1):
- note = self.notedict[key]
-# for key,note in self.notedict.items():
- self.opentag('li', { 'id':"footnote-%d" % key })
-# self.opentag('sup')
-# self.writeout(escape(note['citation']))
-# self.closetag('sup', False)
- self.writeout(note['body'])
- self.closetag('li')
- self.closetag('ol')
-
- def s_office_automatic_styles(self, tag, attrs):
- if self.xmlfile == 'styles.xml':
- self.autoprefix = "A"
- else:
- self.autoprefix = ""
-
- def s_office_document_content(self, tag, attrs):
- """ First tag in the content.xml file"""
- self.writeout('\n')
- self.opentag('html', {'xmlns':"http://www.w3.org/1999/xhtml"}, True)
- self.opentag('head', block=True)
- self.emptytag('meta', { 'http-equiv':"Content-Type", 'content':"text/html;charset=UTF-8"})
- for metaline in self.metatags:
- self.writeout(metaline)
- self.writeout('%s \n' % escape(self.title))
-
- def e_office_document_content(self, tag, attrs):
- """ Last tag """
- self.closetag('html')
-
- def s_office_master_styles(self, tag, attrs):
- """ """
-
- def s_office_presentation(self, tag, attrs):
- """ For some odd reason, OpenOffice Impress doesn't define a default-style
- for the 'paragraph'. We therefore force a standard when we see
- it is a presentation
- """
- self.styledict['p'] = {(FONS,u'font-size'): u"24pt" }
- self.styledict['presentation'] = {(FONS,u'font-size'): u"24pt" }
- self.html_body(tag, attrs)
-
- def e_office_presentation(self, tag, attrs):
- self.generate_footnotes()
- self.closetag('body')
-
- def s_office_spreadsheet(self, tag, attrs):
- self.html_body(tag, attrs)
-
- def e_office_spreadsheet(self, tag, attrs):
- self.generate_footnotes()
- self.closetag('body')
-
- def s_office_styles(self, tag, attrs):
- self.autoprefix = ""
-
- def s_office_text(self, tag, attrs):
- """ OpenDocument text """
- self.styledict['frame'] = { (STYLENS,'wrap'): u'parallel'}
- self.html_body(tag, attrs)
-
- def e_office_text(self, tag, attrs):
- self.generate_footnotes()
- self.closetag('body')
-
- def s_style_handle_properties(self, tag, attrs):
- """ Copy all attributes to a struct.
- We will later convert them to CSS2
- """
- for key,attr in attrs.items():
- self.styledict[self.currentstyle][key] = attr
-
-
- familymap = {'frame':'frame', 'paragraph':'p', 'presentation':'presentation',
- 'text':'span','section':'div',
- 'table':'table','table-cell':'td','table-column':'col',
- 'table-row':'tr','graphic':'graphic' }
-
- def s_style_default_style(self, tag, attrs):
- """ A default style is like a style on an HTML tag
- """
- family = attrs[(STYLENS,'family')]
- htmlfamily = self.familymap.get(family,'unknown')
- self.currentstyle = htmlfamily
-# self.stylestack.append(self.currentstyle)
- self.styledict[self.currentstyle] = {}
-
- def e_style_default_style(self, tag, attrs):
- self.currentstyle = None
-
- def s_style_font_face(self, tag, attrs):
- """ It is possible that the HTML browser doesn't know how to
- show a particular font. Luckily ODF provides generic fallbacks
- Unfortunately they are not the same as CSS2.
- CSS2: serif, sans-serif, cursive, fantasy, monospace
- ODF: roman, swiss, modern, decorative, script, system
- """
- name = attrs[(STYLENS,"name")]
- family = attrs[(SVGNS,"font-family")]
- generic = attrs.get( (STYLENS,'font-family-generic'),"" )
- self.cs.save_font(name, family, generic)
-
- def s_style_footer(self, tag, attrs):
- self.opentag('div', { 'id':"footer" })
- self.purgedata()
-
- def e_style_footer(self, tag, attrs):
- self.writedata()
- self.closetag('div')
- self.purgedata()
-
- def s_style_footer_style(self, tag, attrs):
- self.currentstyle = "@print #footer"
- self.stylestack.append(self.currentstyle)
- self.styledict[self.currentstyle] = {}
-
- def s_style_header(self, tag, attrs):
- self.opentag('div', { 'id':"header" })
- self.purgedata()
-
- def e_style_header(self, tag, attrs):
- self.writedata()
- self.closetag('div')
- self.purgedata()
-
- def s_style_header_style(self, tag, attrs):
- self.currentstyle = "@print #header"
- self.stylestack.append(self.currentstyle)
- self.styledict[self.currentstyle] = {}
-
- def s_style_default_page_layout(self, tag, attrs):
- """ Collect the formatting for the default page layout style.
- """
- self.currentstyle = "@page"
- self.stylestack.append(self.currentstyle)
- self.styledict[self.currentstyle] = {}
-
- def s_style_page_layout(self, tag, attrs):
- """ Collect the formatting for the page layout style.
- This won't work in CSS 2.1, as page identifiers are not allowed.
- It is legal in CSS3, but the rest of the application doesn't specify when to use what page layout
- """
- name = attrs[(STYLENS,'name')]
- name = name.replace(".","_")
- self.currentstyle = ".PL-" + name
- self.stylestack.append(self.currentstyle)
- self.styledict[self.currentstyle] = {}
-
- def e_style_page_layout(self, tag, attrs):
- """ End this style
- """
- self.currentstyle = None
-
- def s_style_master_page(self, tag, attrs):
- """ Collect the formatting for the page layout style.
- """
- name = attrs[(STYLENS,'name')]
- name = name.replace(".","_")
-
- self.currentstyle = ".MP-" + name
- self.stylestack.append(self.currentstyle)
- self.styledict[self.currentstyle] = {('','position'):'relative'}
- # Then load the pagelayout style if we find it
- pagelayout = attrs.get( (STYLENS,'page-layout-name'), None)
- if pagelayout:
- pagelayout = ".PL-" + pagelayout
- if pagelayout in self.styledict:
- styles = self.styledict[pagelayout]
- for style, val in styles.items():
- self.styledict[self.currentstyle][style] = val
- else:
- self.styledict[self.currentstyle]['__parent-style-name'] = pagelayout
- self.s_ignorexml(tag, attrs)
-
- # Short prefixes for class selectors
- _familyshort = {'drawing-page':'DP', 'paragraph':'P', 'presentation':'PR',
- 'text':'S', 'section':'D',
- 'table':'T', 'table-cell':'TD', 'table-column':'TC',
- 'table-row':'TR', 'graphic':'G' }
-
- def s_style_style(self, tag, attrs):
- """ Collect the formatting for the style.
- Styles have scope. The same name can be used for both paragraph and
- character styles Since CSS has no scope we use a prefix. (Not elegant)
- In ODF a style can have a parent, these parents can be chained.
- We may not have encountered the parent yet, but if we have, we resolve it.
- """
- name = attrs[(STYLENS,'name')]
- name = name.replace(".","_")
- family = attrs[(STYLENS,'family')]
- htmlfamily = self.familymap.get(family,'unknown')
- sfamily = self._familyshort.get(family,'X')
- name = "%s%s-%s" % (self.autoprefix, sfamily, name)
- parent = attrs.get( (STYLENS,'parent-style-name') )
- self.currentstyle = special_styles.get(name,"."+name)
- self.stylestack.append(self.currentstyle)
- if self.currentstyle not in self.styledict:
- self.styledict[self.currentstyle] = {}
-
- self.styledict[self.currentstyle]['__style-family'] = htmlfamily
-
- # Then load the parent style if we find it
- if parent:
- parent = "%s-%s" % (sfamily, parent)
- parent = special_styles.get(parent, "."+parent)
- if parent in self.styledict:
- styles = self.styledict[parent]
- for style, val in styles.items():
- self.styledict[self.currentstyle][style] = val
- else:
- self.styledict[self.currentstyle]['__parent-style-name'] = parent
-
- def e_style_style(self, tag, attrs):
- """ End this style
- """
- self.currentstyle = None
-
- def s_table_table(self, tag, attrs):
- """ Start a table
- """
- c = attrs.get( (TABLENS,'style-name'), None)
- if c and self.generate_css:
- c = c.replace(".","_")
- self.opentag('table',{ 'class': "T-%s" % c })
- else:
- self.opentag('table')
- self.purgedata()
-
- def e_table_table(self, tag, attrs):
- """ End a table
- """
- self.writedata()
- self.closetag('table')
- self.purgedata()
-
- def s_table_table_cell(self, tag, attrs):
- """ Start a table cell """
- #FIXME: number-columns-repeated § 8.1.3
- #repeated = int(attrs.get( (TABLENS,'number-columns-repeated'), 1))
- htmlattrs = {}
- rowspan = attrs.get( (TABLENS,'number-rows-spanned') )
- if rowspan:
- htmlattrs['rowspan'] = rowspan
- colspan = attrs.get( (TABLENS,'number-columns-spanned') )
- if colspan:
- htmlattrs['colspan'] = colspan
-
- c = attrs.get( (TABLENS,'style-name') )
- if c:
- htmlattrs['class'] = 'TD-%s' % c.replace(".","_")
- self.opentag('td', htmlattrs)
- self.purgedata()
-
- def e_table_table_cell(self, tag, attrs):
- """ End a table cell """
- self.writedata()
- self.closetag('td')
- self.purgedata()
-
- def s_table_table_column(self, tag, attrs):
- """ Start a table column """
- c = attrs.get( (TABLENS,'style-name'), None)
- repeated = int(attrs.get( (TABLENS,'number-columns-repeated'), 1))
- htmlattrs = {}
- if c:
- htmlattrs['class'] = "TC-%s" % c.replace(".","_")
- for x in range(repeated):
- self.emptytag('col', htmlattrs)
- self.purgedata()
-
- def s_table_table_row(self, tag, attrs):
- """ Start a table row """
- #FIXME: table:number-rows-repeated
- c = attrs.get( (TABLENS,'style-name'), None)
- htmlattrs = {}
- if c:
- htmlattrs['class'] = "TR-%s" % c.replace(".","_")
- self.opentag('tr', htmlattrs)
- self.purgedata()
-
- def e_table_table_row(self, tag, attrs):
- """ End a table row """
- self.writedata()
- self.closetag('tr')
- self.purgedata()
-
- def s_text_a(self, tag, attrs):
- """ Anchors start """
- self.writedata()
- href = attrs[(XLINKNS,"href")].split("|")[0]
- if href[0] == "#":
- href = "#" + self.get_anchor(href[1:])
- self.opentag('a', {'href':href})
- self.purgedata()
-
- def e_text_a(self, tag, attrs):
- """ End an anchor or bookmark reference """
- self.writedata()
- self.closetag('a', False)
- self.purgedata()
-
- def s_text_bookmark(self, tag, attrs):
- """ Bookmark definition """
- name = attrs[(TEXTNS,'name')]
- html_id = self.get_anchor(name)
- self.writedata()
- self.opentag('span', {'id':html_id})
- self.closetag('span', False)
- self.purgedata()
-
- def s_text_bookmark_ref(self, tag, attrs):
- """ Bookmark reference """
- name = attrs[(TEXTNS,'ref-name')]
- html_id = "#" + self.get_anchor(name)
- self.writedata()
- self.opentag('a', {'href':html_id})
- self.purgedata()
-
- def s_text_h(self, tag, attrs):
- """ Headings start """
- level = int(attrs[(TEXTNS,'outline-level')])
- if level > 6: level = 6 # Heading levels go only to 6 in XHTML
- if level < 1: level = 1
- self.headinglevels[level] = self.headinglevels[level] + 1
- name = self.classname(attrs)
- for x in range(level + 1,10):
- self.headinglevels[x] = 0
- special = special_styles.get("P-"+name)
- if special or not self.generate_css:
- self.opentag('h%s' % level)
- else:
- self.opentag('h%s' % level, {'class':"P-%s" % name })
- self.purgedata()
-
- def e_text_h(self, tag, attrs):
- """ Headings end
- Side-effect: If there is no title in the metadata, then it is taken
- from the first heading of any level.
- """
- self.writedata()
- level = int(attrs[(TEXTNS,'outline-level')])
- if level > 6: level = 6 # Heading levels go only to 6 in XHTML
- if level < 1: level = 1
- lev = self.headinglevels[1:level+1]
- outline = '.'.join(map(str,lev) )
- heading = ''.join(self.data)
- if self.title == '': self.title = heading
- anchor = self.get_anchor("%s.%s" % ( outline, heading))
- self.opentag('a', {'id': anchor} )
- self.closetag('a', False)
- self.closetag('h%s' % level)
- self.purgedata()
-
- def s_text_line_break(self, tag, attrs):
- """ Force a line break ( ) """
- self.writedata()
- self.emptytag('br')
- self.purgedata()
-
- def s_text_list(self, tag, attrs):
- """ Start a list ( or )
- To know which level we're at, we have to count the number
- of elements on the tagstack.
- """
- name = attrs.get( (TEXTNS,'style-name') )
- level = self.tagstack.count_tags(tag) + 1
- if name:
- name = name.replace(".","_")
- else:
- # FIXME: If a list is contained in a table cell or text box,
- # the list level must return to 1, even though the table or
- # textbox itself may be nested within another list.
- name = self.tagstack.rfindattr( (TEXTNS,'style-name') )
- list_class = "%s_%d" % (name, level)
- if self.generate_css:
- self.opentag('%s' % self.listtypes.get(list_class,'ul'), {'class': list_class })
- else:
- self.opentag('%s' % self.listtypes.get(list_class,'ul'))
- self.purgedata()
-
- def e_text_list(self, tag, attrs):
- """ End a list """
- self.writedata()
- name = attrs.get( (TEXTNS,'style-name') )
- level = self.tagstack.count_tags(tag) + 1
- if name:
- name = name.replace(".","_")
- else:
- # FIXME: If a list is contained in a table cell or text box,
- # the list level must return to 1, even though the table or
- # textbox itself may be nested within another list.
- name = self.tagstack.rfindattr( (TEXTNS,'style-name') )
- list_class = "%s_%d" % (name, level)
- self.closetag(self.listtypes.get(list_class,'ul'))
- self.purgedata()
-
- def s_text_list_item(self, tag, attrs):
- """ Start list item """
- self.opentag('li')
- self.purgedata()
-
- def e_text_list_item(self, tag, attrs):
- """ End list item """
- self.writedata()
- self.closetag('li')
- self.purgedata()
-
- def s_text_list_level_style_bullet(self, tag, attrs):
- """ CSS doesn't have the ability to set the glyph
- to a particular character, so we just go through
- the available glyphs
- """
- name = self.tagstack.rfindattr( (STYLENS,'name') )
- level = attrs[(TEXTNS,'level')]
- self.prevstyle = self.currentstyle
- list_class = "%s_%s" % (name, level)
- self.listtypes[list_class] = 'ul'
- self.currentstyle = ".%s_%s" % ( name.replace(".","_"), level)
- self.stylestack.append(self.currentstyle)
- self.styledict[self.currentstyle] = {}
-
- level = int(level)
- listtype = ("square", "disc", "circle")[level % 3]
- self.styledict[self.currentstyle][('','list-style-type')] = listtype
-
- def e_text_list_level_style_bullet(self, tag, attrs):
- self.currentstyle = self.prevstyle
- del self.prevstyle
-
- def s_text_list_level_style_number(self, tag, attrs):
- name = self.tagstack.stackparent()[(STYLENS,'name')]
- level = attrs[(TEXTNS,'level')]
- num_format = attrs.get( (STYLENS,'name'),"1")
- list_class = "%s_%s" % (name, level)
- self.prevstyle = self.currentstyle
- self.currentstyle = ".%s_%s" % ( name.replace(".","_"), level)
- self.listtypes[list_class] = 'ol'
- self.stylestack.append(self.currentstyle)
- self.styledict[self.currentstyle] = {}
- if num_format == "1": listtype = "decimal"
- elif num_format == "I": listtype = "upper-roman"
- elif num_format == "i": listtype = "lower-roman"
- elif num_format == "A": listtype = "upper-alpha"
- elif num_format == "a": listtype = "lower-alpha"
- else: listtype = "decimal"
- self.styledict[self.currentstyle][('','list-style-type')] = listtype
-
- def e_text_list_level_style_number(self, tag, attrs):
- self.currentstyle = self.prevstyle
- del self.prevstyle
-
- def s_text_note(self, tag, attrs):
- self.writedata()
- self.purgedata()
- self.currentnote = self.currentnote + 1
- self.notedict[self.currentnote] = {}
- self.notebody = []
-
- def e_text_note(self, tag, attrs):
- pass
-
- def collectnote(self,s):
- if s != '':
- self.notebody.append(s)
-
- def s_text_note_body(self, tag, attrs):
- self._orgwfunc = self._wfunc
- self._wfunc = self.collectnote
-
- def e_text_note_body(self, tag, attrs):
- self._wfunc = self._orgwfunc
- self.notedict[self.currentnote]['body'] = ''.join(self.notebody)
- self.notebody = ''
- del self._orgwfunc
-
- def e_text_note_citation(self, tag, attrs):
- mark = ''.join(self.data)
- self.notedict[self.currentnote]['citation'] = mark
- self.opentag('a',{ 'href': "#footnote-%s" % self.currentnote })
- self.opentag('sup')
-# self.writeout( escape(mark) )
- # Since HTML only knows about endnotes, there is too much risk that the
- # marker is reused in the source. Therefore we force numeric markers
- if sys.version_info[0]==3:
- self.writeout(self.currentnote)
- else:
- self.writeout(unicode(self.currentnote))
- self.closetag('sup')
- self.closetag('a')
-
- def s_text_p(self, tag, attrs):
- """ Paragraph
- """
- htmlattrs = {}
- specialtag = "p"
- c = attrs.get( (TEXTNS,'style-name'), None)
- if c:
- c = c.replace(".","_")
- specialtag = special_styles.get("P-"+c)
- if specialtag is None:
- specialtag = 'p'
- if self.generate_css:
- htmlattrs['class'] = "P-%s" % c
- self.opentag(specialtag, htmlattrs)
- self.purgedata()
-
- def e_text_p(self, tag, attrs):
- """ End Paragraph
- """
- specialtag = "p"
- c = attrs.get( (TEXTNS,'style-name'), None)
- if c:
- c = c.replace(".","_")
- specialtag = special_styles.get("P-"+c)
- if specialtag is None:
- specialtag = 'p'
- self.writedata()
- self.closetag(specialtag)
- self.purgedata()
-
- def s_text_s(self, tag, attrs):
- """ Generate a number of spaces. ODF has an element; HTML uses
- We use so we can send the output through an XML parser if we desire to
- """
- c = attrs.get( (TEXTNS,'c'),"1")
- for x in range(int(c)):
- self.writeout(' ')
-
- def s_text_span(self, tag, attrs):
- """ The element matches the element in HTML. It is
- typically used to properties of the text.
- """
- self.writedata()
- c = attrs.get( (TEXTNS,'style-name'), None)
- htmlattrs = {}
- if c:
- c = c.replace(".","_")
- special = special_styles.get("S-"+c)
- if special is None and self.generate_css:
- htmlattrs['class'] = "S-%s" % c
- self.opentag('span', htmlattrs)
- self.purgedata()
-
- def e_text_span(self, tag, attrs):
- """ End the """
- self.writedata()
- self.closetag('span', False)
- self.purgedata()
-
- def s_text_tab(self, tag, attrs):
- """ Move to the next tabstop. We ignore this in HTML
- """
- self.writedata()
- self.writeout(' ')
- self.purgedata()
-
- def s_text_x_source(self, tag, attrs):
- """ Various indexes and tables of contents. We ignore those.
- """
- self.writedata()
- self.purgedata()
- self.s_ignorexml(tag, attrs)
-
- def e_text_x_source(self, tag, attrs):
- """ Various indexes and tables of contents. We ignore those.
- """
- self.writedata()
- self.purgedata()
-
-
-#-----------------------------------------------------------------------------
-#
-# Reading the file
-#
-#-----------------------------------------------------------------------------
-
- def load(self, odffile):
- """
- Loads a document into the parser and parses it.
- The argument can either be a filename or a document in memory.
- @param odffile if the type is unicode string: name of a file; else
- it must be an open file type
- """
- assert(type(odffile)==type(u"") or 'rb' in repr(odffile) or 'BufferedReader' in repr(odffile) or 'BytesIO' in repr(odffile))
-
- self.lines = []
- self._wfunc = self._wlines
- if type(odffile)==type(u""):
- self.document = load(odffile)
- else:
- self.document = odffile
- self._walknode(self.document.topnode)
-
- def _walknode(self, node):
- if node.nodeType == Node.ELEMENT_NODE:
- self.startElementNS(node.qname, node.tagName, node.attributes)
- for c in node.childNodes:
- self._walknode(c)
- self.endElementNS(node.qname, node.tagName)
- if node.nodeType == Node.TEXT_NODE or node.nodeType == Node.CDATA_SECTION_NODE:
- if sys.version_info[0]==3:
- self.characters(str(node))
- else:
- self.characters(unicode(node))
-
-
- def odf2xhtml(self, odffile):
- """
- Load a file and return the XHTML
- @param odffile if the type is unicode string: name of a file; else
- it must be an open file type
- @return XHTML code as a a unicode string
- """
- assert(type(odffile)==type(u"") or 'rb' in repr(odffile) or 'BufferedReader' in repr(odffile) or 'BytesIO' in repr(odffile))
-
-
- self.load(odffile)
-
- result=self.xhtml()
- assert(type(result)==type(u""))
- return result
-
- def _wlines(self,s):
- if s != '': self.lines.append(s)
-
- def xhtml(self):
- """ Returns the xhtml
- """
- return ''.join(self.lines)
-
- def _writecss(self, s):
- if s != '': self._csslines.append(s)
-
- def _writenothing(self, s):
- pass
-
- def css(self):
- """ Returns the CSS content """
- self._csslines = []
- self._wfunc = self._writecss
- self.generate_stylesheet()
- res = ''.join(self._csslines)
- self._wfunc = self._wlines
- del self._csslines
- return res
-
- def save(self, outputfile, addsuffix=False):
- """ Save the HTML under the filename.
- If the filename is '-' then save to stdout
- We have the last style filename in self.stylefilename
- """
- if outputfile == '-':
- outputfp = sys.stdout
- else:
- if addsuffix:
- outputfile = outputfile + ".html"
- outputfp = file(outputfile, "w")
- outputfp.write(self.xhtml().encode('us-ascii','xmlcharrefreplace'))
- outputfp.close()
-
-
-class ODF2XHTMLembedded(ODF2XHTML):
- """ The ODF2XHTML parses an ODF file and produces XHTML"""
-
- def __init__(self, lines, generate_css=True, embedable=False):
- self._resetobject()
- self.lines = lines
-
- # Tags
- self.generate_css = generate_css
- self.elements = {
-# (DCNS, 'title'): (self.s_processcont, self.e_dc_title),
-# (DCNS, 'language'): (self.s_processcont, self.e_dc_contentlanguage),
-# (DCNS, 'creator'): (self.s_processcont, self.e_dc_metatag),
-# (DCNS, 'description'): (self.s_processcont, self.e_dc_metatag),
-# (DCNS, 'date'): (self.s_processcont, self.e_dc_metatag),
- (DRAWNS, 'frame'): (self.s_draw_frame, self.e_draw_frame),
- (DRAWNS, 'image'): (self.s_draw_image, None),
- (DRAWNS, 'fill-image'): (self.s_draw_fill_image, None),
- (DRAWNS, "layer-set"):(self.s_ignorexml, None),
- (DRAWNS, 'page'): (self.s_draw_page, self.e_draw_page),
- (DRAWNS, 'object'): (self.s_draw_object, None),
- (DRAWNS, 'object-ole'): (self.s_draw_object_ole, None),
- (DRAWNS, 'text-box'): (self.s_draw_textbox, self.e_draw_textbox),
-# (METANS, 'creation-date'):(self.s_processcont, self.e_dc_metatag),
-# (METANS, 'generator'):(self.s_processcont, self.e_dc_metatag),
-# (METANS, 'initial-creator'): (self.s_processcont, self.e_dc_metatag),
-# (METANS, 'keyword'): (self.s_processcont, self.e_dc_metatag),
- (NUMBERNS, "boolean-style"):(self.s_ignorexml, None),
- (NUMBERNS, "currency-style"):(self.s_ignorexml, None),
- (NUMBERNS, "date-style"):(self.s_ignorexml, None),
- (NUMBERNS, "number-style"):(self.s_ignorexml, None),
- (NUMBERNS, "text-style"):(self.s_ignorexml, None),
-# (OFFICENS, "automatic-styles"):(self.s_office_automatic_styles, None),
-# (OFFICENS, "document-content"):(self.s_office_document_content, self.e_office_document_content),
- (OFFICENS, "forms"):(self.s_ignorexml, None),
-# (OFFICENS, "master-styles"):(self.s_office_master_styles, None),
- (OFFICENS, "meta"):(self.s_ignorecont, None),
-# (OFFICENS, "presentation"):(self.s_office_presentation, self.e_office_presentation),
-# (OFFICENS, "spreadsheet"):(self.s_office_spreadsheet, self.e_office_spreadsheet),
-# (OFFICENS, "styles"):(self.s_office_styles, None),
-# (OFFICENS, "text"):(self.s_office_text, self.e_office_text),
- (OFFICENS, "scripts"):(self.s_ignorexml, None),
- (PRESENTATIONNS, "notes"):(self.s_ignorexml, None),
-## (STYLENS, "default-page-layout"):(self.s_style_default_page_layout, self.e_style_page_layout),
-# (STYLENS, "default-page-layout"):(self.s_ignorexml, None),
-# (STYLENS, "default-style"):(self.s_style_default_style, self.e_style_default_style),
-# (STYLENS, "drawing-page-properties"):(self.s_style_handle_properties, None),
-# (STYLENS, "font-face"):(self.s_style_font_face, None),
-## (STYLENS, "footer"):(self.s_style_footer, self.e_style_footer),
-## (STYLENS, "footer-style"):(self.s_style_footer_style, None),
-# (STYLENS, "graphic-properties"):(self.s_style_handle_properties, None),
-# (STYLENS, "handout-master"):(self.s_ignorexml, None),
-## (STYLENS, "header"):(self.s_style_header, self.e_style_header),
-## (STYLENS, "header-footer-properties"):(self.s_style_handle_properties, None),
-## (STYLENS, "header-style"):(self.s_style_header_style, None),
-# (STYLENS, "master-page"):(self.s_style_master_page, None),
-# (STYLENS, "page-layout-properties"):(self.s_style_handle_properties, None),
-## (STYLENS, "page-layout"):(self.s_style_page_layout, self.e_style_page_layout),
-# (STYLENS, "page-layout"):(self.s_ignorexml, None),
-# (STYLENS, "paragraph-properties"):(self.s_style_handle_properties, None),
-# (STYLENS, "style"):(self.s_style_style, self.e_style_style),
-# (STYLENS, "table-cell-properties"):(self.s_style_handle_properties, None),
-# (STYLENS, "table-column-properties"):(self.s_style_handle_properties, None),
-# (STYLENS, "table-properties"):(self.s_style_handle_properties, None),
-# (STYLENS, "text-properties"):(self.s_style_handle_properties, None),
- (SVGNS, 'desc'): (self.s_ignorexml, None),
- (TABLENS, 'covered-table-cell'): (self.s_ignorexml, None),
- (TABLENS, 'table-cell'): (self.s_table_table_cell, self.e_table_table_cell),
- (TABLENS, 'table-column'): (self.s_table_table_column, None),
- (TABLENS, 'table-row'): (self.s_table_table_row, self.e_table_table_row),
- (TABLENS, 'table'): (self.s_table_table, self.e_table_table),
- (TEXTNS, 'a'): (self.s_text_a, self.e_text_a),
- (TEXTNS, "alphabetical-index-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, "bibliography-configuration"):(self.s_ignorexml, None),
- (TEXTNS, "bibliography-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, 'h'): (self.s_text_h, self.e_text_h),
- (TEXTNS, "illustration-index-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, 'line-break'):(self.s_text_line_break, None),
- (TEXTNS, "linenumbering-configuration"):(self.s_ignorexml, None),
- (TEXTNS, "list"):(self.s_text_list, self.e_text_list),
- (TEXTNS, "list-item"):(self.s_text_list_item, self.e_text_list_item),
- (TEXTNS, "list-level-style-bullet"):(self.s_text_list_level_style_bullet, self.e_text_list_level_style_bullet),
- (TEXTNS, "list-level-style-number"):(self.s_text_list_level_style_number, self.e_text_list_level_style_number),
- (TEXTNS, "list-style"):(None, None),
- (TEXTNS, "note"):(self.s_text_note, None),
- (TEXTNS, "note-body"):(self.s_text_note_body, self.e_text_note_body),
- (TEXTNS, "note-citation"):(None, self.e_text_note_citation),
- (TEXTNS, "notes-configuration"):(self.s_ignorexml, None),
- (TEXTNS, "object-index-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, 'p'): (self.s_text_p, self.e_text_p),
- (TEXTNS, 's'): (self.s_text_s, None),
- (TEXTNS, 'span'): (self.s_text_span, self.e_text_span),
- (TEXTNS, 'tab'): (self.s_text_tab, None),
- (TEXTNS, "table-index-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, "table-of-content-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, "user-index-source"):(self.s_text_x_source, self.e_text_x_source),
- (TEXTNS, "page-number"):(None, None),
- }
-
diff --git a/libs/odf/odfmanifest.py b/libs/odf/odfmanifest.py
deleted file mode 100644
index 70649ca..0000000
--- a/libs/odf/odfmanifest.py
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-from __future__ import print_function
-# This script lists the content of the manifest.xml file
-import zipfile
-from xml.sax import make_parser,handler
-from xml.sax.xmlreader import InputSource
-import xml.sax.saxutils
-try:
- from cStringIO import StringIO
-except ImportError:
- from io import StringIO
-
-MANIFESTNS="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"
-
-#-----------------------------------------------------------------------------
-#
-# ODFMANIFESTHANDLER
-#
-#-----------------------------------------------------------------------------
-
-class ODFManifestHandler(handler.ContentHandler):
- """ The ODFManifestHandler parses a manifest file and produces a list of
- content """
-
- def __init__(self):
- self.manifest = {}
-
- # Tags
- # FIXME: Also handle encryption data
- self.elements = {
- (MANIFESTNS, 'file-entry'): (self.s_file_entry, self.donothing),
- }
-
- def handle_starttag(self, tag, method, attrs):
- method(tag,attrs)
-
- def handle_endtag(self, tag, method):
- method(tag)
-
- def startElementNS(self, tag, qname, attrs):
- method = self.elements.get(tag, (None, None))[0]
- if method:
- self.handle_starttag(tag, method, attrs)
- else:
- self.unknown_starttag(tag,attrs)
-
- def endElementNS(self, tag, qname):
- method = self.elements.get(tag, (None, None))[1]
- if method:
- self.handle_endtag(tag, method)
- else:
- self.unknown_endtag(tag)
-
- def unknown_starttag(self, tag, attrs):
- pass
-
- def unknown_endtag(self, tag):
- pass
-
- def donothing(self, tag, attrs=None):
- pass
-
- def s_file_entry(self, tag, attrs):
- m = attrs.get((MANIFESTNS, 'media-type'),"application/octet-stream")
- p = attrs.get((MANIFESTNS, 'full-path'))
- self.manifest[p] = { 'media-type':m, 'full-path':p }
-
-
-#-----------------------------------------------------------------------------
-#
-# Reading the file
-#
-#-----------------------------------------------------------------------------
-
-def manifestlist(manifestxml):
- odhandler = ODFManifestHandler()
- parser = make_parser()
- parser.setFeature(handler.feature_namespaces, 1)
- parser.setContentHandler(odhandler)
- parser.setErrorHandler(handler.ErrorHandler())
-
- inpsrc = InputSource()
- if not isinstance(manifestxml, str):
- manifestxml=manifestxml.decode("utf-8")
- inpsrc.setByteStream(StringIO(manifestxml))
- parser.parse(inpsrc)
-
- return odhandler.manifest
-
-def odfmanifest(odtfile):
- z = zipfile.ZipFile(odtfile)
- manifest = z.read('META-INF/manifest.xml')
- z.close()
- return manifestlist(manifest)
-
-if __name__ == "__main__":
- import sys
- result = odfmanifest(sys.argv[1])
- for file in result.values():
- print ("%-40s %-40s" % (file['media-type'], file['full-path']))
-
diff --git a/libs/odf/office.py b/libs/odf/office.py
deleted file mode 100644
index 2d6b752..0000000
--- a/libs/odf/office.py
+++ /dev/null
@@ -1,107 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2013 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import OFFICENS
-from element import Element
-from draw import StyleRefElement
-
-# Autogenerated
-def Annotation(**args):
- return StyleRefElement(qname = (OFFICENS,'annotation'), **args)
-
-def AnnotationEnd(**args):
- return StyleRefElement(qname = (OFFICENS,'annotation-end'), **args)
-
-def AutomaticStyles(**args):
- return Element(qname = (OFFICENS, 'automatic-styles'), **args)
-
-def BinaryData(**args):
- return Element(qname = (OFFICENS,'binary-data'), **args)
-
-def Body(**args):
- return Element(qname = (OFFICENS, 'body'), **args)
-
-def ChangeInfo(**args):
- return Element(qname = (OFFICENS,'change-info'), **args)
-
-def Chart(**args):
- return Element(qname = (OFFICENS,'chart'), **args)
-
-def DdeSource(**args):
- return Element(qname = (OFFICENS,'dde-source'), **args)
-
-def Document(version="1.2", **args):
- return Element(qname = (OFFICENS,'document'), version=version, **args)
-
-def DocumentContent(version="1.2", **args):
- return Element(qname = (OFFICENS, 'document-content'), version=version, **args)
-
-def DocumentMeta(version="1.2", **args):
- return Element(qname = (OFFICENS, 'document-meta'), version=version, **args)
-
-def DocumentSettings(version="1.2", **args):
- return Element(qname = (OFFICENS, 'document-settings'), version=version, **args)
-
-def DocumentStyles(version="1.2", **args):
- return Element(qname = (OFFICENS, 'document-styles'), version=version, **args)
-
-def Drawing(**args):
- return Element(qname = (OFFICENS,'drawing'), **args)
-
-def EventListeners(**args):
- return Element(qname = (OFFICENS,'event-listeners'), **args)
-
-def FontFaceDecls(**args):
- return Element(qname = (OFFICENS, 'font-face-decls'), **args)
-
-def Forms(**args):
- return Element(qname = (OFFICENS,'forms'), **args)
-
-def Image(**args):
- return Element(qname = (OFFICENS,'image'), **args)
-
-def MasterStyles(**args):
- return Element(qname = (OFFICENS, 'master-styles'), **args)
-
-def Meta(**args):
- return Element(qname = (OFFICENS, 'meta'), **args)
-
-def Presentation(**args):
- return Element(qname = (OFFICENS,'presentation'), **args)
-
-def Script(**args):
- return Element(qname = (OFFICENS, 'script'), **args)
-
-def Scripts(**args):
- return Element(qname = (OFFICENS, 'scripts'), **args)
-
-def Settings(**args):
- return Element(qname = (OFFICENS, 'settings'), **args)
-
-def Spreadsheet(**args):
- return Element(qname = (OFFICENS, 'spreadsheet'), **args)
-
-def Styles(**args):
- return Element(qname = (OFFICENS, 'styles'), **args)
-
-def Text(**args):
- return Element(qname = (OFFICENS, 'text'), **args)
-
-# Autogenerated end
diff --git a/libs/odf/opendocument.py b/libs/odf/opendocument.py
deleted file mode 100644
index e8736cf..0000000
--- a/libs/odf/opendocument.py
+++ /dev/null
@@ -1,1011 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2010 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-# Copyright (C) 2014 Georges Khaznadar
-# migration to Python3, JavaDOC comments and automatic
-# build of documentation
-#
-
-__doc__="""Use OpenDocument to generate your documents."""
-
-import zipfile, time, sys, mimetypes, copy, os.path
-
-# to allow Python3 to access modules in the same path
-sys.path.append(os.path.dirname(__file__))
-
-# using BytesIO provides a cleaner interface than StringIO
-# with both Python2 and Python3: the programmer must care to
-# convert strings or unicode to bytes, which is valid for Python 2 and 3.
-from io import StringIO, BytesIO
-
-from namespaces import *
-import manifest
-import meta
-from office import *
-import element
-from attrconverters import make_NCName
-from xml.sax.xmlreader import InputSource
-from odfmanifest import manifestlist
-
-if sys.version_info[0] == 3:
- unicode=str # unicode function does not exist
-
-__version__= TOOLSVERSION
-
-_XMLPROLOGUE = u"\n"
-
-#####
-# file permission as an integer value.
-# The following syntax would be invalid for Python3:
-# UNIXPERMS = 0100644 << 16L # -rw-r--r--
-#
-# So it has been precomputed:
-# 2175008768 is the same value as 0100644 << 16L == -rw-r--r--
-####
-UNIXPERMS = 2175008768
-
-IS_FILENAME = 0
-IS_IMAGE = 1
-# We need at least Python 2.2
-assert sys.version_info[0]>=2 and sys.version_info[1] >= 2
-
-#sys.setrecursionlimit(100)
-#The recursion limit is set conservative so mistakes like
-# s=content() s.addElement(s) won't eat up too much processor time.
-
-###############
-# mime-types => file extensions
-###############
-odmimetypes = {
- u'application/vnd.oasis.opendocument.text': u'.odt',
- u'application/vnd.oasis.opendocument.text-template': u'.ott',
- u'application/vnd.oasis.opendocument.graphics': u'.odg',
- u'application/vnd.oasis.opendocument.graphics-template': u'.otg',
- u'application/vnd.oasis.opendocument.presentation': u'.odp',
- u'application/vnd.oasis.opendocument.presentation-template': u'.otp',
- u'application/vnd.oasis.opendocument.spreadsheet': u'.ods',
- u'application/vnd.oasis.opendocument.spreadsheet-template': u'.ots',
- u'application/vnd.oasis.opendocument.chart': u'.odc',
- u'application/vnd.oasis.opendocument.chart-template': u'.otc',
- u'application/vnd.oasis.opendocument.image': u'.odi',
- u'application/vnd.oasis.opendocument.image-template': u'.oti',
- u'application/vnd.oasis.opendocument.formula': u'.odf',
- u'application/vnd.oasis.opendocument.formula-template': u'.otf',
- u'application/vnd.oasis.opendocument.text-master': u'.odm',
- u'application/vnd.oasis.opendocument.text-web': u'.oth',
-}
-
-class OpaqueObject:
- """
- just a record to bear a filename, a mediatype and a bytes content
- """
- def __init__(self, filename, mediatype, content=None):
- """
- the constructor
- @param filename a unicode string
- @param mediatype a unicode string
- @param content a byte string or None
- """
- assert(type(filename)==type(u""))
- assert(type(mediatype)==type(u""))
- assert(type(content)==type(b"") or content == None)
-
- self.mediatype = mediatype
- self.filename = filename
- self.content = content
-
-class OpenDocument:
- """
- A class to hold the content of an OpenDocument document
- Use the xml method to write the XML
- source to the screen or to a file.
- Example of use: d = OpenDocument(mimetype); fd.write(d.xml())
- """
- thumbnail = None
-
- def __init__(self, mimetype, add_generator=True):
- """
- the constructor
- @param mimetype a unicode string
- @param add_generator a boolean
- """
- assert(type(mimetype)==type(u""))
- assert(isinstance(add_generator,True.__class__))
-
- self.mimetype = mimetype
- self.childobjects = []
- self._extra = []
- self.folder = u"" # Always empty for toplevel documents
- self.topnode = Document(mimetype=self.mimetype)
- self.topnode.ownerDocument = self
-
- self.clear_caches()
-
- self.Pictures = {}
- self.meta = Meta()
- self.topnode.addElement(self.meta)
- if add_generator:
- self.meta.addElement(meta.Generator(text=TOOLSVERSION))
- self.scripts = Scripts()
- self.topnode.addElement(self.scripts)
- self.fontfacedecls = FontFaceDecls()
- self.topnode.addElement(self.fontfacedecls)
- self.settings = Settings()
- self.topnode.addElement(self.settings)
- self.styles = Styles()
- self.topnode.addElement(self.styles)
- self.automaticstyles = AutomaticStyles()
- self.topnode.addElement(self.automaticstyles)
- self.masterstyles = MasterStyles()
- self.topnode.addElement(self.masterstyles)
- self.body = Body()
- self.topnode.addElement(self.body)
-
- def rebuild_caches(self, node=None):
- if node is None: node = self.topnode
- self.build_caches(node)
- for e in node.childNodes:
- if e.nodeType == element.Node.ELEMENT_NODE:
- self.rebuild_caches(e)
-
- def clear_caches(self):
- """
- Clears internal caches
- """
- self.element_dict = {}
- self._styles_dict = {}
- self._styles_ooo_fix = {}
-
- def build_caches(self, elt):
- """
- Builds internal caches; called from element.py
- @param elt an element.Element instance
- """
- # assert(isinstance(elt, element.Element))
- # why do I need this more intricated assertion?
- # with Python3, the type of elt pops out as odf.element.Element
- # in one test ???
- import odf.element
- assert(isinstance(elt, element.Element) or isinstance(elt, odf.element.Element) )
-
- if elt.qname not in self.element_dict:
- self.element_dict[elt.qname] = []
- self.element_dict[elt.qname].append(elt)
- if elt.qname == (STYLENS, u'style'):
- self.__register_stylename(elt) # Add to style dictionary
- styleref = elt.getAttrNS(TEXTNS,u'style-name')
- if styleref is not None and styleref in self._styles_ooo_fix:
- elt.setAttrNS(TEXTNS,u'style-name', self._styles_ooo_fix[styleref])
-
- def __register_stylename(self, elt):
- '''
- Register a style. But there are three style dictionaries:
- office:styles, office:automatic-styles and office:master-styles
- Chapter 14.
- @param elt an element.Element instance
- '''
- assert(isinstance(elt, element.Element))
-
- name = elt.getAttrNS(STYLENS, u'name')
- if name is None:
- return
- if elt.parentNode.qname in ((OFFICENS,u'styles'), (OFFICENS,u'automatic-styles')):
- if name in self._styles_dict:
- newname = u'M'+name # Rename style
- self._styles_ooo_fix[name] = newname
- # From here on all references to the old name will refer to the new one
- name = newname
- elt.setAttrNS(STYLENS, u'name', name)
- self._styles_dict[name] = elt
-
- def toXml(self, filename=u''):
- """
- converts the document to a valid Xml format.
- @param filename unicode string: the name of a file, defaults to
- an empty string.
- @return if filename is not empty, the XML code will be written into it
- and the method returns None; otherwise the method returns a StringIO
- containing valid XML.
- Then a ".getvalue()" should return a unicode string.
- """
- assert(type(filename)==type(u""))
-
- result=None
- xml=StringIO()
- if sys.version_info[0]==2:
- xml.write(_XMLPROLOGUE)
- else:
- xml.write(_XMLPROLOGUE)
- self.body.toXml(0, xml)
- if not filename:
- result=xml.getvalue()
- else:
- f=codecs.open(filename,'w', encoding='utf-8')
- f.write(xml.getvalue())
- f.close()
- return result
-
- def xml(self):
- """
- Generates the full document as an XML "file"
- @return a bytestream in UTF-8 encoding
- """
- self.__replaceGenerator()
- xml=StringIO()
- if sys.version_info[0]==2:
- xml.write(_XMLPROLOGUE)
- else:
- xml.write(_XMLPROLOGUE)
- self.topnode.toXml(0, xml)
- return xml.getvalue().encode("utf-8")
-
-
- def contentxml(self):
- """
- Generates the content.xml file
- @return a bytestream in UTF-8 encoding
- """
- xml=StringIO()
- xml.write(_XMLPROLOGUE)
- x = DocumentContent()
- x.write_open_tag(0, xml)
- if self.scripts.hasChildNodes():
- self.scripts.toXml(1, xml)
- if self.fontfacedecls.hasChildNodes():
- self.fontfacedecls.toXml(1, xml)
- a = AutomaticStyles()
- stylelist = self._used_auto_styles([self.styles, self.automaticstyles, self.body])
- if len(stylelist) > 0:
- a.write_open_tag(1, xml)
- for s in stylelist:
- s.toXml(2, xml)
- a.write_close_tag(1, xml)
- else:
- a.toXml(1, xml)
- self.body.toXml(1, xml)
- x.write_close_tag(0, xml)
- return xml.getvalue().encode("utf-8")
-
- def __manifestxml(self):
- """
- Generates the manifest.xml file;
- The self.manifest isn't avaible unless the document is being saved
- @return a unicode string
- """
- xml=StringIO()
- xml.write(_XMLPROLOGUE)
- self.manifest.toXml(0,xml)
- result=xml.getvalue()
- assert(type(result)==type(u""))
- return result
-
- def metaxml(self):
- """
- Generates the meta.xml file
- @return a unicode string
- """
- self.__replaceGenerator()
- x = DocumentMeta()
- x.addElement(self.meta)
- xml=StringIO()
- xml.write(_XMLPROLOGUE)
- x.toXml(0,xml)
- result=xml.getvalue()
- assert(type(result)==type(u""))
- return result
-
- def settingsxml(self):
- """
- Generates the settings.xml file
- @return a unicode string
- """
- x = DocumentSettings()
- x.addElement(self.settings)
- xml=StringIO()
- if sys.version_info[0]==2:
- xml.write(_XMLPROLOGUE)
- else:
- xml.write(_XMLPROLOGUE)
- x.toXml(0,xml)
- result=xml.getvalue()
- assert(type(result)==type(u""))
- return result
-
- def _parseoneelement(self, top, stylenamelist):
- """
- Finds references to style objects in master-styles
- and add the style name to the style list if not already there.
- Recursive
- @return the list of style names as unicode strings
- """
- for e in top.childNodes:
- if e.nodeType == element.Node.ELEMENT_NODE:
- for styleref in (
- (CHARTNS,u'style-name'),
- (DRAWNS,u'style-name'),
- (DRAWNS,u'text-style-name'),
- (PRESENTATIONNS,u'style-name'),
- (STYLENS,u'data-style-name'),
- (STYLENS,u'list-style-name'),
- (STYLENS,u'page-layout-name'),
- (STYLENS,u'style-name'),
- (TABLENS,u'default-cell-style-name'),
- (TABLENS,u'style-name'),
- (TEXTNS,u'style-name') ):
- if e.getAttrNS(styleref[0],styleref[1]):
- stylename = e.getAttrNS(styleref[0],styleref[1])
- if stylename not in stylenamelist:
- # due to the polymorphism of e.getAttrNS(),
- # a unicode type is enforced for elements
- stylenamelist.append(unicode(stylename))
- stylenamelist = self._parseoneelement(e, stylenamelist)
- return stylenamelist
-
- def _used_auto_styles(self, segments):
- """
- Loop through the masterstyles elements, and find the automatic
- styles that are used. These will be added to the automatic-styles
- element in styles.xml
- @return a list of element.Element instances
- """
- stylenamelist = []
- for top in segments:
- stylenamelist = self._parseoneelement(top, stylenamelist)
- stylelist = []
- for e in self.automaticstyles.childNodes:
- if e.getAttrNS(STYLENS,u'name') in stylenamelist:
- stylelist.append(e)
-
- # check the type of the returned data
- ok=True
- for e in stylelist: ok = ok and isinstance(e, element.Element)
- assert(ok)
-
- return stylelist
-
- def stylesxml(self):
- """
- Generates the styles.xml file
- @return valid XML code as a unicode string
- """
- xml=StringIO()
- xml.write(_XMLPROLOGUE)
- x = DocumentStyles()
- x.write_open_tag(0, xml)
- if self.fontfacedecls.hasChildNodes():
- self.fontfacedecls.toXml(1, xml)
- self.styles.toXml(1, xml)
- a = AutomaticStyles()
- a.write_open_tag(1, xml)
- for s in self._used_auto_styles([self.masterstyles]):
- s.toXml(2, xml)
- a.write_close_tag(1, xml)
- if self.masterstyles.hasChildNodes():
- self.masterstyles.toXml(1, xml)
- x.write_close_tag(0, xml)
- result = xml.getvalue()
-
- assert(type(result)==type(u""))
-
- return result
-
- def addPicture(self, filename, mediatype=None, content=None):
- """
- Add a picture
- It uses the same convention as OOo, in that it saves the picture in
- the zipfile in the subdirectory 'Pictures'
- If passed a file ptr, mediatype must be set
- @param filename unicode string: name of a file for Pictures
- @param mediatype unicode string: name of a media, None by default
- @param content bytes: content of media, None by default
- @return a unicode string: the file name of the media, eventually
- created on the fly
- """
- if content is None:
- if mediatype is None:
- mediatype, encoding = mimetypes.guess_type(filename)
- if mediatype is None:
- mediatype = u''
- try: ext = filename[filename.rindex(u'.'):]
- except: ext=u''
- else:
- ext = mimetypes.guess_extension(mediatype)
- manifestfn = u"Pictures/%0.0f%s" % ((time.time()*10000000000), ext)
- self.Pictures[manifestfn] = (IS_FILENAME, filename, mediatype)
- content=b"" # this value is only use by the assert further
- filename=u"" # this value is only use by the assert further
- else:
- manifestfn = filename
- self.Pictures[manifestfn] = (IS_IMAGE, content, mediatype)
-
- assert(type(filename)==type(u""))
- assert(type(mediatype)==type(u""))
- assert(type(content) == type(b""))
-
- return manifestfn
-
- def addPictureFromFile(self, filename, mediatype=None):
- """
- Add a picture
- It uses the same convention as OOo, in that it saves the picture in
- the zipfile in the subdirectory 'Pictures'.
- If mediatype is not given, it will be guessed from the filename
- extension.
- @param filesname unicode string: name of an image file
- @param mediatype unicode string: type of media, dfaults to None
- @return a unicode string, the name of the created file
- """
- if mediatype is None:
- mediatype, encoding = mimetypes.guess_type(filename)
- if mediatype is None:
- mediatype = u''
- try: ext = filename[filename.rindex(u'.'):]
- except ValueError: ext=u''
- else:
- ext = mimetypes.guess_extension(mediatype)
- manifestfn = u"Pictures/%0.0f%s" % ((time.time()*10000000000), ext)
- self.Pictures[manifestfn] = (IS_FILENAME, filename, mediatype)
-
- assert(type(filename)==type(u""))
- assert(type(mediatype)==type(u""))
-
- return manifestfn
-
- def addPictureFromString(self, content, mediatype):
- """
- Add a picture from contents given as a Byte string.
- It uses the same convention as OOo, in that it saves the picture in
- the zipfile in the subdirectory 'Pictures'. The content variable
- is a string that contains the binary image data. The mediatype
- indicates the image format.
- @param content bytes: content of media
- @param mediatype unicode string: name of a media
- @return a unicode string, the name of the created file
- """
- assert(type(content)==type(b""))
- assert(type(mediatype)==type(u""))
-
- ext = mimetypes.guess_extension(mediatype)
- manifestfn = u"Pictures/%0.0f%s" % ((time.time()*10000000000), ext)
- self.Pictures[manifestfn] = (IS_IMAGE, content, mediatype)
- return manifestfn
-
- def addThumbnail(self, filecontent=None):
- """
- Add a fixed thumbnail
- The thumbnail in the library is big, so this is pretty useless.
- @param filecontent bytes: the content of a file; defaults to None
- """
- assert(type(filecontent)==type(b""))
-
- if filecontent is None:
- import thumbnail
- self.thumbnail = thumbnail.thumbnail()
- else:
- self.thumbnail = filecontent
-
- def addObject(self, document, objectname=None):
- """
- Adds an object (subdocument). The object must be an OpenDocument class
- @param document OpenDocument instance
- @param objectname unicode string: the name of an object to add
- @return a unicode string: the folder name in the zipfile the object is
- stored in.
- """
- assert(isinstance(document, OpenDocument))
- assert(type(objectname)==type(u"") or objectname == None)
-
- self.childobjects.append(document)
- if objectname is None:
- document.folder = u"%s/Object %d" % (self.folder, len(self.childobjects))
- else:
- document.folder = objectname
- return u".%s" % document.folder
-
- def _savePictures(self, anObject, folder):
- """
- saves pictures contained in an object
- @param anObject instance of OpenDocument containing pictures
- @param folder unicode string: place to save pictures
- """
- assert(isinstance(anObject, OpenDocument))
- assert(type(folder)==type(u""))
-
- hasPictures = False
- for arcname, picturerec in anObject.Pictures.items():
- what_it_is, fileobj, mediatype = picturerec
- self.manifest.addElement(manifest.FileEntry(fullpath=u"%s%s" % ( folder ,arcname), mediatype=mediatype))
- hasPictures = True
- if what_it_is == IS_FILENAME:
- self._z.write(fileobj, arcname, zipfile.ZIP_STORED)
- else:
- zi = zipfile.ZipInfo(str(arcname), self._now)
- zi.compress_type = zipfile.ZIP_STORED
- zi.external_attr = UNIXPERMS
- self._z.writestr(zi, fileobj)
- # According to section 17.7.3 in ODF 1.1, the pictures folder should not have a manifest entry
-# if hasPictures:
-# self.manifest.addElement(manifest.FileEntry(fullpath="%sPictures/" % folder, mediatype=""))
- # Look in subobjects
- subobjectnum = 1
- for subobject in anObject.childobjects:
- self._savePictures(subobject, u'%sObject %d/' % (folder, subobjectnum))
- subobjectnum += 1
-
- def __replaceGenerator(self):
- """
- Removes a previous 'generator' stance and declares TOOLSVERSION
- as the new generator.
- Section 3.1.1: The application MUST NOT export the original identifier
- belonging to the application that created the document.
- """
- for m in self.meta.childNodes[:]:
- if m.qname == (METANS, u'generator'):
- self.meta.removeChild(m)
- self.meta.addElement(meta.Generator(text=TOOLSVERSION))
-
- def save(self, outputfile, addsuffix=False):
- """
- Save the document under the filename.
- If the filename is '-' then save to stdout
- @param outputfile unicode string: the special name '-' is for stdout;
- as an alternative, it can be an io.ByteIO instance which contains
- the ZIP content.
- @param addsuffix boolean: whether to add a suffix or not; defaults to False
- """
- assert(type(outputfile)==type(u"") or 'wb' in repr(outputfile) or 'BufferedWriter' in repr(outputfile) or 'BytesIO' in repr(outputfile))
- assert(type(addsuffix)==type(True))
-
- if outputfile == u'-':
- outputfp = zipfile.ZipFile(sys.stdout,"w")
- else:
- if addsuffix:
- outputfile = outputfile + odmimetypes.get(self.mimetype,u'.xxx')
- outputfp = zipfile.ZipFile(outputfile, "w")
- self.__zipwrite(outputfp)
- outputfp.close()
-
- def write(self, outputfp):
- """
- User API to write the ODF file to an open file descriptor
- Writes the ZIP format
- @param outputfp open file descriptor
- """
- assert('wb' in repr(outputfp) or 'BufferedWriter' in repr(outputfp) or 'BytesIO' in repr(outputfp))
-
- zipoutputfp = zipfile.ZipFile(outputfp,"w")
- self.__zipwrite(zipoutputfp)
-
- def __zipwrite(self, outputfp):
- """
- Write the document to an open file pointer
- This is where the real work is done
- @param outputfp instance of zipfile.ZipFile
- """
- assert(isinstance(outputfp, zipfile.ZipFile))
-
- self._z = outputfp
- self._now = time.localtime()[:6]
- self.manifest = manifest.Manifest()
-
- # Write mimetype
- zi = zipfile.ZipInfo('mimetype', self._now)
- zi.compress_type = zipfile.ZIP_STORED
- zi.external_attr = UNIXPERMS
- self._z.writestr(zi, self.mimetype.encode("utf-8"))
-
- self._saveXmlObjects(self,u"")
-
- # Write pictures
- self._savePictures(self,u"")
-
- # Write the thumbnail
- if self.thumbnail is not None:
- self.manifest.addElement(manifest.FileEntry(fullpath=u"Thumbnails/", mediatype=u''))
- self.manifest.addElement(manifest.FileEntry(fullpath=u"Thumbnails/thumbnail.png", mediatype=u''))
- zi = zipfile.ZipInfo(u"Thumbnails/thumbnail.png", self._now)
- zi.compress_type = zipfile.ZIP_DEFLATED
- zi.external_attr = UNIXPERMS
- self._z.writestr(zi, self.thumbnail)
-
- # Write any extra files
- for op in self._extra:
- if op.filename == u"META-INF/documentsignatures.xml": continue # Don't save signatures
- self.manifest.addElement(manifest.FileEntry(fullpath=op.filename, mediatype=op.mediatype))
- if sys.version_info[0]==3:
- zi = zipfile.ZipInfo(op.filename, self._now)
- else:
- zi = zipfile.ZipInfo(op.filename.encode('utf-8'), self._now)
- zi.compress_type = zipfile.ZIP_DEFLATED
- zi.external_attr = UNIXPERMS
- if op.content is not None:
- self._z.writestr(zi, op.content)
- # Write manifest
- zi = zipfile.ZipInfo(u"META-INF/manifest.xml", self._now)
- zi.compress_type = zipfile.ZIP_DEFLATED
- zi.external_attr = UNIXPERMS
- self._z.writestr(zi, self.__manifestxml() )
- del self._z
- del self._now
- del self.manifest
-
-
- def _saveXmlObjects(self, anObject, folder):
- """
- save xml objects of an opendocument to some folder
- @param anObject instance of OpenDocument
- @param folder unicode string place to save xml objects
- """
- assert(isinstance(anObject, OpenDocument))
- assert(type(folder)==type(u""))
-
- if self == anObject:
- self.manifest.addElement(manifest.FileEntry(fullpath=u"/", mediatype=anObject.mimetype))
- else:
- self.manifest.addElement(manifest.FileEntry(fullpath=folder, mediatype=anObject.mimetype))
- # Write styles
- self.manifest.addElement(manifest.FileEntry(fullpath=u"%sstyles.xml" % folder, mediatype=u"text/xml"))
- zi = zipfile.ZipInfo(u"%sstyles.xml" % folder, self._now)
- zi.compress_type = zipfile.ZIP_DEFLATED
- zi.external_attr = UNIXPERMS
- self._z.writestr(zi, anObject.stylesxml().encode("utf-8") )
-
- # Write content
- self.manifest.addElement(manifest.FileEntry(fullpath=u"%scontent.xml" % folder, mediatype=u"text/xml"))
- zi = zipfile.ZipInfo(u"%scontent.xml" % folder, self._now)
- zi.compress_type = zipfile.ZIP_DEFLATED
- zi.external_attr = UNIXPERMS
- self._z.writestr(zi, anObject.contentxml() )
-
- # Write settings
- if anObject.settings.hasChildNodes():
- self.manifest.addElement(manifest.FileEntry(fullpath=u"%ssettings.xml" % folder, mediatype=u"text/xml"))
- zi = zipfile.ZipInfo(u"%ssettings.xml" % folder, self._now)
- zi.compress_type = zipfile.ZIP_DEFLATED
- zi.external_attr = UNIXPERMS
- self._z.writestr(zi, anObject.settingsxml() )
-
- # Write meta
- if self == anObject:
- self.manifest.addElement(manifest.FileEntry(fullpath=u"meta.xml", mediatype=u"text/xml"))
- zi = zipfile.ZipInfo(u"meta.xml", self._now)
- zi.compress_type = zipfile.ZIP_DEFLATED
- zi.external_attr = UNIXPERMS
- self._z.writestr(zi, anObject.metaxml() )
-
- # Write subobjects
- subobjectnum = 1
- for subobject in anObject.childobjects:
- self._saveXmlObjects(subobject, u'%sObject %d/' % (folder, subobjectnum))
- subobjectnum += 1
-
-# Document's DOM methods
- def createElement(self, elt):
- """
- Inconvenient interface to create an element, but follows XML-DOM.
- Does not allow attributes as argument, therefore can't check grammar.
- @param elt element.Element instance
- @return an element.Element instance whose grammar is not checked
- """
- assert(isinstance(elt, element.Element))
-
- # this old code is ambiguous: is 'element' the module or is it the
- # local variable? To disambiguate this, the local variable has been
- # renamed to 'elt'
- #return element(check_grammar=False)
- return elt(check_grammar=False)
-
- def createTextNode(self, data):
- """
- Method to create a text node
- @param data unicode string to include in the Text element
- @return an instance of element.Text
- """
- assert(type(data)==type(u""))
-
- return element.Text(data)
-
- def createCDATASection(self, data):
- """
- Method to create a CDATA section
- @param data unicode string to include in the CDATA element
- @return an instance of element.CDATASection
- """
- assert(type(data)==type(u""))
-
- return element.CDATASection(cdata)
-
- def getMediaType(self):
- """
- Returns the media type
- @result a unicode string
- """
- assert (type(self.mimetype)==type(u""))
-
- return self.mimetype
-
- def getStyleByName(self, name):
- """
- Finds a style object based on the name
- @param name unicode string the name of style to search
- @return a syle as an element.Element instance
- """
- assert(type(name)==type(u""))
-
- ncname = make_NCName(name)
- if self._styles_dict == {}:
- self.rebuild_caches()
- result=self._styles_dict.get(ncname, None)
-
- assert(isinstance(result, element.Element))
- return result
-
- def getElementsByType(self, elt):
- """
- Gets elements based on the type, which is function from
- text.py, draw.py etc.
- @param elt instance of a function which returns an element.Element
- @return a list of istances of element.Element
- """
- import types
- assert(isinstance (elt, types.FunctionType))
-
- obj = elt(check_grammar=False)
- assert (isinstance(obj, element.Element))
-
- if self.element_dict == {}:
- self.rebuild_caches()
-
- # This previous code was ambiguous
- # was "element" the module name or the local variable?
- # the local variable is renamed to "elt" to disambiguate the code
- #return self.element_dict.get(obj.qname, [])
-
- result=self.element_dict.get(obj.qname, [])
-
- ok=True
- for e in result: ok = ok and isinstance(e, element.Element)
- assert(ok)
-
- return result
-
-# Convenience functions
-def OpenDocumentChart():
- """
- Creates a chart document
- @return an OpenDocument instance with chart mimetype
- """
- doc = OpenDocument(u'application/vnd.oasis.opendocument.chart')
- doc.chart = Chart()
- doc.body.addElement(doc.chart)
- return doc
-
-def OpenDocumentDrawing():
- """
- Creates a drawing document
- @return an OpenDocument instance with drawing mimetype
- """
- doc = OpenDocument(u'application/vnd.oasis.opendocument.graphics')
- doc.drawing = Drawing()
- doc.body.addElement(doc.drawing)
- return doc
-
-def OpenDocumentImage():
- """
- Creates an image document
- @return an OpenDocument instance with image mimetype
- """
- doc = OpenDocument(u'application/vnd.oasis.opendocument.image')
- doc.image = Image()
- doc.body.addElement(doc.image)
- return doc
-
-def OpenDocumentPresentation():
- """
- Creates a presentation document
- @return an OpenDocument instance with presentation mimetype
- """
- doc = OpenDocument(u'application/vnd.oasis.opendocument.presentation')
- doc.presentation = Presentation()
- doc.body.addElement(doc.presentation)
- return doc
-
-def OpenDocumentSpreadsheet():
- """
- Creates a spreadsheet document
- @return an OpenDocument instance with spreadsheet mimetype
- """
- doc = OpenDocument(u'application/vnd.oasis.opendocument.spreadsheet')
- doc.spreadsheet = Spreadsheet()
- doc.body.addElement(doc.spreadsheet)
- return doc
-
-def OpenDocumentText():
- """
- Creates a text document
- @return an OpenDocument instance with text mimetype
- """
- doc = OpenDocument(u'application/vnd.oasis.opendocument.text')
- doc.text = Text()
- doc.body.addElement(doc.text)
- return doc
-
-def OpenDocumentTextMaster():
- """
- Creates a text master document
- @return an OpenDocument instance with master mimetype
- """
- doc = OpenDocument(u'application/vnd.oasis.opendocument.text-master')
- doc.text = Text()
- doc.body.addElement(doc.text)
- return doc
-
-def __loadxmlparts(z, manifest, doc, objectpath):
- """
- Parses a document from its zipfile
- @param z an instance of zipfile.ZipFile
- @param manifest Manifest data structured in a dictionary
- @param doc instance of OpenDocument to feed in
- @param objectpath unicode string: path to an object
- """
- assert(isinstance(z, zipfile.ZipFile))
- assert(type(manifest)==type(dict()))
- assert(isinstance(doc, OpenDocument))
- assert(type(objectpath)==type(u""))
-
- from load import LoadParser
- from xml.sax import make_parser, handler
-
- for xmlfile in (objectpath+u'settings.xml', objectpath+u'meta.xml', objectpath+u'content.xml', objectpath+u'styles.xml'):
- if xmlfile not in manifest:
- continue
- ##########################################################
- # this one is added to debug the bad behavior with Python2
- # which raises exceptions of type SAXParseException
- from xml.sax._exceptions import SAXParseException
- ##########################################################
- try:
- xmlpart = z.read(xmlfile).decode("utf-8")
- doc._parsing = xmlfile
-
- parser = make_parser()
- parser.setFeature(handler.feature_namespaces, 1)
- parser.setContentHandler(LoadParser(doc))
- parser.setErrorHandler(handler.ErrorHandler())
-
- inpsrc = InputSource()
- #################
- # There may be a SAXParseException triggered because of
- # a missing xmlns prefix like meta, config, etc.
- # So i add such declarations when needed (GK, 2014/10/21).
- # Is there any option to prevent xmlns checks by SAX?
- xmlpart=__fixXmlPart(xmlpart)
-
- inpsrc.setByteStream(BytesIO(xmlpart.encode("utf-8")))
- parser.parse(inpsrc)
- del doc._parsing
- except KeyError as v: pass
- except SAXParseException:
- print (u"====== SAX FAILED TO PARSE ==========\n", xmlpart)
-
-def __fixXmlPart(xmlpart):
- """
- fixes an xml code when it does not contain a set of requested
- "xmlns:whatever" declarations.
- added by G.K. on 2014/10/21
- @param xmlpart unicode string: some XML code
- @return fixed XML code
- """
- result=xmlpart
- requestedPrefixes = (u'meta', u'config', u'dc', u'style',
- u'svg', u'fo',u'draw', u'table',u'form')
- for prefix in requestedPrefixes:
- if u' xmlns:{prefix}'.format(prefix=prefix) not in xmlpart:
- pos=result.index(u" xmlns:")
- toInsert=u' xmlns:{prefix}="urn:oasis:names:tc:opendocument:xmlns:{prefix}:1.0"'.format(prefix=prefix)
- result=result[:pos]+toInsert+result[pos:]
- return result
-
-
-def __detectmimetype(zipfd, odffile):
- """
- detects the mime-type of an ODF file
- @param zipfd an open zipfile.ZipFile instance
- @param odffile this parameter is not used
- @return a mime-type as a unicode string
- """
- assert(isinstance(zipfd, zipfile.ZipFile))
- assert(type(odffile)==type(u"") or 'rb' in repr(odffile) \
- or 'BufferedReader' in repr(odffile) or 'BytesIO' in repr(odffile))
-
- try:
- mimetype = zipfd.read('mimetype').decode("utf-8")
- return mimetype
- except:
- pass
- # Fall-through to next mechanism
- manifestpart = zipfd.read('META-INF/manifest.xml')
- manifest = manifestlist(manifestpart)
- for mentry,mvalue in manifest.items():
- if mentry == "/":
- assert(type(mvalue['media-type'])==type(u""))
- return mvalue['media-type']
-
- # Fall-through to last mechanism
- return u'application/vnd.oasis.opendocument.text'
-
-def load(odffile):
- """
- Load an ODF file into memory
- @param odffile unicode string: name of a file, or as an alternative,
- an open readable stream
- @return a reference to the structure (an OpenDocument instance)
- """
- assert(type(odffile)==type(u"") or 'rb' in repr(odffile) \
- or 'BufferedReader' in repr(odffile) or 'BytesIO' in repr(odffile))
-
- z = zipfile.ZipFile(odffile)
- mimetype = __detectmimetype(z, odffile)
- doc = OpenDocument(mimetype, add_generator=False)
-
- # Look in the manifest file to see if which of the four files there are
- manifestpart = z.read('META-INF/manifest.xml')
- manifest = manifestlist(manifestpart)
- __loadxmlparts(z, manifest, doc, u'')
- for mentry,mvalue in manifest.items():
- if mentry[:9] == u"Pictures/" and len(mentry) > 9:
- doc.addPicture(mvalue['full-path'], mvalue['media-type'], z.read(mentry))
- elif mentry == u"Thumbnails/thumbnail.png":
- doc.addThumbnail(z.read(mentry))
- elif mentry in (u'settings.xml', u'meta.xml', u'content.xml', u'styles.xml'):
- pass
- # Load subobjects into structure
- elif mentry[:7] == u"Object " and len(mentry) < 11 and mentry[-1] == u"/":
- subdoc = OpenDocument(mvalue['media-type'], add_generator=False)
- doc.addObject(subdoc, u"/" + mentry[:-1])
- __loadxmlparts(z, manifest, subdoc, mentry)
- elif mentry[:7] == u"Object ":
- pass # Don't load subobjects as opaque objects
- else:
- if mvalue['full-path'][-1] == u'/':
- doc._extra.append(OpaqueObject(mvalue['full-path'], mvalue['media-type'], None))
- else:
- doc._extra.append(OpaqueObject(mvalue['full-path'], mvalue['media-type'], z.read(mentry)))
- # Add the SUN junk here to the struct somewhere
- # It is cached data, so it can be out-of-date
- z.close()
- b = doc.getElementsByType(Body)
- if mimetype[:39] == u'application/vnd.oasis.opendocument.text':
- doc.text = b[0].firstChild
- elif mimetype[:43] == u'application/vnd.oasis.opendocument.graphics':
- doc.graphics = b[0].firstChild
- elif mimetype[:47] == u'application/vnd.oasis.opendocument.presentation':
- doc.presentation = b[0].firstChild
- elif mimetype[:46] == u'application/vnd.oasis.opendocument.spreadsheet':
- doc.spreadsheet = b[0].firstChild
- elif mimetype[:40] == u'application/vnd.oasis.opendocument.chart':
- doc.chart = b[0].firstChild
- elif mimetype[:40] == u'application/vnd.oasis.opendocument.image':
- doc.image = b[0].firstChild
- elif mimetype[:42] == u'application/vnd.oasis.opendocument.formula':
- doc.formula = b[0].firstChild
-
- return doc
-
-# vim: set expandtab sw=4 :
diff --git a/libs/odf/presentation.py b/libs/odf/presentation.py
deleted file mode 100644
index 04e2b76..0000000
--- a/libs/odf/presentation.py
+++ /dev/null
@@ -1,86 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import PRESENTATIONNS
-from element import Element
-
-# ODF 1.0 section 9.6 and 9.7
-# Autogenerated
-def AnimationGroup(**args):
- return Element(qname = (PRESENTATIONNS,'animation-group'), **args)
-
-def Animations(**args):
- return Element(qname = (PRESENTATIONNS,'animations'), **args)
-
-def DateTime(**args):
- return Element(qname = (PRESENTATIONNS,'date-time'), **args)
-
-def DateTimeDecl(**args):
- return Element(qname = (PRESENTATIONNS,'date-time-decl'), **args)
-
-def Dim(**args):
- return Element(qname = (PRESENTATIONNS,'dim'), **args)
-
-def EventListener(**args):
- return Element(qname = (PRESENTATIONNS,'event-listener'), **args)
-
-def Footer(**args):
- return Element(qname = (PRESENTATIONNS,'footer'), **args)
-
-def FooterDecl(**args):
- return Element(qname = (PRESENTATIONNS,'footer-decl'), **args)
-
-def Header(**args):
- return Element(qname = (PRESENTATIONNS,'header'), **args)
-
-def HeaderDecl(**args):
- return Element(qname = (PRESENTATIONNS,'header-decl'), **args)
-
-def HideShape(**args):
- return Element(qname = (PRESENTATIONNS,'hide-shape'), **args)
-
-def HideText(**args):
- return Element(qname = (PRESENTATIONNS,'hide-text'), **args)
-
-def Notes(**args):
- return Element(qname = (PRESENTATIONNS,'notes'), **args)
-
-def Placeholder(**args):
- return Element(qname = (PRESENTATIONNS,'placeholder'), **args)
-
-def Play(**args):
- return Element(qname = (PRESENTATIONNS,'play'), **args)
-
-def Settings(**args):
- return Element(qname = (PRESENTATIONNS,'settings'), **args)
-
-def Show(**args):
- return Element(qname = (PRESENTATIONNS,'show'), **args)
-
-def ShowShape(**args):
- return Element(qname = (PRESENTATIONNS,'show-shape'), **args)
-
-def ShowText(**args):
- return Element(qname = (PRESENTATIONNS,'show-text'), **args)
-
-def Sound(**args):
- args.setdefault('type', 'simple')
- return Element(qname = (PRESENTATIONNS,'sound'), **args)
-
diff --git a/libs/odf/script.py b/libs/odf/script.py
deleted file mode 100644
index adbc73f..0000000
--- a/libs/odf/script.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import SCRIPTNS
-from element import Element
-
-# ODF 1.0 section 12.4.1
-# The element binds an event to a macro.
-
-# Autogenerated
-def EventListener(**args):
- return Element(qname = (SCRIPTNS,'event-listener'), **args)
-
diff --git a/libs/odf/style.py b/libs/odf/style.py
deleted file mode 100644
index b9f00f9..0000000
--- a/libs/odf/style.py
+++ /dev/null
@@ -1,154 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2013 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import STYLENS
-from element import Element
-
-def StyleElement(**args):
- e = Element(**args)
- if args.get('check_grammar', True) == True:
- if 'displayname' not in args:
- e.setAttrNS(STYLENS,'display-name', args.get('name'))
- return e
-
-# Autogenerated
-def BackgroundImage(**args):
- return Element(qname = (STYLENS,'background-image'), **args)
-
-def ChartProperties(**args):
- return Element(qname = (STYLENS,'chart-properties'), **args)
-
-def Column(**args):
- return Element(qname = (STYLENS,'column'), **args)
-
-def ColumnSep(**args):
- return Element(qname = (STYLENS,'column-sep'), **args)
-
-def Columns(**args):
- return Element(qname = (STYLENS,'columns'), **args)
-
-def DefaultPageLayout(**args):
- return Element(qname = (STYLENS,'default-page-layout'), **args)
-
-def DefaultStyle(**args):
- return Element(qname = (STYLENS,'default-style'), **args)
-
-def DrawingPageProperties(**args):
- return Element(qname = (STYLENS,'drawing-page-properties'), **args)
-
-def DropCap(**args):
- return Element(qname = (STYLENS,'drop-cap'), **args)
-
-def FontFace(**args):
- return Element(qname = (STYLENS,'font-face'), **args)
-
-def Footer(**args):
- return Element(qname = (STYLENS,'footer'), **args)
-
-def FooterLeft(**args):
- return Element(qname = (STYLENS,'footer-left'), **args)
-
-def FooterStyle(**args):
- return Element(qname = (STYLENS,'footer-style'), **args)
-
-def FootnoteSep(**args):
- return Element(qname = (STYLENS,'footnote-sep'), **args)
-
-def GraphicProperties(**args):
- return Element(qname = (STYLENS,'graphic-properties'), **args)
-
-def HandoutMaster(**args):
- return Element(qname = (STYLENS,'handout-master'), **args)
-
-def Header(**args):
- return Element(qname = (STYLENS,'header'), **args)
-
-def HeaderFooterProperties(**args):
- return Element(qname = (STYLENS,'header-footer-properties'), **args)
-
-def HeaderLeft(**args):
- return Element(qname = (STYLENS,'header-left'), **args)
-
-def HeaderStyle(**args):
- return Element(qname = (STYLENS,'header-style'), **args)
-
-def ListLevelLabelAlignment(**args):
- return Element(qname = (STYLENS,'list-level-label-alignment'), **args)
-
-def ListLevelProperties(**args):
- return Element(qname = (STYLENS,'list-level-properties'), **args)
-
-def Map(**args):
- return Element(qname = (STYLENS,'map'), **args)
-
-def MasterPage(**args):
- return StyleElement(qname = (STYLENS,'master-page'), **args)
-
-def PageLayout(**args):
- return Element(qname = (STYLENS,'page-layout'), **args)
-
-def PageLayoutProperties(**args):
- return Element(qname = (STYLENS,'page-layout-properties'), **args)
-
-def ParagraphProperties(**args):
- return Element(qname = (STYLENS,'paragraph-properties'), **args)
-
-def PresentationPageLayout(**args):
- return StyleElement(qname = (STYLENS,'presentation-page-layout'), **args)
-
-def RegionCenter(**args):
- return Element(qname = (STYLENS,'region-center'), **args)
-
-def RegionLeft(**args):
- return Element(qname = (STYLENS,'region-left'), **args)
-
-def RegionRight(**args):
- return Element(qname = (STYLENS,'region-right'), **args)
-
-def RubyProperties(**args):
- return Element(qname = (STYLENS,'ruby-properties'), **args)
-
-def SectionProperties(**args):
- return Element(qname = (STYLENS,'section-properties'), **args)
-
-def Style(**args):
- return StyleElement(qname = (STYLENS,'style'), **args)
-
-def TabStop(**args):
- return Element(qname = (STYLENS,'tab-stop'), **args)
-
-def TabStops(**args):
- return Element(qname = (STYLENS,'tab-stops'), **args)
-
-def TableCellProperties(**args):
- return Element(qname = (STYLENS,'table-cell-properties'), **args)
-
-def TableColumnProperties(**args):
- return Element(qname = (STYLENS,'table-column-properties'), **args)
-
-def TableProperties(**args):
- return Element(qname = (STYLENS,'table-properties'), **args)
-
-def TableRowProperties(**args):
- return Element(qname = (STYLENS,'table-row-properties'), **args)
-
-def TextProperties(**args):
- return Element(qname = (STYLENS,'text-properties'), **args)
-
diff --git a/libs/odf/svg.py b/libs/odf/svg.py
deleted file mode 100644
index 79629b9..0000000
--- a/libs/odf/svg.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import SVGNS
-from element import Element
-from draw import DrawElement
-
-# Autogenerated
-def DefinitionSrc(**args):
- args.setdefault('type', 'simple')
- return Element(qname = (SVGNS,'definition-src'), **args)
-
-def Desc(**args):
- return Element(qname = (SVGNS,'desc'), **args)
-
-def FontFaceFormat(**args):
- return Element(qname = (SVGNS,'font-face-format'), **args)
-
-def FontFaceName(**args):
- return Element(qname = (SVGNS,'font-face-name'), **args)
-
-def FontFaceSrc(**args):
- return Element(qname = (SVGNS,'font-face-src'), **args)
-
-def FontFaceUri(**args):
- args.setdefault('type', 'simple')
- return Element(qname = (SVGNS,'font-face-uri'), **args)
-
-def Lineargradient(**args):
- return DrawElement(qname = (SVGNS,'linearGradient'), **args)
-
-def Radialgradient(**args):
- return DrawElement(qname = (SVGNS,'radialGradient'), **args)
-
-def Stop(**args):
- return Element(qname = (SVGNS,'stop'), **args)
-
-def Title(**args):
- return Element(qname = (SVGNS,'title'), **args)
diff --git a/libs/odf/table.py b/libs/odf/table.py
deleted file mode 100644
index 904f2a7..0000000
--- a/libs/odf/table.py
+++ /dev/null
@@ -1,321 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2013 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import TABLENS
-from element import Element
-
-
-# Autogenerated
-def Background(**args):
- return Element(qname = (TABLENS,'background'), **args)
-
-def Body(**args):
- return Element(qname = (TABLENS,'body'), **args)
-
-def CalculationSettings(**args):
- return Element(qname = (TABLENS,'calculation-settings'), **args)
-
-def CellAddress(**args):
- return Element(qname = (TABLENS,'cell-address'), **args)
-
-def CellContentChange(**args):
- return Element(qname = (TABLENS,'cell-content-change'), **args)
-
-def CellContentDeletion(**args):
- return Element(qname = (TABLENS,'cell-content-deletion'), **args)
-
-def CellRangeSource(**args):
- args.setdefault('type', 'simple')
- return Element(qname = (TABLENS,'cell-range-source'), **args)
-
-def ChangeDeletion(**args):
- return Element(qname = (TABLENS,'change-deletion'), **args)
-
-def ChangeTrackTableCell(**args):
- return Element(qname = (TABLENS,'change-track-table-cell'), **args)
-
-def Consolidation(**args):
- return Element(qname = (TABLENS,'consolidation'), **args)
-
-def ContentValidation(**args):
- return Element(qname = (TABLENS,'content-validation'), **args)
-
-def ContentValidations(**args):
- return Element(qname = (TABLENS,'content-validations'), **args)
-
-def CoveredTableCell(**args):
- return Element(qname = (TABLENS,'covered-table-cell'), **args)
-
-def CutOffs(**args):
- return Element(qname = (TABLENS,'cut-offs'), **args)
-
-def DataPilotDisplayInfo(**args):
- return Element(qname = (TABLENS,'data-pilot-display-info'), **args)
-
-def DataPilotField(**args):
- return Element(qname = (TABLENS,'data-pilot-field'), **args)
-
-def DataPilotFieldReference(**args):
- return Element(qname = (TABLENS,'data-pilot-field-reference'), **args)
-
-def DataPilotGroup(**args):
- return Element(qname = (TABLENS,'data-pilot-group'), **args)
-
-def DataPilotGroupMember(**args):
- return Element(qname = (TABLENS,'data-pilot-group-member'), **args)
-
-def DataPilotGroups(**args):
- return Element(qname = (TABLENS,'data-pilot-groups'), **args)
-
-def DataPilotLayoutInfo(**args):
- return Element(qname = (TABLENS,'data-pilot-layout-info'), **args)
-
-def DataPilotLevel(**args):
- return Element(qname = (TABLENS,'data-pilot-level'), **args)
-
-def DataPilotMember(**args):
- return Element(qname = (TABLENS,'data-pilot-member'), **args)
-
-def DataPilotMembers(**args):
- return Element(qname = (TABLENS,'data-pilot-members'), **args)
-
-def DataPilotSortInfo(**args):
- return Element(qname = (TABLENS,'data-pilot-sort-info'), **args)
-
-def DataPilotSubtotal(**args):
- return Element(qname = (TABLENS,'data-pilot-subtotal'), **args)
-
-def DataPilotSubtotals(**args):
- return Element(qname = (TABLENS,'data-pilot-subtotals'), **args)
-
-def DataPilotTable(**args):
- return Element(qname = (TABLENS,'data-pilot-table'), **args)
-
-def DataPilotTables(**args):
- return Element(qname = (TABLENS,'data-pilot-tables'), **args)
-
-def DatabaseRange(**args):
- return Element(qname = (TABLENS,'database-range'), **args)
-
-def DatabaseRanges(**args):
- return Element(qname = (TABLENS,'database-ranges'), **args)
-
-def DatabaseSourceQuery(**args):
- return Element(qname = (TABLENS,'database-source-query'), **args)
-
-def DatabaseSourceSql(**args):
- return Element(qname = (TABLENS,'database-source-sql'), **args)
-
-def DatabaseSourceTable(**args):
- return Element(qname = (TABLENS,'database-source-table'), **args)
-
-def DdeLink(**args):
- return Element(qname = (TABLENS,'dde-link'), **args)
-
-def DdeLinks(**args):
- return Element(qname = (TABLENS,'dde-links'), **args)
-
-def Deletion(**args):
- return Element(qname = (TABLENS,'deletion'), **args)
-
-def Deletions(**args):
- return Element(qname = (TABLENS,'deletions'), **args)
-
-def Dependencies(**args):
- return Element(qname = (TABLENS,'dependencies'), **args)
-
-def Dependency(**args):
- return Element(qname = (TABLENS,'dependency'), **args)
-
-def Desc(**args):
- return Element(qname = (TABLENS,'desc'), **args)
-
-def Detective(**args):
- return Element(qname = (TABLENS,'detective'), **args)
-
-def ErrorMacro(**args):
- return Element(qname = (TABLENS,'error-macro'), **args)
-
-def ErrorMessage(**args):
- return Element(qname = (TABLENS,'error-message'), **args)
-
-def EvenColumns(**args):
- return Element(qname = (TABLENS,'even-columns'), **args)
-
-def EvenRows(**args):
- return Element(qname = (TABLENS,'even-rows'), **args)
-
-def Filter(**args):
- return Element(qname = (TABLENS,'filter'), **args)
-
-def FilterAnd(**args):
- return Element(qname = (TABLENS,'filter-and'), **args)
-
-def FilterCondition(**args):
- return Element(qname = (TABLENS,'filter-condition'), **args)
-
-def FilterOr(**args):
- return Element(qname = (TABLENS,'filter-or'), **args)
-
-def FilterSetItem(**args):
- return Element(qname = (TABLENS,'filter-set-item'), **args)
-
-def FirstColumn(**args):
- return Element(qname = (TABLENS,'first-column'), **args)
-
-def FirstRow(**args):
- return Element(qname = (TABLENS,'first-row'), **args)
-
-def HelpMessage(**args):
- return Element(qname = (TABLENS,'help-message'), **args)
-
-def HighlightedRange(**args):
- return Element(qname = (TABLENS,'highlighted-range'), **args)
-
-def Insertion(**args):
- return Element(qname = (TABLENS,'insertion'), **args)
-
-def InsertionCutOff(**args):
- return Element(qname = (TABLENS,'insertion-cut-off'), **args)
-
-def Iteration(**args):
- return Element(qname = (TABLENS,'iteration'), **args)
-
-def LabelRange(**args):
- return Element(qname = (TABLENS,'label-range'), **args)
-
-def LabelRanges(**args):
- return Element(qname = (TABLENS,'label-ranges'), **args)
-
-def LastColumn(**args):
- return Element(qname = (TABLENS,'last-column'), **args)
-
-def LastRow(**args):
- return Element(qname = (TABLENS,'last-row'), **args)
-
-def Movement(**args):
- return Element(qname = (TABLENS,'movement'), **args)
-
-def MovementCutOff(**args):
- return Element(qname = (TABLENS,'movement-cut-off'), **args)
-
-def NamedExpression(**args):
- return Element(qname = (TABLENS,'named-expression'), **args)
-
-def NamedExpressions(**args):
- return Element(qname = (TABLENS,'named-expressions'), **args)
-
-def NamedRange(**args):
- return Element(qname = (TABLENS,'named-range'), **args)
-
-def NullDate(**args):
- return Element(qname = (TABLENS,'null-date'), **args)
-
-def OddColumns(**args):
- return Element(qname = (TABLENS,'odd-columns'), **args)
-
-def OddRows(**args):
- return Element(qname = (TABLENS,'odd-rows'), **args)
-
-def Operation(**args):
- return Element(qname = (TABLENS,'operation'), **args)
-
-def Previous(**args):
- return Element(qname = (TABLENS,'previous'), **args)
-
-def Scenario(**args):
- return Element(qname = (TABLENS,'scenario'), **args)
-
-def Shapes(**args):
- return Element(qname = (TABLENS,'shapes'), **args)
-
-def Sort(**args):
- return Element(qname = (TABLENS,'sort'), **args)
-
-def SortBy(**args):
- return Element(qname = (TABLENS,'sort-by'), **args)
-
-def SortGroups(**args):
- return Element(qname = (TABLENS,'sort-groups'), **args)
-
-def SourceCellRange(**args):
- return Element(qname = (TABLENS,'source-cell-range'), **args)
-
-def SourceRangeAddress(**args):
- return Element(qname = (TABLENS,'source-range-address'), **args)
-
-def SourceService(**args):
- return Element(qname = (TABLENS,'source-service'), **args)
-
-def SubtotalField(**args):
- return Element(qname = (TABLENS,'subtotal-field'), **args)
-
-def SubtotalRule(**args):
- return Element(qname = (TABLENS,'subtotal-rule'), **args)
-
-def SubtotalRules(**args):
- return Element(qname = (TABLENS,'subtotal-rules'), **args)
-
-def Table(**args):
- return Element(qname = (TABLENS,'table'), **args)
-
-def TableCell(**args):
- return Element(qname = (TABLENS,'table-cell'), **args)
-
-def TableColumn(**args):
- return Element(qname = (TABLENS,'table-column'), **args)
-
-def TableColumnGroup(**args):
- return Element(qname = (TABLENS,'table-column-group'), **args)
-
-def TableColumns(**args):
- return Element(qname = (TABLENS,'table-columns'), **args)
-
-def TableHeaderColumns(**args):
- return Element(qname = (TABLENS,'table-header-columns'), **args)
-
-def TableHeaderRows(**args):
- return Element(qname = (TABLENS,'table-header-rows'), **args)
-
-def TableRow(**args):
- return Element(qname = (TABLENS,'table-row'), **args)
-
-def TableRowGroup(**args):
- return Element(qname = (TABLENS,'table-row-group'), **args)
-
-def TableRows(**args):
- return Element(qname = (TABLENS,'table-rows'), **args)
-
-def TableSource(**args):
- args.setdefault('type', 'simple')
- return Element(qname = (TABLENS,'table-source'), **args)
-
-def TableTemplate(**args):
- return Element(qname = (TABLENS,'table-template'), **args)
-
-def TargetRangeAddress(**args):
- return Element(qname = (TABLENS,'target-range-address'), **args)
-
-def Title(**args):
- return Element(qname = (TABLENS,'title'), **args)
-
-def TrackedChanges(**args):
- return Element(qname = (TABLENS,'tracked-changes'), **args)
-
diff --git a/libs/odf/teletype.py b/libs/odf/teletype.py
deleted file mode 100644
index 53b58fd..0000000
--- a/libs/odf/teletype.py
+++ /dev/null
@@ -1,137 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Create and extract text from ODF, handling whitespace correctly.
-# Copyright (C) 2008 J. David Eisenberg
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
-"""
-Class for handling whitespace properly in OpenDocument.
-
-While it is possible to use getTextContent() and setTextContent()
-to extract or create ODF content, these won't extract or create
-the appropriate , , or
-elements. This module takes care of that problem.
-"""
-
-from odf.element import Node
-import odf.opendocument
-from odf.text import S,LineBreak,Tab
-
-class WhitespaceText(object):
-
- def __init__(self):
- self.textBuffer = []
- self.spaceCount = 0
-
- def addTextToElement(self, odfElement, s):
- """ Process an input string, inserting
- elements for '\t',
- elements for '\n', and
- elements for runs of more than one blank.
- These will be added to the given element.
- """
- i = 0
- ch = ' '
-
- # When we encounter a tab or newline, we can immediately
- # dump any accumulated text and then emit the appropriate
- # ODF element.
- #
- # When we encounter a space, we add it to the text buffer,
- # and then collect more spaces. If there are more spaces
- # after the first one, we dump the text buffer and then
- # then emit the appropriate element.
-
- while i < len(s):
- ch = s[i]
- if ch == '\t':
- self._emitTextBuffer(odfElement)
- odfElement.addElement(Tab())
- i += 1
- elif ch == '\n':
- self._emitTextBuffer(odfElement);
- odfElement.addElement(LineBreak())
- i += 1
- elif ch == ' ':
- self.textBuffer.append(' ')
- i += 1
- self.spaceCount = 0
- while i < len(s) and (s[i] == ' '):
- self.spaceCount += 1
- i += 1
- if self.spaceCount > 0:
- self._emitTextBuffer(odfElement)
- self._emitSpaces(odfElement)
- else:
- self.textBuffer.append(ch)
- i += 1
-
- self._emitTextBuffer(odfElement)
-
- def _emitTextBuffer(self, odfElement):
- """ Creates a Text Node whose contents are the current textBuffer.
- Side effect: clears the text buffer.
- """
- if len(self.textBuffer) > 0:
- odfElement.addText(''.join(self.textBuffer))
- self.textBuffer = []
-
-
- def _emitSpaces(self, odfElement):
- """ Creates a element for the current spaceCount.
- Side effect: sets spaceCount back to zero
- """
- if self.spaceCount > 0:
- spaceElement = S(c=self.spaceCount)
- odfElement.addElement(spaceElement)
- self.spaceCount = 0
-
-def addTextToElement(odfElement, s):
- wst = WhitespaceText()
- wst.addTextToElement(odfElement, s)
-
-def extractText(odfElement):
- """ Extract text content from an Element, with whitespace represented
- properly. Returns the text, with tabs, spaces, and newlines
- correctly evaluated. This method recursively descends through the
- children of the given element, accumulating text and "unwrapping"
- , , and elements along the way.
- """
- result = [];
-
- if len(odfElement.childNodes) != 0:
- for child in odfElement.childNodes:
- if child.nodeType == Node.TEXT_NODE:
- result.append(child.data)
- elif child.nodeType == Node.ELEMENT_NODE:
- subElement = child
- tagName = subElement.qname;
- if tagName == (u"urn:oasis:names:tc:opendocument:xmlns:text:1.0", u"line-break"):
- result.append("\n")
- elif tagName == (u"urn:oasis:names:tc:opendocument:xmlns:text:1.0", u"tab"):
- result.append("\t")
- elif tagName == (u"urn:oasis:names:tc:opendocument:xmlns:text:1.0", u"s"):
- c = subElement.getAttribute('c')
- if c:
- spaceCount = int(c)
- else:
- spaceCount = 1
-
- result.append(" " * spaceCount)
- else:
- result.append(extractText(subElement))
- return ''.join(result)
diff --git a/libs/odf/text.py b/libs/odf/text.py
deleted file mode 100644
index 75d166c..0000000
--- a/libs/odf/text.py
+++ /dev/null
@@ -1,573 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2013 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-import re, sys, os.path
-sys.path.append(os.path.dirname(__file__))
-
-
-from namespaces import TEXTNS
-from element import Element
-from style import StyleElement
-
-# Autogenerated
-def A(**args):
- args.setdefault('type', 'simple')
- return Element(qname = (TEXTNS,'a'), **args)
-
-def AlphabeticalIndex(**args):
- return Element(qname = (TEXTNS,'alphabetical-index'), **args)
-
-def AlphabeticalIndexAutoMarkFile(**args):
- args.setdefault('type', 'simple')
- return Element(qname = (TEXTNS,'alphabetical-index-auto-mark-file'), **args)
-
-def AlphabeticalIndexEntryTemplate(**args):
- return Element(qname = (TEXTNS,'alphabetical-index-entry-template'), **args)
-
-def AlphabeticalIndexMark(**args):
- return Element(qname = (TEXTNS,'alphabetical-index-mark'), **args)
-
-def AlphabeticalIndexMarkEnd(**args):
- return Element(qname = (TEXTNS,'alphabetical-index-mark-end'), **args)
-
-def AlphabeticalIndexMarkStart(**args):
- return Element(qname = (TEXTNS,'alphabetical-index-mark-start'), **args)
-
-def AlphabeticalIndexSource(**args):
- return Element(qname = (TEXTNS,'alphabetical-index-source'), **args)
-
-def AuthorInitials(**args):
- return Element(qname = (TEXTNS,'author-initials'), **args)
-
-def AuthorName(**args):
- return Element(qname = (TEXTNS,'author-name'), **args)
-
-def Bibliography(**args):
- return Element(qname = (TEXTNS,'bibliography'), **args)
-
-def BibliographyConfiguration(**args):
- return Element(qname = (TEXTNS,'bibliography-configuration'), **args)
-
-def BibliographyEntryTemplate(**args):
- return Element(qname = (TEXTNS,'bibliography-entry-template'), **args)
-
-def BibliographyMark(**args):
- return Element(qname = (TEXTNS,'bibliography-mark'), **args)
-
-def BibliographySource(**args):
- return Element(qname = (TEXTNS,'bibliography-source'), **args)
-
-def Bookmark(**args):
- return Element(qname = (TEXTNS,'bookmark'), **args)
-
-def BookmarkEnd(**args):
- return Element(qname = (TEXTNS,'bookmark-end'), **args)
-
-def BookmarkRef(**args):
- return Element(qname = (TEXTNS,'bookmark-ref'), **args)
-
-def BookmarkStart(**args):
- return Element(qname = (TEXTNS,'bookmark-start'), **args)
-
-def Change(**args):
- return Element(qname = (TEXTNS,'change'), **args)
-
-def ChangeEnd(**args):
- return Element(qname = (TEXTNS,'change-end'), **args)
-
-def ChangeStart(**args):
- return Element(qname = (TEXTNS,'change-start'), **args)
-
-def ChangedRegion(**args):
- return Element(qname = (TEXTNS,'changed-region'), **args)
-
-def Chapter(**args):
- return Element(qname = (TEXTNS,'chapter'), **args)
-
-def CharacterCount(**args):
- return Element(qname = (TEXTNS,'character-count'), **args)
-
-def ConditionalText(**args):
- return Element(qname = (TEXTNS,'conditional-text'), **args)
-
-def CreationDate(**args):
- return Element(qname = (TEXTNS,'creation-date'), **args)
-
-def CreationTime(**args):
- return Element(qname = (TEXTNS,'creation-time'), **args)
-
-def Creator(**args):
- return Element(qname = (TEXTNS,'creator'), **args)
-
-def DatabaseDisplay(**args):
- return Element(qname = (TEXTNS,'database-display'), **args)
-
-def DatabaseName(**args):
- return Element(qname = (TEXTNS,'database-name'), **args)
-
-def DatabaseNext(**args):
- return Element(qname = (TEXTNS,'database-next'), **args)
-
-def DatabaseRowNumber(**args):
- return Element(qname = (TEXTNS,'database-row-number'), **args)
-
-def DatabaseRowSelect(**args):
- return Element(qname = (TEXTNS,'database-row-select'), **args)
-
-def Date(**args):
- return Element(qname = (TEXTNS,'date'), **args)
-
-def DdeConnection(**args):
- return Element(qname = (TEXTNS,'dde-connection'), **args)
-
-def DdeConnectionDecl(**args):
- return Element(qname = (TEXTNS,'dde-connection-decl'), **args)
-
-def DdeConnectionDecls(**args):
- return Element(qname = (TEXTNS,'dde-connection-decls'), **args)
-
-def Deletion(**args):
- return Element(qname = (TEXTNS,'deletion'), **args)
-
-def Description(**args):
- return Element(qname = (TEXTNS,'description'), **args)
-
-def EditingCycles(**args):
- return Element(qname = (TEXTNS,'editing-cycles'), **args)
-
-def EditingDuration(**args):
- return Element(qname = (TEXTNS,'editing-duration'), **args)
-
-def ExecuteMacro(**args):
- return Element(qname = (TEXTNS,'execute-macro'), **args)
-
-def Expression(**args):
- return Element(qname = (TEXTNS,'expression'), **args)
-
-def FileName(**args):
- return Element(qname = (TEXTNS,'file-name'), **args)
-
-def FormatChange(**args):
- return Element(qname = (TEXTNS,'format-change'), **args)
-
-def H(**args):
- return Element(qname = (TEXTNS, 'h'), **args)
-
-def HiddenParagraph(**args):
- return Element(qname = (TEXTNS,'hidden-paragraph'), **args)
-
-def HiddenText(**args):
- return Element(qname = (TEXTNS,'hidden-text'), **args)
-
-def IllustrationIndex(**args):
- return Element(qname = (TEXTNS,'illustration-index'), **args)
-
-def IllustrationIndexEntryTemplate(**args):
- return Element(qname = (TEXTNS,'illustration-index-entry-template'), **args)
-
-def IllustrationIndexSource(**args):
- return Element(qname = (TEXTNS,'illustration-index-source'), **args)
-
-def ImageCount(**args):
- return Element(qname = (TEXTNS,'image-count'), **args)
-
-def IndexBody(**args):
- return Element(qname = (TEXTNS,'index-body'), **args)
-
-def IndexEntryBibliography(**args):
- return Element(qname = (TEXTNS,'index-entry-bibliography'), **args)
-
-def IndexEntryChapter(**args):
- return Element(qname = (TEXTNS,'index-entry-chapter'), **args)
-
-def IndexEntryLinkEnd(**args):
- return Element(qname = (TEXTNS,'index-entry-link-end'), **args)
-
-def IndexEntryLinkStart(**args):
- return Element(qname = (TEXTNS,'index-entry-link-start'), **args)
-
-def IndexEntryPageNumber(**args):
- return Element(qname = (TEXTNS,'index-entry-page-number'), **args)
-
-def IndexEntrySpan(**args):
- return Element(qname = (TEXTNS,'index-entry-span'), **args)
-
-def IndexEntryTabStop(**args):
- return Element(qname = (TEXTNS,'index-entry-tab-stop'), **args)
-
-def IndexEntryText(**args):
- return Element(qname = (TEXTNS,'index-entry-text'), **args)
-
-def IndexSourceStyle(**args):
- return Element(qname = (TEXTNS,'index-source-style'), **args)
-
-def IndexSourceStyles(**args):
- return Element(qname = (TEXTNS,'index-source-styles'), **args)
-
-def IndexTitle(**args):
- return Element(qname = (TEXTNS,'index-title'), **args)
-
-def IndexTitleTemplate(**args):
- return Element(qname = (TEXTNS,'index-title-template'), **args)
-
-def InitialCreator(**args):
- return Element(qname = (TEXTNS,'initial-creator'), **args)
-
-def Insertion(**args):
- return Element(qname = (TEXTNS,'insertion'), **args)
-
-def Keywords(**args):
- return Element(qname = (TEXTNS,'keywords'), **args)
-
-def LineBreak(**args):
- return Element(qname = (TEXTNS,'line-break'), **args)
-
-def LinenumberingConfiguration(**args):
- return Element(qname = (TEXTNS,'linenumbering-configuration'), **args)
-
-def LinenumberingSeparator(**args):
- return Element(qname = (TEXTNS,'linenumbering-separator'), **args)
-
-def List(**args):
- return Element(qname = (TEXTNS,'list'), **args)
-
-def ListHeader(**args):
- return Element(qname = (TEXTNS,'list-header'), **args)
-
-def ListItem(**args):
- return Element(qname = (TEXTNS,'list-item'), **args)
-
-def ListLevelStyleBullet(**args):
- return Element(qname = (TEXTNS,'list-level-style-bullet'), **args)
-
-def ListLevelStyleImage(**args):
- return Element(qname = (TEXTNS,'list-level-style-image'), **args)
-
-def ListLevelStyleNumber(**args):
- return Element(qname = (TEXTNS,'list-level-style-number'), **args)
-
-def ListStyle(**args):
- return StyleElement(qname = (TEXTNS,'list-style'), **args)
-
-def Measure(**args):
- return Element(qname = (TEXTNS,'measure'), **args)
-
-def Meta(**args):
- return Element(qname = (TEXTNS,'meta'), **args)
-
-def MetaField(**args):
- return Element(qname = (TEXTNS,'meta-field'), **args)
-
-def ModificationDate(**args):
- return Element(qname = (TEXTNS,'modification-date'), **args)
-
-def ModificationTime(**args):
- return Element(qname = (TEXTNS,'modification-time'), **args)
-
-def Note(**args):
- return Element(qname = (TEXTNS,'note'), **args)
-
-def NoteBody(**args):
- return Element(qname = (TEXTNS,'note-body'), **args)
-
-def NoteCitation(**args):
- return Element(qname = (TEXTNS,'note-citation'), **args)
-
-def NoteContinuationNoticeBackward(**args):
- return Element(qname = (TEXTNS,'note-continuation-notice-backward'), **args)
-
-def NoteContinuationNoticeForward(**args):
- return Element(qname = (TEXTNS,'note-continuation-notice-forward'), **args)
-
-def NoteRef(**args):
- return Element(qname = (TEXTNS,'note-ref'), **args)
-
-def NotesConfiguration(**args):
- return Element(qname = (TEXTNS,'notes-configuration'), **args)
-
-def Number(**args):
- return Element(qname = (TEXTNS,'number'), **args)
-
-def NumberedParagraph(**args):
- return Element(qname = (TEXTNS,'numbered-paragraph'), **args)
-
-def ObjectCount(**args):
- return Element(qname = (TEXTNS,'object-count'), **args)
-
-def ObjectIndex(**args):
- return Element(qname = (TEXTNS,'object-index'), **args)
-
-def ObjectIndexEntryTemplate(**args):
- return Element(qname = (TEXTNS,'object-index-entry-template'), **args)
-
-def ObjectIndexSource(**args):
- return Element(qname = (TEXTNS,'object-index-source'), **args)
-
-def OutlineLevelStyle(**args):
- return Element(qname = (TEXTNS,'outline-level-style'), **args)
-
-def OutlineStyle(**args):
- return Element(qname = (TEXTNS,'outline-style'), **args)
-
-def P(**args):
- return Element(qname = (TEXTNS, 'p'), **args)
-
-def Page(**args):
- return Element(qname = (TEXTNS,'page'), **args)
-
-def PageContinuation(**args):
- return Element(qname = (TEXTNS,'page-continuation'), **args)
-
-def PageCount(**args):
- return Element(qname = (TEXTNS,'page-count'), **args)
-
-def PageNumber(**args):
- return Element(qname = (TEXTNS,'page-number'), **args)
-
-def PageSequence(**args):
- return Element(qname = (TEXTNS,'page-sequence'), **args)
-
-def PageVariableGet(**args):
- return Element(qname = (TEXTNS,'page-variable-get'), **args)
-
-def PageVariableSet(**args):
- return Element(qname = (TEXTNS,'page-variable-set'), **args)
-
-def ParagraphCount(**args):
- return Element(qname = (TEXTNS,'paragraph-count'), **args)
-
-def Placeholder(**args):
- return Element(qname = (TEXTNS,'placeholder'), **args)
-
-def PrintDate(**args):
- return Element(qname = (TEXTNS,'print-date'), **args)
-
-def PrintTime(**args):
- return Element(qname = (TEXTNS,'print-time'), **args)
-
-def PrintedBy(**args):
- return Element(qname = (TEXTNS,'printed-by'), **args)
-
-def ReferenceMark(**args):
- return Element(qname = (TEXTNS,'reference-mark'), **args)
-
-def ReferenceMarkEnd(**args):
- return Element(qname = (TEXTNS,'reference-mark-end'), **args)
-
-def ReferenceMarkStart(**args):
- return Element(qname = (TEXTNS,'reference-mark-start'), **args)
-
-def ReferenceRef(**args):
- return Element(qname = (TEXTNS,'reference-ref'), **args)
-
-def Ruby(**args):
- return Element(qname = (TEXTNS,'ruby'), **args)
-
-def RubyBase(**args):
- return Element(qname = (TEXTNS,'ruby-base'), **args)
-
-def RubyText(**args):
- return Element(qname = (TEXTNS,'ruby-text'), **args)
-
-def S(**args):
- return Element(qname = (TEXTNS,'s'), **args)
-
-def Script(**args):
- return Element(qname = (TEXTNS,'script'), **args)
-
-def Section(**args):
- return Element(qname = (TEXTNS,'section'), **args)
-
-def SectionSource(**args):
- return Element(qname = (TEXTNS,'section-source'), **args)
-
-def SenderCity(**args):
- return Element(qname = (TEXTNS,'sender-city'), **args)
-
-def SenderCompany(**args):
- return Element(qname = (TEXTNS,'sender-company'), **args)
-
-def SenderCountry(**args):
- return Element(qname = (TEXTNS,'sender-country'), **args)
-
-def SenderEmail(**args):
- return Element(qname = (TEXTNS,'sender-email'), **args)
-
-def SenderFax(**args):
- return Element(qname = (TEXTNS,'sender-fax'), **args)
-
-def SenderFirstname(**args):
- return Element(qname = (TEXTNS,'sender-firstname'), **args)
-
-def SenderInitials(**args):
- return Element(qname = (TEXTNS,'sender-initials'), **args)
-
-def SenderLastname(**args):
- return Element(qname = (TEXTNS,'sender-lastname'), **args)
-
-def SenderPhonePrivate(**args):
- return Element(qname = (TEXTNS,'sender-phone-private'), **args)
-
-def SenderPhoneWork(**args):
- return Element(qname = (TEXTNS,'sender-phone-work'), **args)
-
-def SenderPosition(**args):
- return Element(qname = (TEXTNS,'sender-position'), **args)
-
-def SenderPostalCode(**args):
- return Element(qname = (TEXTNS,'sender-postal-code'), **args)
-
-def SenderStateOrProvince(**args):
- return Element(qname = (TEXTNS,'sender-state-or-province'), **args)
-
-def SenderStreet(**args):
- return Element(qname = (TEXTNS,'sender-street'), **args)
-
-def SenderTitle(**args):
- return Element(qname = (TEXTNS,'sender-title'), **args)
-
-def Sequence(**args):
- return Element(qname = (TEXTNS,'sequence'), **args)
-
-def SequenceDecl(**args):
- return Element(qname = (TEXTNS,'sequence-decl'), **args)
-
-def SequenceDecls(**args):
- return Element(qname = (TEXTNS,'sequence-decls'), **args)
-
-def SequenceRef(**args):
- return Element(qname = (TEXTNS,'sequence-ref'), **args)
-
-def SheetName(**args):
- return Element(qname = (TEXTNS,'sheet-name'), **args)
-
-def SoftPageBreak(**args):
- return Element(qname = (TEXTNS,'soft-page-break'), **args)
-
-def SortKey(**args):
- return Element(qname = (TEXTNS,'sort-key'), **args)
-
-def Span(**args):
- return Element(qname = (TEXTNS,'span'), **args)
-
-def Subject(**args):
- return Element(qname = (TEXTNS,'subject'), **args)
-
-def Tab(**args):
- return Element(qname = (TEXTNS,'tab'), **args)
-
-def TableCount(**args):
- return Element(qname = (TEXTNS,'table-count'), **args)
-
-def TableFormula(**args):
- return Element(qname = (TEXTNS,'table-formula'), **args)
-
-def TableIndex(**args):
- return Element(qname = (TEXTNS,'table-index'), **args)
-
-def TableIndexEntryTemplate(**args):
- return Element(qname = (TEXTNS,'table-index-entry-template'), **args)
-
-def TableIndexSource(**args):
- return Element(qname = (TEXTNS,'table-index-source'), **args)
-
-def TableOfContent(**args):
- return Element(qname = (TEXTNS,'table-of-content'), **args)
-
-def TableOfContentEntryTemplate(**args):
- return Element(qname = (TEXTNS,'table-of-content-entry-template'), **args)
-
-def TableOfContentSource(**args):
- return Element(qname = (TEXTNS,'table-of-content-source'), **args)
-
-def TemplateName(**args):
- return Element(qname = (TEXTNS,'template-name'), **args)
-
-def TextInput(**args):
- return Element(qname = (TEXTNS,'text-input'), **args)
-
-def Time(**args):
- return Element(qname = (TEXTNS,'time'), **args)
-
-def Title(**args):
- return Element(qname = (TEXTNS,'title'), **args)
-
-def TocMark(**args):
- return Element(qname = (TEXTNS,'toc-mark'), **args)
-
-def TocMarkEnd(**args):
- return Element(qname = (TEXTNS,'toc-mark-end'), **args)
-
-def TocMarkStart(**args):
- return Element(qname = (TEXTNS,'toc-mark-start'), **args)
-
-def TrackedChanges(**args):
- return Element(qname = (TEXTNS,'tracked-changes'), **args)
-
-def UserDefined(**args):
- return Element(qname = (TEXTNS,'user-defined'), **args)
-
-def UserFieldDecl(**args):
- return Element(qname = (TEXTNS,'user-field-decl'), **args)
-
-def UserFieldDecls(**args):
- return Element(qname = (TEXTNS,'user-field-decls'), **args)
-
-def UserFieldGet(**args):
- return Element(qname = (TEXTNS,'user-field-get'), **args)
-
-def UserFieldInput(**args):
- return Element(qname = (TEXTNS,'user-field-input'), **args)
-
-def UserIndex(**args):
- return Element(qname = (TEXTNS,'user-index'), **args)
-
-def UserIndexEntryTemplate(**args):
- return Element(qname = (TEXTNS,'user-index-entry-template'), **args)
-
-def UserIndexMark(**args):
- return Element(qname = (TEXTNS,'user-index-mark'), **args)
-
-def UserIndexMarkEnd(**args):
- return Element(qname = (TEXTNS,'user-index-mark-end'), **args)
-
-def UserIndexMarkStart(**args):
- return Element(qname = (TEXTNS,'user-index-mark-start'), **args)
-
-def UserIndexSource(**args):
- return Element(qname = (TEXTNS,'user-index-source'), **args)
-
-def VariableDecl(**args):
- return Element(qname = (TEXTNS,'variable-decl'), **args)
-
-def VariableDecls(**args):
- return Element(qname = (TEXTNS,'variable-decls'), **args)
-
-def VariableGet(**args):
- return Element(qname = (TEXTNS,'variable-get'), **args)
-
-def VariableInput(**args):
- return Element(qname = (TEXTNS,'variable-input'), **args)
-
-def VariableSet(**args):
- return Element(qname = (TEXTNS,'variable-set'), **args)
-
-def WordCount(**args):
- return Element(qname = (TEXTNS,'word-count'), **args)
-
diff --git a/libs/odf/thumbnail.py b/libs/odf/thumbnail.py
deleted file mode 100644
index 3781145..0000000
--- a/libs/odf/thumbnail.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# This contains a 104x128 px thumbnail in PNG format
-# Downloaded from http://da.libreoffice.org/assets/Uploads/Da-Projekt_Billeder/IconLibreOffice.png
-# Copyright information: Unless otherwise specified, all text and images on the
-# http://da.libreoffice.org website are licensed under the Creative Commons
-# Attribution-Share Alike 3.0 License. (As of 2013-01-09)
-
-# Alternative download: http://commons.wikimedia.org/wiki/File:LibreOffice_icon_3.3.1_48_px.svg
-import base64
-
-iconstr = """\
-iVBORw0KGgoAAAANSUhEUgAAAGgAAACACAYAAADnCyxOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz
-AAAG7AAABuwBHnU4NQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAwBSURB
-VHic7Z1bbFTHHca/2UsxYDs4IRiv7Y0xUNRUCCmAFBXiCwaiRhFIxjdsjG18g8YvlfoQqepDH/yA
-hKI+EUIIKqVxwiVAuapUlh+qqi+8VH2hfUgDUpuHVnhjs17vnsv0oZ3lnNkzs2fXu2eX3flJR7ue
-nbN7znz7/ec/M+esCaUUk5OTtQDOAOgAUAdnqKBc9lqm5bl8Lwrg7wD+BODWJ5988lDymY6cPHmy
-F8AIpfRHAL6X6f5ZQAE8JYQ80DTtF5999tkiGR8fXw/gLwBCHhxAITkD4MPz588bbipPTEx8H8Bf
-4Y0wKRBC/qbr+m4fgGmUvjgA8DMADyYmJta4qUwI6UCBxAEASuk2v9//Sx+Adwt1EAXgAIC7bkSi
-lM5TSlHg7VCAUvqG9cCmp6dBqayLeLmYm5vD7OystagdwN3x8fH3P/300yXRfpWVlb9bWFh4Qgh5
-Q1THAzb7+BJKKUzTLJmtra0N+/bt40+TiSR00kcffRQzTXPCNE0tx42eET7eVgxN0xCNRrG0tISl
-pSXEYjHEYjEsLy9jeXkZ8Xgc8XgciUQCiUQCmqbZNl3Xoes6DMOAYRjJBuM/J99QStHe3o729nY+
-fLRTSu+OjY0JRbp48eJD0zR7NU3TChXmyOjoqK21pqenYZomotEompqa8t6A+cAwDEQiEZimmSwj
-hGB2dhZzc3N89TkA71+4cEEY7oaGhjoBfBkMBoN5OWAJthDHf7MJIS/lFggEUFNTA5/PZzu3jo4O
-tLW18W3QDkDqpEuXLt0wTbM/Ho977qSUEOcU7l5G/H4/ampqQAhJno9pmujo6EBLS4tjuBsdHRWK
-dPny5euGYRyLx+Oe9kkpDioVgYAXIvFOOnDgAFpbW/nq7QCkIs3MzFyllB6PxWJ6fo44FWGSUCqw
-cMc7af/+/di7d6+Tk+6dOHFCKNLnn3/+pWEYQ9FoVPckxPEHUIpiBQIBvPrqqykiHTx4EHv27OHP
-tQ2AVKQrV67MGIYxEo1G8+6kkg5xVmQivf322xmLdO3atd/quj76/PlzV3N72SJMEkqRYDCI1157
-DYQQW/l7772HXbt22cZplNI2Sum9kZERoUhfffXVbzRNG1tYWDA8C3GMUhZp/fr1AOwR49ChQ9i5
-c6dt7IT/O0km0s2bN39tGMbEwsJCXpxkc1AhRvqFgDmJP/fDhw9jx44dMAwjxUnDw8MykS4ahnEy
-Eonk3EllkSQ4sWrVKrz++uu286SUoqurC9u3b3d0kkykW7duXdB1/Sfz8/OmqE42CGcS+DhdijCR
-rI4xTRM9PT148803YRi2qNUG4P7w8PBa0fvduXPnPKX0g2fPnuVMJGGSwH2DSpaKigps2LAhRaTe
-3l5s27YNuq5b26WVUnpvaGhIKNLt27fPUUqnnj17ZuY8xDEHWR/LYauoqEBtbS3f96C/vx9bt27l
-ndQKQCrSnTt3PqaUTkUikRV/y8veQQyrSFYGBwfR3NwMTdNSnHT8+PF0In3w3XffrchJwjS7HPog
-ntWrV2Pjxo28GBgaGsKmTZug67aJg1YAUpFu3759zjTNqcXFxay/7cKZhHJzEGP16tWoq6tDIpGw
-tcfIyAjC4XA2In0MYOr58+dZNWhZzSS4Zc2aNQiFQkgkErbysbGxZDkf7gYHB4Ui3bx5MylSTpIE
-BbB27VqEQiHE43Fbg01OTqKurg6aZlsWagUgFenGjRsfA/ggFotl1MgqSZBQWVmJUCiE5eVlW9uc
-OnUKtbW1Tk66f+zYMZlI50zTnIrFYjTrJEGFOTtVVVWor69HLBZLESkUCvFOagGQTqSzAKbi8bir
-BhYmCYoXVFdXo7GxEbFYLFlGCMHk5CTq6+v5xCGtSNevXz8LYCqRSKRt6JJfUc0V1dXVCIfDNicB
-wPj4OOrr6/nUvIVSen9gYEAo0rVr185SSqcSiYQ03EkX7NRm36qqqtDY2Gjrk4D/ZXcNDQ2OTkon
-EoApXddFzoiU7FU9+YKFu3g8bisfGxtDY2MjP3fXQim939/fLxTp6tWrZymlU4ZhODnpYdkt2OUC
-Fu747O7EiRMIh8P8dFELADciHTJN84ml+F8AfqWyuCypqqpCOBxOGScNDw+jqamJH6akFenKlSt3
-5+fnf0gp3U8pfd/n8/1gZmbmz6Svry+pRDQaxenTp2EYBqLRKN566608nmJpsLi4iCdPnoC/Kvjy
-5cv45ptvbNfkAfgjgB9/8cUXUbfvrxy0QpiTuAQBg4OD2LRpE++kdwA8OHr0qNBJPMI+SOEeljjw
-s+ADAwNobm7mv+xMpEo37y28aEQ5KDNY4sBlcTh69Ciam5v5tn2HUnq/r68vrUiODlICZQcTiZ/H
-7Ovrw5YtW5yclFYk4UyCEig7qqur0dDQkBKNuru7kyLxTurt7RWKVDaX/nrJK6+8gsbGxpTrDLu6
-urB161a++jsAhCIJszj+G6C2zGZcWLizvk4IwZEjR0QiPXASSU315ABR+7G5O75Njxw54hTu9lJK
-H/T09NhEEq6oKoFyA0vBAbuQnZ2d2LJlC199LwCbSMpBHuAkEgB0dnYmx0m8k7q7uysBNZPgGUwk
-6+VshBB0dXVh8+bNfPW9AM4Bae7yVuQWlt0BSOmTmpub+eoD3d3dPSrEeYxMpKamJl6DU9I0W5Ef
-1q1bh3A4nBLuuru7+apNAT5zUw7yhnXr1oFSiqdPn8I0zeQPcHDt3qDS7AJSU1PjOE6yEAjwJcpF
-3lJTU4Ovv/4aPp8v2ebW0KdCXJHBt7tKs4sAmTGEDlJZnHewJMFJJDWTUATIkjO1HlQEyH6fIiXE
-OT1X5Be+a7FeqiW8JkHhHVb3ZJQklLJQxXSTtJMGjICoYqlTTOcq6/vVZGkRkFGSoLI477G2Nd+1
-qHFQESBr84ASovDIkjPloCJA1gcJBVJ4h2yCQIW4IkB2PYhwwY49V+SfrJYblDjeYU0MpMsN1jUJ
-hXeIxAHULZBFQUbjIOUg71HjoCJH1tYqzS4CnG6WY6iBahEgTbPT7aBYOZksDqadSVDC5J507el6
-HKQoDK7TbDWTUBhcp9miqxsV+UXW1upfAxQBst9IEiYJykHekdVygxLJO1wv2ClhCoermQTV7xQG
-mTHUVE+RwNqdN4kaBxUZrkOcCnfeYTWFclCRIrpYR6XZecZNJJLVsQmkpnpyj5t2zCjE8Tuqvii/
-8MsMGa+oKiflDydxpA6y7mjdQTkp91jFsbat6wU7/iJG5aTcIQtrvBGkl13xOyuRVo6TONa/eaTL
-Dfw9+yrcrQwncZzuBXY1DgKQ/E9ShBDbpkTKHFFYY23sykF8Bd5BDCVSZojEYQ6SdSVpB6qifkeJ
-5A6ZOE7TbDzSJIHFR5U4ZIcbcfg+yPVMAiEkaT/mFieUk5xxI47MBAzpZKn1g5RI7nErjlO9tDMJ
-TvZTIrknU3H4EJeRg6yqKpHSk61zrM9THCT7QOtlqEokOdmKw/dBPGlnEtgPnvKDVP55OQ9mV9Ln
-ZDQO4ne2jnIZykl2ViIOAP7/fqcgDHGsgdlsghIplZWK43RfUEYXjRiGoUQSkCtx+Lk4aRbHrwGx
-Psjn8ymRLORKHNa+MqQO0nU96SImDnu0JgRs30wTh5dRsFyLw9rXdZJgxTAMm8IiJwF2l7h1kqhe
-seJWHKc6QKo4pmlC13VbfZ60d3nzFsy1SC8L+RDHKcXOeKpHiZRfcdg40/pZrkOcNQ0sV5Hy7RzZ
-7Y9AmhVV1gexVdVyE8kLcZwGqhk5iIlSbiJ5IY51Kk1EyjjICp+nl4tIXoqT0YoqXzEYDCISicDn
-88Hn88Hv9yefE0Lg9/uTZX6/P1lGCEnWYY/sOYDkexTjJV1ODc83plMfYp0ZYI8shFlnZFgZex4M
-BlOSBCvSEPf48eO8nby1EZyeW8tkr1nLGOyErQNpUVk2r3uJ9PfiNE3z8FAK1wg8IuG9/GxGioP8
-fj8qKio8OyDFC/x+f0oZ2b179z8BhLw6CFG4Svfotq4oJGXzWOjwBuDfAUrp7wGMePmpxRLKMqUA
-IW/WB+BDAN96/cmKtHwL4KeEUopdu3bVAjgD4CCADYU9rrLnHwD+AODnjx49+s9/AexyD6bH7vMJ
-AAAAAElFTkSuQmCC\
-"""
-
-def thumbnail():
- icon = base64.decodestring(iconstr)
- return icon
-
-if __name__ == "__main__":
- icon = thumbnail()
- f = file("thumbnail.png","wb")
- f.write(icon)
- f.close()
diff --git a/libs/odf/userfield.py b/libs/odf/userfield.py
deleted file mode 100644
index 1b34788..0000000
--- a/libs/odf/userfield.py
+++ /dev/null
@@ -1,180 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2009 Søren Roug, European Environment Agency
-#
-# This is free software. You may redistribute it under the terms
-# of the Apache license and the GNU General Public License Version
-# 2 or at your option any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s): Michael Howitz, gocept gmbh & co. kg
-#
-# $Id: userfield.py 447 2008-07-10 20:01:30Z roug $
-
-"""Class to show and manipulate user fields in odf documents."""
-
-import sys
-import zipfile
-
-from odf.text import UserFieldDecl
-from odf.namespaces import OFFICENS
-from odf.opendocument import load
-import io, sys
-
-if sys.version_info[0]==3:
- unicode=str
-
-OUTENCODING = "utf-8"
-
-
-# OpenDocument v.1.0 section 6.7.1
-VALUE_TYPES = {
- u'float': (OFFICENS, u'value'),
- u'percentage': (OFFICENS, u'value'),
- u'currency': (OFFICENS, u'value'),
- u'date': (OFFICENS, u'date-value'),
- u'time': (OFFICENS, u'time-value'),
- u'boolean': (OFFICENS, u'boolean-value'),
- u'string': (OFFICENS, u'string-value'),
- }
-
-
-class UserFields(object):
- """List, view and manipulate user fields."""
-
- # these attributes can be a filename or a file like object
- src_file = None
- dest_file = None
-
- def __init__(self, src=None, dest=None):
- """Constructor
-
- @param src open file in binary mode: source document,
- or filename as a unicode string, or None for stdin.
- @param dest opendile in binary mode: destination document,
- or filename as a unicode string, or None for stdout.
- """
- assert(src==None or 'rb' in repr(src) or 'BufferedReader' in repr(src) or 'BytesIO' in repr(src) or type(src)==type(u""))
- assert(dest==None or 'wb' in repr(dest) or 'BufferedWriter' in repr(dest) or 'BytesIO' in repr(dest) or type(dest)==type(u""))
- self.src_file = src
- self.dest_file = dest
- self.document = None
-
- def loaddoc(self):
- if (sys.version_info[0]==3 and (isinstance(self.src_file, str) or (isinstance(self.src_file, io.IOBase)))) or (sys.version_info[0]==2 and isinstance(self.src_file, basestring)):
- # src_file is a filename, check if it is a zip-file
- if not zipfile.is_zipfile(self.src_file):
- raise TypeError(u"%s is no odt file." % self.src_file)
- elif self.src_file is None:
- # use stdin if no file given
- self.src_file = sys.stdin
-
- self.document = load(self.src_file)
-
- def savedoc(self):
- # write output
- if self.dest_file is None:
- # use stdout if no filename given
- self.document.save(u'-')
- else:
- self.document.save(self.dest_file)
-
- def list_fields(self):
- """List (extract) all known user-fields.
-
- @return list of user-field names as unicode strings.
- """
- return [x[0] for x in self.list_fields_and_values()]
-
- def list_fields_and_values(self, field_names=None):
- """List (extract) user-fields with type and value.
-
- @param field_names list of field names as unicode strings
- to show, or None for all.
-
- @return list of tuples (, , )
- as type (unicode string, stringified type, unicode string).
-
- """
- self.loaddoc()
- found_fields = []
- all_fields = self.document.getElementsByType(UserFieldDecl)
- for f in all_fields:
- value_type = f.getAttribute(u'valuetype')
- if value_type == u'string':
- value = f.getAttribute(u'stringvalue')
- else:
- value = f.getAttribute(u'value')
- field_name = f.getAttribute(u'name')
-
- if field_names is None or field_name in field_names:
- found_fields.append((field_name,
- value_type,
- value))
- return found_fields
-
- def list_values(self, field_names):
- """Extract the contents of given field names from the file.
-
- @param field_names list of field names as unicode strings
-
- @return list of field values as unicode strings.
-
- """
- return [x[2] for x in self.list_fields_and_values(field_names)]
-
- def get(self, field_name):
- """Extract the contents of this field from the file.
- @param field_name unicode string: name of a field
- @return field value as a unicode string or None if field does not exist.
-
- """
- assert(type(field_name)==type(u""))
- values = self.list_values([field_name])
- if not values:
- return None
- return values[0]
-
- def get_type_and_value(self, field_name):
- """Extract the type and contents of this field from the file.
- @param field_name unicode string: name of a field
- @return tuple (, ) as a pair of unicode strings
- or None if field does not exist.
-
- """
- assert(type(field_name)==type(u""))
- fields = self.list_fields_and_values([field_name])
- if not fields:
- return None
- field_name, value_type, value = fields[0]
- return value_type, value
-
- def update(self, data):
- """Set the value of user fields. The field types will be the same.
-
- data ... dict, with field name as key, field value as value
-
- Returns None
-
- """
- self.loaddoc()
- all_fields = self.document.getElementsByType(UserFieldDecl)
- for f in all_fields:
- field_name = f.getAttribute(u'name')
- if field_name in data:
- value_type = f.getAttribute(u'valuetype')
- value = data.get(field_name)
- if value_type == u'string':
- f.setAttribute(u'stringvalue', value)
- else:
- f.setAttribute(u'value', value)
- self.savedoc()
-
diff --git a/libs/odf/xforms.py b/libs/odf/xforms.py
deleted file mode 100644
index f28b96e..0000000
--- a/libs/odf/xforms.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Contributor(s):
-#
-
-from namespaces import XFORMSNS
-from element import Element
-
-# ODF 1.0 section 11.2
-# XForms is designed to be embedded in another XML format.
-# Autogenerated
-def Model(**args):
- return Element(qname = (XFORMSNS,'model'), **args)
-
-def Instance(**args):
- return Element(qname = (XFORMSNS,'instance'), **args)
-
-def Bind(**args):
- return Element(qname = (XFORMSNS,'bind'), **args)
diff --git a/libs/txt2tags b/libs/txt2tags
deleted file mode 100644
index 3f19d22..0000000
--- a/libs/txt2tags
+++ /dev/null
@@ -1,5987 +0,0 @@
-#!/usr/bin/env python
-# txt2tags - generic text conversion tool ---> READY TO PYTHON 3!
-# http://txt2tags.org
-#
-# Copyright 2001-2010 Aurelio Jargas
-#
-# License: http://www.gnu.org/licenses/gpl-2.0.txt
-# Subversion: http://svn.txt2tags.org
-# Bug tracker: http://bugs.txt2tags.org
-#
-########################################################################
-#
-# BORING CODE EXPLANATION AHEAD
-#
-# Just read it if you wish to understand how the txt2tags code works.
-#
-########################################################################
-#
-# The code that [1] parses the marked text is separated from the
-# code that [2] insert the target tags.
-#
-# [1] made by: def convert()
-# [2] made by: class BlockMaster
-#
-# The structures of the marked text are identified and its contents are
-# extracted into a data holder (Python lists and dictionaries).
-#
-# When parsing the source file, the blocks (para, lists, quote, table)
-# are opened with BlockMaster, right when found. Then its contents,
-# which spans on several lines, are feeded into a special holder on the
-# BlockMaster instance. Just when the block is closed, the target tags
-# are inserted for the full block as a whole, in one pass. This way, we
-# have a better control on blocks. Much better than the previous line by
-# line approach.
-#
-# In other words, whenever inside a block, the parser *holds* the tag
-# insertion process, waiting until the full block is read. That was
-# needed primary to close paragraphs for the XHTML target, but
-# proved to be a very good adding, improving many other processing.
-#
-# -------------------------------------------------------------------
-#
-# These important classes are all documented:
-# CommandLine, SourceDocument, ConfigMaster, ConfigLines.
-#
-# There is a RAW Config format and all kind of configuration is first
-# converted to this format. Then a generic method parses it.
-#
-# These functions get information about the input file(s) and take
-# care of the init processing:
-# get_infiles_config(), process_source_file() and convert_this_files()
-#
-########################################################################
-
-#XXX Python coding warning
-# Avoid common mistakes:
-# - do NOT use newlist=list instead newlist=list[:]
-# - do NOT use newdic=dic instead newdic=dic.copy()
-# - do NOT use dic[key] instead dic.get(key)
-# - do NOT use del dic[key] without has_key() before
-
-#XXX Smart Image Align don't work if the image is a link
-# Can't fix that because the image is expanded together with the
-# link, at the linkbank filling moment. Only the image is passed
-# to parse_images(), not the full line, so it is always 'middle'.
-
-#XXX Paragraph separation not valid inside Quote
-# Quote will not have
inside, instead will close and open
-# again the . This really sux in CSS, when defining a
-# different background color. Still don't know how to fix it.
-
-#XXX TODO (maybe)
-# New mark or macro which expands to an anchor full title.
-# It is necessary to parse the full document in this order:
-# DONE 1st scan: HEAD: get all settings, including %!includeconf
-# DONE 2nd scan: BODY: expand includes & apply %!preproc
-# 3rd scan: BODY: read titles and compose TOC info
-# 4th scan: BODY: full parsing, expanding [#anchor] 1st
-# Steps 2 and 3 can be made together, with no tag adding.
-# Two complete body scans will be *slow*, don't know if it worths.
-# One solution may be add the titles as postproc rules
-
-
-##############################################################################
-
-# User config (1=ON, 0=OFF)
-
-USE_I18N = 1 # use gettext for i18ned messages? (default is 1)
-COLOR_DEBUG = 1 # show debug messages in colors? (default is 1)
-BG_LIGHT = 0 # your terminal background color is light (default is 0)
-HTML_LOWER = 0 # use lowercased HTML tags instead upper? (default is 0)
-
-##############################################################################
-
-
-# These are all the core Python modules used by txt2tags (KISS!)
-import re, os, sys, time, getopt
-
-# The CSV module is new in Python version 2.3
-try:
- import csv
-except ImportError:
- csv = None
-
-# Program information
-my_url = 'http://txt2tags.org'
-my_name = 'txt2tags'
-my_email = 'verde@aurelio.net'
-my_version = '2.6'
-
-# i18n - just use if available
-if USE_I18N:
- try:
- import gettext
- # If your locale dir is different, change it here
- cat = gettext.Catalog('txt2tags',localedir='/usr/share/locale/')
- _ = cat.gettext
- except:
- _ = lambda x:x
-else:
- _ = lambda x:x
-
-# FLAGS : the conversion related flags , may be used in %!options
-# OPTIONS : the conversion related options, may be used in %!options
-# ACTIONS : the other behavior modifiers, valid on command line only
-# MACROS : the valid macros with their default values for formatting
-# SETTINGS: global miscellaneous settings, valid on RC file only
-# NO_TARGET: actions that don't require a target specification
-# NO_MULTI_INPUT: actions that don't accept more than one input file
-# CONFIG_KEYWORDS: the valid %!key:val keywords
-#
-# FLAGS and OPTIONS are configs that affect the converted document.
-# They usually have also a --no- to turn them OFF.
-#
-# ACTIONS are needed because when doing multiple input files, strange
-# behavior would be found, as use command line interface for the
-# first file and gui for the second. There is no --no-.
-# --version and --help inside %!options are also odd
-#
-TARGETS = sorted( 'html xhtml sgml dbk tex lout man mgp wiki gwiki doku pmw moin pm6 txt art adoc creole'.split() )
-
-FLAGS = {'headers' :1 , 'enum-title' :0 , 'mask-email' :0 ,
- 'toc-only' :0 , 'toc' :0 , 'rc' :1 ,
- 'css-sugar' :0 , 'css-suggar' :0 , 'css-inside' :0 ,
- 'quiet' :0 , 'slides' :0 }
-OPTIONS = {'target' :'', 'toc-level' :3 , 'style' :'',
- 'infile' :'', 'outfile' :'', 'encoding' :'',
- 'config-file':'', 'split' :0 , 'lang' :'',
- 'width' :0 , 'height' :0 , 'art-chars' :'',
- 'show-config-value':''}
-ACTIONS = {'help' :0 , 'version' :0 , 'gui' :0 ,
- 'verbose' :0 , 'debug' :0 , 'dump-config':0 ,
- 'dump-source':0 , 'targets' :0}
-MACROS = {'date' : '%Y%m%d', 'infile': '%f',
- 'mtime': '%Y%m%d', 'outfile': '%f'}
-SETTINGS = {} # for future use
-NO_TARGET = ['help', 'version', 'gui', 'toc-only', 'dump-config', 'dump-source', 'targets']
-NO_MULTI_INPUT = ['gui','dump-config','dump-source']
-CONFIG_KEYWORDS = [
- 'target', 'encoding', 'style', 'options', 'preproc','postproc',
- 'guicolors']
-
-TARGET_NAMES = {
- 'html' : _('HTML page'),
- 'xhtml' : _('XHTML page'),
- 'sgml' : _('SGML document'),
- 'dbk' : _('DocBook document'),
- 'tex' : _('LaTeX document'),
- 'lout' : _('Lout document'),
- 'man' : _('UNIX Manual page'),
- 'mgp' : _('MagicPoint presentation'),
- 'wiki' : _('Wikipedia page'),
- 'gwiki' : _('Google Wiki page'),
- 'doku' : _('DokuWiki page'),
- 'pmw' : _('PmWiki page'),
- 'moin' : _('MoinMoin page'),
- 'pm6' : _('PageMaker document'),
- 'txt' : _('Plain Text'),
- 'art' : _('ASCII Art text'),
- 'adoc' : _('AsciiDoc document'),
- 'creole' : _('Creole 1.0 document')
-}
-
-DEBUG = 0 # do not edit here, please use --debug
-VERBOSE = 0 # do not edit here, please use -v, -vv or -vvv
-QUIET = 0 # do not edit here, please use --quiet
-GUI = 0 # do not edit here, please use --gui
-AUTOTOC = 1 # do not edit here, please use --no-toc or %%toc
-
-DFT_TEXT_WIDTH = 72 # do not edit here, please use --width
-DFT_SLIDE_WIDTH = 80 # do not edit here, please use --width
-DFT_SLIDE_HEIGHT = 25 # do not edit here, please use --height
-
-# ASCII Art config
-AA_KEYS = 'corner border side bar1 bar2 level2 level3 level4 level5'.split()
-AA_VALUES = '+-|-==-^"' # do not edit here, please use --art-chars
-AA = dict(zip(AA_KEYS, AA_VALUES))
-AA_COUNT = 0
-AA_TITLE = ''
-
-RC_RAW = []
-CMDLINE_RAW = []
-CONF = {}
-BLOCK = None
-TITLE = None
-regex = {}
-TAGS = {}
-rules = {}
-
-# Gui globals
-askopenfilename = None
-showinfo = None
-showwarning = None
-showerror = None
-
-lang = 'english'
-TARGET = ''
-
-STDIN = STDOUT = '-'
-MODULEIN = MODULEOUT = '-module-'
-ESCCHAR = '\x00'
-SEPARATOR = '\x01'
-LISTNAMES = {'-':'list', '+':'numlist', ':':'deflist'}
-LINEBREAK = {'default':'\n', 'win':'\r\n', 'mac':'\r'}
-
-# Platform specific settings
-LB = LINEBREAK.get(sys.platform[:3]) or LINEBREAK['default']
-
-VERSIONSTR = _("%s version %s <%s>")%(my_name,my_version,my_url)
-
-USAGE = '\n'.join([
-'',
-_("Usage: %s [OPTIONS] [infile.t2t ...]") % my_name,
-'',
-_(" --targets print a list of all the available targets and exit"),
-_(" -t, --target=TYPE set target document type. currently supported:"),
- ' %s,' % ', '.join(TARGETS[:9]),
- ' %s' % ', '.join(TARGETS[9:]),
-_(" -i, --infile=FILE set FILE as the input file name ('-' for STDIN)"),
-_(" -o, --outfile=FILE set FILE as the output file name ('-' for STDOUT)"),
-_(" --encoding=ENC set target file encoding (utf-8, iso-8859-1, etc)"),
-_(" --toc add an automatic Table of Contents to the output"),
-_(" --toc-level=N set maximum TOC level (depth) to N"),
-_(" --toc-only print the Table of Contents and exit"),
-_(" -n, --enum-title enumerate all titles as 1, 1.1, 1.1.1, etc"),
-_(" --style=FILE use FILE as the document style (like HTML CSS)"),
-_(" --css-sugar insert CSS-friendly tags for HTML/XHTML"),
-_(" --css-inside insert CSS file contents inside HTML/XHTML headers"),
-_(" -H, --no-headers suppress header and footer from the output"),
-_(" --mask-email hide email from spam robots. x@y.z turns "),
-_(" --slides format output as presentation slides (used by -t art)"),
-_(" --width=N set the output's width to N columns (used by -t art)"),
-_(" --height=N set the output's height to N rows (used by -t art)"),
-_(" -C, --config-file=F read configuration from file F"),
-_(" --gui invoke Graphical Tk Interface"),
-_(" -q, --quiet quiet mode, suppress all output (except errors)"),
-_(" -v, --verbose print informative messages during conversion"),
-_(" -h, --help print this help information and exit"),
-_(" -V, --version print program version and exit"),
-_(" --dump-config print all the configuration found and exit"),
-_(" --dump-source print the document source, with includes expanded"),
-'',
-_("Turn OFF options:"),
-" --no-css-inside, --no-css-sugar, --no-dump-config, --no-dump-source,",
-" --no-encoding, --no-enum-title, --no-headers, --no-infile,",
-" --no-mask-email, --no-outfile, --no-quiet, --no-rc, --no-slides,",
-" --no-style, --no-targets, --no-toc, --no-toc-only",
-'',
-_("Example:"),
-" %s -t html --toc %s" % (my_name, _("file.t2t")),
-'',
-_("By default, converted output is saved to 'infile.'."),
-_("Use --outfile to force an output file name."),
-_("If input file is '-', reads from STDIN."),
-_("If output file is '-', dumps output to STDOUT."),
-'',
-my_url,
-''
-])
-
-
-##############################################################################
-
-
-# Here is all the target's templates
-# You may edit them to fit your needs
-# - the %(HEADERn)s strings represent the Header lines
-# - the %(STYLE)s string is changed by --style contents
-# - the %(ENCODING)s string is changed by --encoding contents
-# - if any of the above is empty, the full line is removed
-# - use %% to represent a literal %
-#
-HEADER_TEMPLATE = {
- 'art':"""
-Fake template to respect the general process.
-""",
- 'txt': """\
-%(HEADER1)s
-%(HEADER2)s
-%(HEADER3)s
-""",
-
- 'sgml': """\
-
-
-%(HEADER1)s
-%(HEADER2)s
-%(HEADER3)s
-""",
-
- 'html': """\
-
-
-
-
-
-
-%(HEADER1)s
-
-
-%(HEADER1)s
-%(HEADER2)s
-%(HEADER3)s
-
-""",
-
- 'htmlcss': """\
-
-
-
-
-
-
-%(HEADER1)s
-
-
-
-
-""",
-
- 'xhtml': """\
-
-
-
-
-%(HEADER1)s
-
-
-
-
-
-
%(HEADER1)s
-%(HEADER2)s
-%(HEADER3)s
-
-""",
-
- 'xhtmlcss': """\
-
-
-
-
-%(HEADER1)s
-
-
-
-
-
-
-""",
-
- 'dbk': """\
-
-
-
-
- %(HEADER1)s
-
- %(HEADER2)s
-
- %(HEADER3)s
-
-""",
-
- 'man': """\
-.TH "%(HEADER1)s" 1 "%(HEADER3)s" "%(HEADER2)s"
-""",
-
-# TODO style to
- 'pm6': """\
-<@Normal=
-
-
-
-
-
-
-
-><@Bullet=<@-PARENT "Normal">
-
-><@PreFormat=<@-PARENT "Normal">
-
-><@Title1=<@-PARENT "Normal">
-
-><@Title2=<@-PARENT "Title1">
-><@Title3=<@-PARENT "Title1">
-><@Title4=<@-PARENT "Title3">
-><@Title5=<@-PARENT "Title3">
-><@Quote=<@-PARENT "Normal">>
-
-%(HEADER1)s
-%(HEADER2)s
-%(HEADER3)s
-""",
-
- 'mgp': """\
-#!/usr/X11R6/bin/mgp -t 90
-%%deffont "normal" xfont "utopia-medium-r", charset "iso8859-1"
-%%deffont "normal-i" xfont "utopia-medium-i", charset "iso8859-1"
-%%deffont "normal-b" xfont "utopia-bold-r" , charset "iso8859-1"
-%%deffont "normal-bi" xfont "utopia-bold-i" , charset "iso8859-1"
-%%deffont "mono" xfont "courier-medium-r", charset "iso8859-1"
-%%default 1 size 5
-%%default 2 size 8, fore "yellow", font "normal-b", center
-%%default 3 size 5, fore "white", font "normal", left, prefix " "
-%%tab 1 size 4, vgap 30, prefix " ", icon arc "red" 40, leftfill
-%%tab 2 prefix " ", icon arc "orange" 40, leftfill
-%%tab 3 prefix " ", icon arc "brown" 40, leftfill
-%%tab 4 prefix " ", icon arc "darkmagenta" 40, leftfill
-%%tab 5 prefix " ", icon arc "magenta" 40, leftfill
-%%%%------------------------- end of headers -----------------------------
-%%page
-
-
-
-
-
-%%size 10, center, fore "yellow"
-%(HEADER1)s
-
-%%font "normal-i", size 6, fore "white", center
-%(HEADER2)s
-
-%%font "mono", size 7, center
-%(HEADER3)s
-""",
-
- 'moin': """\
-'''%(HEADER1)s'''
-
-''%(HEADER2)s''
-
-%(HEADER3)s
-""",
-
- 'gwiki': """\
-*%(HEADER1)s*
-
-%(HEADER2)s
-
-_%(HEADER3)s_
-""",
-
- 'adoc': """\
-= %(HEADER1)s
-%(HEADER2)s
-%(HEADER3)s
-""",
-
- 'doku': """\
-===== %(HEADER1)s =====
-
-**//%(HEADER2)s//**
-
-//%(HEADER3)s//
-""",
-
- 'pmw': """\
-(:Title %(HEADER1)s:)
-
-(:Description %(HEADER2)s:)
-
-(:Summary %(HEADER3)s:)
-""",
-
- 'wiki': """\
-'''%(HEADER1)s'''
-
-%(HEADER2)s
-
-''%(HEADER3)s''
-""",
-
- 'tex': \
-r"""\documentclass{article}
-\usepackage{graphicx}
-\usepackage{paralist} %% needed for compact lists
-\usepackage[normalem]{ulem} %% needed by strike
-\usepackage[urlcolor=blue,colorlinks=true]{hyperref}
-\usepackage[%(ENCODING)s]{inputenc} %% char encoding
-\usepackage{%(STYLE)s} %% user defined
-
-\title{%(HEADER1)s}
-\author{%(HEADER2)s}
-\begin{document}
-\date{%(HEADER3)s}
-\maketitle
-\clearpage
-""",
-
- 'lout': """\
-@SysInclude { doc }
-@Document
- @InitialFont { Times Base 12p } # Times, Courier, Helvetica, ...
- @PageOrientation { Portrait } # Portrait, Landscape
- @ColumnNumber { 1 } # Number of columns (2, 3, ...)
- @PageHeaders { Simple } # None, Simple, Titles, NoTitles
- @InitialLanguage { English } # German, French, Portuguese, ...
- @OptimizePages { Yes } # Yes/No smart page break feature
-//
-@Text @Begin
-@Display @Heading { %(HEADER1)s }
-@Display @I { %(HEADER2)s }
-@Display { %(HEADER3)s }
-#@NP # Break page after Headers
-""",
- 'creole': """\
-%(HEADER1)s
-%(HEADER2)s
-%(HEADER3)s
-"""
-# @SysInclude { tbl } # Tables support
-# setup: @MakeContents { Yes } # show TOC
-# setup: @SectionGap # break page at each section
-}
-
-
-##############################################################################
-
-
-def getTags(config):
- "Returns all the known tags for the specified target"
-
- keys = """
- title1 numtitle1
- title2 numtitle2
- title3 numtitle3
- title4 numtitle4
- title5 numtitle5
- title1Open title1Close
- title2Open title2Close
- title3Open title3Close
- title4Open title4Close
- title5Open title5Close
- blocktitle1Open blocktitle1Close
- blocktitle2Open blocktitle2Close
- blocktitle3Open blocktitle3Close
-
- paragraphOpen paragraphClose
- blockVerbOpen blockVerbClose
- blockQuoteOpen blockQuoteClose blockQuoteLine
- blockCommentOpen blockCommentClose
-
- fontMonoOpen fontMonoClose
- fontBoldOpen fontBoldClose
- fontItalicOpen fontItalicClose
- fontUnderlineOpen fontUnderlineClose
- fontStrikeOpen fontStrikeClose
-
- listOpen listClose
- listOpenCompact listCloseCompact
- listItemOpen listItemClose listItemLine
- numlistOpen numlistClose
- numlistOpenCompact numlistCloseCompact
- numlistItemOpen numlistItemClose numlistItemLine
- deflistOpen deflistClose
- deflistOpenCompact deflistCloseCompact
- deflistItem1Open deflistItem1Close
- deflistItem2Open deflistItem2Close deflistItem2LinePrefix
-
- bar1 bar2
- url urlMark
- email emailMark
- img imgAlignLeft imgAlignRight imgAlignCenter
- _imgAlignLeft _imgAlignRight _imgAlignCenter
-
- tableOpen tableClose
- _tableBorder _tableAlignLeft _tableAlignCenter
- tableRowOpen tableRowClose tableRowSep
- tableTitleRowOpen tableTitleRowClose
- tableCellOpen tableCellClose tableCellSep
- tableTitleCellOpen tableTitleCellClose tableTitleCellSep
- _tableColAlignLeft _tableColAlignRight _tableColAlignCenter
- _tableCellAlignLeft _tableCellAlignRight _tableCellAlignCenter
- _tableCellColSpan tableColAlignSep
- _tableCellMulticolOpen
- _tableCellMulticolClose
-
- bodyOpen bodyClose
- cssOpen cssClose
- tocOpen tocClose TOC
- anchor
- comment
- pageBreak
- EOD
- """.split()
-
- # TIP: \a represents the current text inside the mark
- # TIP: ~A~, ~B~ and ~C~ are expanded to other tags parts
-
- alltags = {
-
- 'art': {
- 'title1' : '\a' ,
- 'title2' : '\a' ,
- 'title3' : '\a' ,
- 'title4' : '\a' ,
- 'title5' : '\a' ,
- 'blockQuoteLine' : '\t' ,
- 'listItemOpen' : '- ' ,
- 'numlistItemOpen' : '\a. ' ,
- 'bar1' : aa_line(AA['bar1'], config['width']),
- 'bar2' : aa_line(AA['bar2'], config['width']),
- 'url' : '\a' ,
- 'urlMark' : '\a (\a)' ,
- 'email' : '\a' ,
- 'emailMark' : '\a (\a)' ,
- 'img' : '[\a]' ,
- },
-
- 'txt': {
- 'title1' : ' \a' ,
- 'title2' : '\t\a' ,
- 'title3' : '\t\t\a' ,
- 'title4' : '\t\t\t\a' ,
- 'title5' : '\t\t\t\t\a',
- 'blockQuoteLine' : '\t' ,
- 'listItemOpen' : '- ' ,
- 'numlistItemOpen' : '\a. ' ,
- 'bar1' : '\a' ,
- 'url' : '\a' ,
- 'urlMark' : '\a (\a)' ,
- 'email' : '\a' ,
- 'emailMark' : '\a (\a)' ,
- 'img' : '[\a]' ,
- },
-
- 'html': {
- 'paragraphOpen' : ' ' ,
- 'paragraphClose' : '
' ,
- 'title1' : '~A~\a ' ,
- 'title2' : '~A~\a ' ,
- 'title3' : '~A~\a ' ,
- 'title4' : '~A~\a ' ,
- 'title5' : '~A~\a ' ,
- 'anchor' : ' \n',
- 'blockVerbOpen' : '' ,
- 'blockVerbClose' : ' ' ,
- 'blockQuoteOpen' : '' ,
- 'blockQuoteClose' : ' ' ,
- 'fontMonoOpen' : '' ,
- 'fontMonoClose' : '
' ,
- 'fontBoldOpen' : '' ,
- 'fontBoldClose' : ' ' ,
- 'fontItalicOpen' : '' ,
- 'fontItalicClose' : ' ' ,
- 'fontUnderlineOpen' : '' ,
- 'fontUnderlineClose' : ' ' ,
- 'fontStrikeOpen' : '' ,
- 'fontStrikeClose' : ' ' ,
- 'listOpen' : '' ,
- 'listItemOpen' : '' ,
- 'numlistOpen' : '' ,
- 'numlistClose' : ' ' ,
- 'numlistItemOpen' : ' ' ,
- 'deflistOpen' : '' ,
- 'deflistClose' : ' ' ,
- 'deflistItem1Open' : '' ,
- 'deflistItem1Close' : ' ' ,
- 'deflistItem2Open' : '' ,
- 'bar1' : ' ' ,
- 'bar2' : ' ' ,
- 'url' : '\a ' ,
- 'urlMark' : '\a ' ,
- 'email' : '\a ' ,
- 'emailMark' : '\a ' ,
- 'img' : ' ',
- '_imgAlignLeft' : ' ALIGN="left"' ,
- '_imgAlignCenter' : ' ALIGN="middle"',
- '_imgAlignRight' : ' ALIGN="right"' ,
- 'tableOpen' : '' ,
- 'tableRowOpen' : '' ,
- 'tableRowClose' : ' ' ,
- 'tableCellOpen' : '' ,
- 'tableCellClose' : ' ' ,
- 'tableTitleCellOpen' : '' ,
- 'tableTitleCellClose' : ' ' ,
- '_tableBorder' : ' BORDER="1"' ,
- '_tableAlignCenter' : ' ALIGN="center"',
- '_tableCellAlignRight' : ' ALIGN="right"' ,
- '_tableCellAlignCenter': ' ALIGN="center"',
- '_tableCellColSpan' : ' COLSPAN="\a"' ,
- 'cssOpen' : '' ,
- 'comment' : '' ,
- 'EOD' : ''
- },
-
- #TIP xhtml inherits all HTML definitions (lowercased)
- #TIP http://www.w3.org/TR/xhtml1/#guidelines
- #TIP http://www.htmlref.com/samples/Chapt17/17_08.htm
- 'xhtml': {
- 'listItemClose' : ' ' ,
- 'numlistItemClose' : '' ,
- 'deflistItem2Close' : '' ,
- 'bar1' : ' ',
- 'bar2' : ' ',
- 'anchor' : ' \n',
- 'img' : ' ',
- },
-
- 'sgml': {
- 'paragraphOpen' : '' ,
- 'title1' : '\a~A~' ,
- 'title2' : '\a~A~' ,
- 'title3' : '\a~A~' ,
- 'title4' : '\a~A~' ,
- 'title5' : '\a~A~' ,
- 'anchor' : '' ,
- 'blockVerbOpen' : '' ,
- 'blockVerbClose' : ' ' ,
- 'blockQuoteOpen' : '' ,
- 'blockQuoteClose' : '
' ,
- 'fontMonoOpen' : '' ,
- 'fontMonoClose' : ' ' ,
- 'fontBoldOpen' : '' ,
- 'fontBoldClose' : ' ' ,
- 'fontItalicOpen' : '' ,
- 'fontItalicClose' : ' ' ,
- 'fontUnderlineOpen' : '' ,
- 'fontUnderlineClose' : ' ' ,
- 'listOpen' : '' ,
- 'listClose' : ' ' ,
- 'listItemOpen' : '- ' ,
- 'numlistOpen' : '
' ,
- 'numlistClose' : ' ' ,
- 'numlistItemOpen' : '- ' ,
- 'deflistOpen' : '
' ,
- 'deflistClose' : ' ' ,
- 'deflistItem1Open' : '' ,
- 'deflistItem1Close' : ' ' ,
- 'bar1' : '' ,
- 'url' : '' ,
- 'urlMark' : '' ,
- 'email' : '' ,
- 'emailMark' : '' ,
- 'img' : ' ',
- 'tableOpen' : '' ,
- 'tableRowSep' : '' ,
- 'tableCellSep' : '' ,
- '_tableColAlignLeft' : 'l' ,
- '_tableColAlignRight' : 'r' ,
- '_tableColAlignCenter' : 'c' ,
- 'comment' : '' ,
- 'TOC' : '' ,
- 'EOD' : '
'
- },
-
- 'dbk': {
- 'paragraphOpen' : '' ,
- 'paragraphClose' : ' ' ,
- 'title1Open' : '~A~\a ' ,
- 'title1Close' : ' ' ,
- 'title2Open' : '~A~ \a ' ,
- 'title2Close' : ' ' ,
- 'title3Open' : '~A~ \a ' ,
- 'title3Close' : ' ' ,
- 'title4Open' : '~A~ \a ' ,
- 'title4Close' : ' ' ,
- 'title5Open' : '~A~ \a ',
- 'title5Close' : ' ' ,
- 'anchor' : ' \n' ,
- 'blockVerbOpen' : '' ,
- 'blockVerbClose' : ' ' ,
- 'blockQuoteOpen' : '' ,
- 'blockQuoteClose' : ' ' ,
- 'fontMonoOpen' : '' ,
- 'fontMonoClose' : '
' ,
- 'fontBoldOpen' : '' ,
- 'fontBoldClose' : ' ' ,
- 'fontItalicOpen' : '' ,
- 'fontItalicClose' : ' ' ,
- 'fontUnderlineOpen' : '' ,
- 'fontUnderlineClose' : ' ' ,
- # 'fontStrikeOpen' : '' , # Don't know
- # 'fontStrikeClose' : ' ' ,
- 'listOpen' : '' ,
- 'listClose' : ' ' ,
- 'listItemOpen' : '' ,
- 'listItemClose' : ' ' ,
- 'numlistOpen' : '' ,
- 'numlistClose' : ' ' ,
- 'numlistItemOpen' : '' ,
- 'numlistItemClose' : ' ' ,
- 'deflistOpen' : '' ,
- 'deflistClose' : ' ' ,
- 'deflistItem1Open' : '' ,
- 'deflistItem1Close' : ' ' ,
- 'deflistItem2Open' : '' ,
- 'deflistItem2Close' : ' ' ,
- # 'bar1' : '<>' , # Don't know
- # 'bar2' : '<>' , # Don't know
- 'url' : '\a ' ,
- 'urlMark' : '\a ' ,
- 'email' : '\a ' ,
- 'emailMark' : '\a ' ,
- 'img' : ' ',
- # '_imgAlignLeft' : '' , # Don't know
- # '_imgAlignCenter' : '' , # Don't know
- # '_imgAlignRight' : '' , # Don't know
- # 'tableOpen' : '', # Don't work, need to know number of cols
- # 'tableClose' : ' ' ,
- # 'tableRowOpen' : '' ,
- # 'tableRowClose' : '
' ,
- # 'tableCellOpen' : '' ,
- # 'tableCellClose' : ' ' ,
- # 'tableTitleRowOpen' : '' ,
- # 'tableTitleRowClose' : ' ' ,
- # '_tableBorder' : ' frame="all"' ,
- # '_tableAlignCenter' : ' align="center"' ,
- # '_tableCellAlignRight' : ' align="right"' ,
- # '_tableCellAlignCenter': ' align="center"' ,
- # '_tableCellColSpan' : ' COLSPAN="\a"' ,
- 'TOC' : ' ' ,
- 'comment' : '' ,
- 'EOD' : ' '
- },
-
- 'tex': {
- 'title1' : '~A~\section*{\a}' ,
- 'title2' : '~A~\\subsection*{\a}' ,
- 'title3' : '~A~\\subsubsection*{\a}',
- # title 4/5: DIRTY: para+BF+\\+\n
- 'title4' : '~A~\\paragraph{}\\textbf{\a}\\\\\n',
- 'title5' : '~A~\\paragraph{}\\textbf{\a}\\\\\n',
- 'numtitle1' : '\n~A~\section{\a}' ,
- 'numtitle2' : '~A~\\subsection{\a}' ,
- 'numtitle3' : '~A~\\subsubsection{\a}' ,
- 'anchor' : '\\hypertarget{\a}{}\n' ,
- 'blockVerbOpen' : '\\begin{verbatim}' ,
- 'blockVerbClose' : '\\end{verbatim}' ,
- 'blockQuoteOpen' : '\\begin{quotation}' ,
- 'blockQuoteClose' : '\\end{quotation}' ,
- 'fontMonoOpen' : '\\texttt{' ,
- 'fontMonoClose' : '}' ,
- 'fontBoldOpen' : '\\textbf{' ,
- 'fontBoldClose' : '}' ,
- 'fontItalicOpen' : '\\textit{' ,
- 'fontItalicClose' : '}' ,
- 'fontUnderlineOpen' : '\\underline{' ,
- 'fontUnderlineClose' : '}' ,
- 'fontStrikeOpen' : '\\sout{' ,
- 'fontStrikeClose' : '}' ,
- 'listOpen' : '\\begin{itemize}' ,
- 'listClose' : '\\end{itemize}' ,
- 'listOpenCompact' : '\\begin{compactitem}',
- 'listCloseCompact' : '\\end{compactitem}' ,
- 'listItemOpen' : '\\item ' ,
- 'numlistOpen' : '\\begin{enumerate}' ,
- 'numlistClose' : '\\end{enumerate}' ,
- 'numlistOpenCompact' : '\\begin{compactenum}',
- 'numlistCloseCompact' : '\\end{compactenum}' ,
- 'numlistItemOpen' : '\\item ' ,
- 'deflistOpen' : '\\begin{description}',
- 'deflistClose' : '\\end{description}' ,
- 'deflistOpenCompact' : '\\begin{compactdesc}',
- 'deflistCloseCompact' : '\\end{compactdesc}' ,
- 'deflistItem1Open' : '\\item[' ,
- 'deflistItem1Close' : ']' ,
- 'bar1' : '\\hrulefill{}' ,
- 'bar2' : '\\rule{\linewidth}{1mm}',
- 'url' : '\\htmladdnormallink{\a}{\a}',
- 'urlMark' : '\\htmladdnormallink{\a}{\a}',
- 'email' : '\\htmladdnormallink{\a}{mailto:\a}',
- 'emailMark' : '\\htmladdnormallink{\a}{mailto:\a}',
- 'img' : '\\includegraphics{\a}',
- 'tableOpen' : '\\begin{center}\\begin{tabular}{|~C~|}',
- 'tableClose' : '\\end{tabular}\\end{center}',
- 'tableRowOpen' : '\\hline ' ,
- 'tableRowClose' : ' \\\\' ,
- 'tableCellSep' : ' & ' ,
- '_tableColAlignLeft' : 'l' ,
- '_tableColAlignRight' : 'r' ,
- '_tableColAlignCenter' : 'c' ,
- '_tableCellAlignLeft' : 'l' ,
- '_tableCellAlignRight' : 'r' ,
- '_tableCellAlignCenter': 'c' ,
- '_tableCellColSpan' : '\a' ,
- '_tableCellMulticolOpen' : '\\multicolumn{\a}{|~C~|}{',
- '_tableCellMulticolClose' : '}',
- 'tableColAlignSep' : '|' ,
- 'comment' : '% \a' ,
- 'TOC' : '\\tableofcontents',
- 'pageBreak' : '\\clearpage',
- 'EOD' : '\\end{document}'
- },
-
- 'lout': {
- 'paragraphOpen' : '@LP' ,
- 'blockTitle1Open' : '@BeginSections' ,
- 'blockTitle1Close' : '@EndSections' ,
- 'blockTitle2Open' : ' @BeginSubSections' ,
- 'blockTitle2Close' : ' @EndSubSections' ,
- 'blockTitle3Open' : ' @BeginSubSubSections' ,
- 'blockTitle3Close' : ' @EndSubSubSections' ,
- 'title1Open' : '~A~@Section @Title { \a } @Begin',
- 'title1Close' : '@End @Section' ,
- 'title2Open' : '~A~ @SubSection @Title { \a } @Begin',
- 'title2Close' : ' @End @SubSection' ,
- 'title3Open' : '~A~ @SubSubSection @Title { \a } @Begin',
- 'title3Close' : ' @End @SubSubSection' ,
- 'title4Open' : '~A~@LP @LeftDisplay @B { \a }',
- 'title5Open' : '~A~@LP @LeftDisplay @B { \a }',
- 'anchor' : '@Tag { \a }\n' ,
- 'blockVerbOpen' : '@LP @ID @F @RawVerbatim @Begin',
- 'blockVerbClose' : '@End @RawVerbatim' ,
- 'blockQuoteOpen' : '@QD {' ,
- 'blockQuoteClose' : '}' ,
- # enclosed inside {} to deal with joined**words**
- 'fontMonoOpen' : '{@F {' ,
- 'fontMonoClose' : '}}' ,
- 'fontBoldOpen' : '{@B {' ,
- 'fontBoldClose' : '}}' ,
- 'fontItalicOpen' : '{@II {' ,
- 'fontItalicClose' : '}}' ,
- 'fontUnderlineOpen' : '{@Underline{' ,
- 'fontUnderlineClose' : '}}' ,
- # the full form is more readable, but could be BL EL LI NL TL DTI
- 'listOpen' : '@BulletList' ,
- 'listClose' : '@EndList' ,
- 'listItemOpen' : '@ListItem{' ,
- 'listItemClose' : '}' ,
- 'numlistOpen' : '@NumberedList' ,
- 'numlistClose' : '@EndList' ,
- 'numlistItemOpen' : '@ListItem{' ,
- 'numlistItemClose' : '}' ,
- 'deflistOpen' : '@TaggedList' ,
- 'deflistClose' : '@EndList' ,
- 'deflistItem1Open' : '@DropTagItem {' ,
- 'deflistItem1Close' : '}' ,
- 'deflistItem2Open' : '{' ,
- 'deflistItem2Close' : '}' ,
- 'bar1' : '@DP @FullWidthRule' ,
- 'url' : '{blue @Colour { \a }}' ,
- 'urlMark' : '\a ({blue @Colour { \a }})' ,
- 'email' : '{blue @Colour { \a }}' ,
- 'emailMark' : '\a ({blue Colour{ \a }})' ,
- 'img' : '~A~@IncludeGraphic { \a }' , # eps only!
- '_imgAlignLeft' : '@LeftDisplay ' ,
- '_imgAlignRight' : '@RightDisplay ' ,
- '_imgAlignCenter' : '@CentredDisplay ' ,
- # lout tables are *way* complicated, no support for now
- #'tableOpen' : '~A~@Tbl~B~\naformat{ @Cell A | @Cell B } {',
- #'tableClose' : '}' ,
- #'tableRowOpen' : '@Rowa\n' ,
- #'tableTitleRowOpen' : '@HeaderRowa' ,
- #'tableCenterAlign' : '@CentredDisplay ' ,
- #'tableCellOpen' : '\a {' , # A, B, ...
- #'tableCellClose' : '}' ,
- #'_tableBorder' : '\nrule {yes}' ,
- 'comment' : '# \a' ,
- # @MakeContents must be on the config file
- 'TOC' : '@DP @ContentsGoesHere @DP',
- 'pageBreak' : '@NP' ,
- 'EOD' : '@End @Text'
- },
-
- # http://moinmo.in/SyntaxReference
- 'moin': {
- 'title1' : '= \a =' ,
- 'title2' : '== \a ==' ,
- 'title3' : '=== \a ===' ,
- 'title4' : '==== \a ====' ,
- 'title5' : '===== \a =====',
- 'blockVerbOpen' : '{{{' ,
- 'blockVerbClose' : '}}}' ,
- 'blockQuoteLine' : ' ' ,
- 'fontMonoOpen' : '{{{' ,
- 'fontMonoClose' : '}}}' ,
- 'fontBoldOpen' : "'''" ,
- 'fontBoldClose' : "'''" ,
- 'fontItalicOpen' : "''" ,
- 'fontItalicClose' : "''" ,
- 'fontUnderlineOpen' : '__' ,
- 'fontUnderlineClose' : '__' ,
- 'fontStrikeOpen' : '--(' ,
- 'fontStrikeClose' : ')--' ,
- 'listItemOpen' : ' * ' ,
- 'numlistItemOpen' : ' \a. ' ,
- 'deflistItem1Open' : ' ' ,
- 'deflistItem1Close' : '::' ,
- 'deflistItem2LinePrefix': ' :: ' ,
- 'bar1' : '----' ,
- 'bar2' : '--------' ,
- 'url' : '[\a]' ,
- 'urlMark' : '[\a \a]' ,
- 'email' : '[\a]' ,
- 'emailMark' : '[\a \a]' ,
- 'img' : '[\a]' ,
- 'tableRowOpen' : '||' ,
- 'tableCellOpen' : '~A~' ,
- 'tableCellClose' : '||' ,
- 'tableTitleCellClose' : '||' ,
- '_tableCellAlignRight' : '<)>' ,
- '_tableCellAlignCenter' : '<:>' ,
- 'comment' : '/* \a */' ,
- 'TOC' : '[[TableOfContents]]'
- },
-
- # http://code.google.com/p/support/wiki/WikiSyntax
- 'gwiki': {
- 'title1' : '= \a =' ,
- 'title2' : '== \a ==' ,
- 'title3' : '=== \a ===' ,
- 'title4' : '==== \a ====' ,
- 'title5' : '===== \a =====',
- 'blockVerbOpen' : '{{{' ,
- 'blockVerbClose' : '}}}' ,
- 'blockQuoteLine' : ' ' ,
- 'fontMonoOpen' : '{{{' ,
- 'fontMonoClose' : '}}}' ,
- 'fontBoldOpen' : '*' ,
- 'fontBoldClose' : '*' ,
- 'fontItalicOpen' : '_' , # underline == italic
- 'fontItalicClose' : '_' ,
- 'fontStrikeOpen' : '~~' ,
- 'fontStrikeClose' : '~~' ,
- 'listItemOpen' : ' * ' ,
- 'numlistItemOpen' : ' # ' ,
- 'url' : '\a' ,
- 'urlMark' : '[\a \a]' ,
- 'email' : 'mailto:\a' ,
- 'emailMark' : '[mailto:\a \a]',
- 'img' : '[\a]' ,
- 'tableRowOpen' : '|| ' ,
- 'tableRowClose' : ' ||' ,
- 'tableCellSep' : ' || ' ,
- },
-
- # http://powerman.name/doc/asciidoc
- 'adoc': {
- 'title1' : '== \a' ,
- 'title2' : '=== \a' ,
- 'title3' : '==== \a' ,
- 'title4' : '===== \a' ,
- 'title5' : '===== \a' ,
- 'blockVerbOpen' : '----' ,
- 'blockVerbClose' : '----' ,
- 'fontMonoOpen' : '+' ,
- 'fontMonoClose' : '+' ,
- 'fontBoldOpen' : '*' ,
- 'fontBoldClose' : '*' ,
- 'fontItalicOpen' : '_' ,
- 'fontItalicClose' : '_' ,
- 'listItemOpen' : '- ' ,
- 'listItemLine' : '\t' ,
- 'numlistItemOpen' : '. ' ,
- 'url' : '\a' ,
- 'urlMark' : '\a[\a]' ,
- 'email' : 'mailto:\a' ,
- 'emailMark' : 'mailto:\a[\a]' ,
- 'img' : 'image::\a[]' ,
- },
-
- # http://wiki.splitbrain.org/wiki:syntax
- # Hint: is \\ $
- # Hint: You can add footnotes ((This is a footnote))
- 'doku': {
- 'title1' : '===== \a =====',
- 'title2' : '==== \a ====' ,
- 'title3' : '=== \a ===' ,
- 'title4' : '== \a ==' ,
- 'title5' : '= \a =' ,
- # DokuWiki uses ' ' identation to mark verb blocks (see indentverbblock)
- 'blockQuoteLine' : '>' ,
- 'fontMonoOpen' : "''" ,
- 'fontMonoClose' : "''" ,
- 'fontBoldOpen' : "**" ,
- 'fontBoldClose' : "**" ,
- 'fontItalicOpen' : "//" ,
- 'fontItalicClose' : "//" ,
- 'fontUnderlineOpen' : "__" ,
- 'fontUnderlineClose' : "__" ,
- 'fontStrikeOpen' : '' ,
- 'fontStrikeClose' : '' ,
- 'listItemOpen' : ' * ' ,
- 'numlistItemOpen' : ' - ' ,
- 'bar1' : '----' ,
- 'url' : '[[\a]]' ,
- 'urlMark' : '[[\a|\a]]' ,
- 'email' : '[[\a]]' ,
- 'emailMark' : '[[\a|\a]]' ,
- 'img' : '{{\a}}' ,
- 'imgAlignLeft' : '{{\a }}' ,
- 'imgAlignRight' : '{{ \a}}' ,
- 'imgAlignCenter' : '{{ \a }}' ,
- 'tableTitleRowOpen' : '^ ' ,
- 'tableTitleRowClose' : ' ^' ,
- 'tableTitleCellSep' : ' ^ ' ,
- 'tableRowOpen' : '| ' ,
- 'tableRowClose' : ' |' ,
- 'tableCellSep' : ' | ' ,
- # DokuWiki has no attributes. The content must be aligned!
- # '_tableCellAlignRight' : '<)>' , # ??
- # '_tableCellAlignCenter': '<:>' , # ??
- # DokuWiki colspan is the same as txt2tags' with multiple |||
- # 'comment' : '## \a' , # ??
- # TOC is automatic
- },
-
- # http://www.pmwiki.org/wiki/PmWiki/TextFormattingRules
- 'pmw': {
- 'title1' : '~A~! \a ' ,
- 'title2' : '~A~!! \a ' ,
- 'title3' : '~A~!!! \a ' ,
- 'title4' : '~A~!!!! \a ' ,
- 'title5' : '~A~!!!!! \a ' ,
- 'blockQuoteOpen' : '->' ,
- 'blockQuoteClose' : '\n' ,
- # In-text font
- 'fontLargeOpen' : "[+" ,
- 'fontLargeClose' : "+]" ,
- 'fontLargerOpen' : "[++" ,
- 'fontLargerClose' : "++]" ,
- 'fontSmallOpen' : "[-" ,
- 'fontSmallClose' : "-]" ,
- 'fontLargerOpen' : "[--" ,
- 'fontLargerClose' : "--]" ,
- 'fontMonoOpen' : "@@" ,
- 'fontMonoClose' : "@@" ,
- 'fontBoldOpen' : "'''" ,
- 'fontBoldClose' : "'''" ,
- 'fontItalicOpen' : "''" ,
- 'fontItalicClose' : "''" ,
- 'fontUnderlineOpen' : "{+" ,
- 'fontUnderlineClose' : "+}" ,
- 'fontStrikeOpen' : '{-' ,
- 'fontStrikeClose' : '-}' ,
- # Lists
- 'listItemLine' : '*' ,
- 'numlistItemLine' : '#' ,
- 'deflistItem1Open' : ': ' ,
- 'deflistItem1Close' : ':' ,
- 'deflistItem2LineOpen' : '::' ,
- 'deflistItem2LineClose' : ':' ,
- # Verbatim block
- 'blockVerbOpen' : '[@' ,
- 'blockVerbClose' : '@]' ,
- 'bar1' : '----' ,
- # URL, email and anchor
- 'url' : '\a' ,
- 'urlMark' : '[[\a -> \a]]' ,
- 'email' : '\a' ,
- 'emailMark' : '[[\a -> mailto:\a]]',
- 'anchor' : '[[#\a]]\n' ,
- # Image markup
- 'img' : '\a' ,
- #'imgAlignLeft' : '{{\a }}' ,
- #'imgAlignRight' : '{{ \a}}' ,
- #'imgAlignCenter' : '{{ \a }}' ,
- # Table attributes
- 'tableTitleRowOpen' : '||! ' ,
- 'tableTitleRowClose' : '||' ,
- 'tableTitleCellSep' : ' ||!' ,
- 'tableRowOpen' : '||' ,
- 'tableRowClose' : '||' ,
- 'tableCellSep' : ' ||' ,
- },
-
- # http://en.wikipedia.org/wiki/Help:Editing
- 'wiki': {
- 'title1' : '== \a ==' ,
- 'title2' : '=== \a ===' ,
- 'title3' : '==== \a ====' ,
- 'title4' : '===== \a =====' ,
- 'title5' : '====== \a ======',
- 'blockVerbOpen' : '' ,
- 'blockVerbClose' : ' ' ,
- 'blockQuoteOpen' : '' ,
- 'blockQuoteClose' : ' ' ,
- 'fontMonoOpen' : '' ,
- 'fontMonoClose' : ' ' ,
- 'fontBoldOpen' : "'''" ,
- 'fontBoldClose' : "'''" ,
- 'fontItalicOpen' : "''" ,
- 'fontItalicClose' : "''" ,
- 'fontUnderlineOpen' : '' ,
- 'fontUnderlineClose' : ' ' ,
- 'fontStrikeOpen' : '' ,
- 'fontStrikeClose' : ' ' ,
- #XXX Mixed lists not working: *#* list inside numlist inside list
- 'listItemLine' : '*' ,
- 'numlistItemLine' : '#' ,
- 'deflistItem1Open' : '; ' ,
- 'deflistItem2LinePrefix': ': ' ,
- 'bar1' : '----' ,
- 'url' : '[\a]' ,
- 'urlMark' : '[\a \a]' ,
- 'email' : 'mailto:\a' ,
- 'emailMark' : '[mailto:\a \a]' ,
- # [[Image:foo.png|right|Optional alt/caption text]] (right, left, center, none)
- 'img' : '[[Image:\a~A~]]' ,
- '_imgAlignLeft' : '|left' ,
- '_imgAlignCenter' : '|center' ,
- '_imgAlignRight' : '|right' ,
- # {| border="1" cellspacing="0" cellpadding="4" align="center"
- 'tableOpen' : '{|~A~~B~ cellpadding="4"',
- 'tableClose' : '|}' ,
- 'tableRowOpen' : '|-\n| ' ,
- 'tableTitleRowOpen' : '|-\n! ' ,
- 'tableCellSep' : ' || ' ,
- 'tableTitleCellSep' : ' !! ' ,
- '_tableBorder' : ' border="1"' ,
- '_tableAlignCenter' : ' align="center"' ,
- 'comment' : '' ,
- 'TOC' : '__TOC__' ,
- },
-
- # http://www.inference.phy.cam.ac.uk/mackay/mgp/SYNTAX
- # http://en.wikipedia.org/wiki/MagicPoint
- 'mgp': {
- 'paragraphOpen' : '%font "normal", size 5' ,
- 'title1' : '%page\n\n\a\n' ,
- 'title2' : '%page\n\n\a\n' ,
- 'title3' : '%page\n\n\a\n' ,
- 'title4' : '%page\n\n\a\n' ,
- 'title5' : '%page\n\n\a\n' ,
- 'blockVerbOpen' : '%font "mono"' ,
- 'blockVerbClose' : '%font "normal"' ,
- 'blockQuoteOpen' : '%prefix " "' ,
- 'blockQuoteClose' : '%prefix " "' ,
- 'fontMonoOpen' : '\n%cont, font "mono"\n' ,
- 'fontMonoClose' : '\n%cont, font "normal"\n' ,
- 'fontBoldOpen' : '\n%cont, font "normal-b"\n' ,
- 'fontBoldClose' : '\n%cont, font "normal"\n' ,
- 'fontItalicOpen' : '\n%cont, font "normal-i"\n' ,
- 'fontItalicClose' : '\n%cont, font "normal"\n' ,
- 'fontUnderlineOpen' : '\n%cont, fore "cyan"\n' ,
- 'fontUnderlineClose' : '\n%cont, fore "white"\n' ,
- 'listItemLine' : '\t' ,
- 'numlistItemLine' : '\t' ,
- 'numlistItemOpen' : '\a. ' ,
- 'deflistItem1Open' : '\t\n%cont, font "normal-b"\n',
- 'deflistItem1Close' : '\n%cont, font "normal"\n' ,
- 'bar1' : '%bar "white" 5' ,
- 'bar2' : '%pause' ,
- 'url' : '\n%cont, fore "cyan"\n\a' +\
- '\n%cont, fore "white"\n' ,
- 'urlMark' : '\a \n%cont, fore "cyan"\n\a'+\
- '\n%cont, fore "white"\n' ,
- 'email' : '\n%cont, fore "cyan"\n\a' +\
- '\n%cont, fore "white"\n' ,
- 'emailMark' : '\a \n%cont, fore "cyan"\n\a'+\
- '\n%cont, fore "white"\n' ,
- 'img' : '~A~\n%newimage "\a"\n%left\n',
- '_imgAlignLeft' : '\n%left' ,
- '_imgAlignRight' : '\n%right' ,
- '_imgAlignCenter' : '\n%center' ,
- 'comment' : '%% \a' ,
- 'pageBreak' : '%page\n\n\n' ,
- 'EOD' : '%%EOD'
- },
-
- # man groff_man ; man 7 groff
- 'man': {
- 'paragraphOpen' : '.P' ,
- 'title1' : '.SH \a' ,
- 'title2' : '.SS \a' ,
- 'title3' : '.SS \a' ,
- 'title4' : '.SS \a' ,
- 'title5' : '.SS \a' ,
- 'blockVerbOpen' : '.nf' ,
- 'blockVerbClose' : '.fi\n' ,
- 'blockQuoteOpen' : '.RS' ,
- 'blockQuoteClose' : '.RE' ,
- 'fontBoldOpen' : '\\fB' ,
- 'fontBoldClose' : '\\fR' ,
- 'fontItalicOpen' : '\\fI' ,
- 'fontItalicClose' : '\\fR' ,
- 'listOpen' : '.RS' ,
- 'listItemOpen' : '.IP \(bu 3\n',
- 'listClose' : '.RE' ,
- 'numlistOpen' : '.RS' ,
- 'numlistItemOpen' : '.IP \a. 3\n',
- 'numlistClose' : '.RE' ,
- 'deflistItem1Open' : '.TP\n' ,
- 'bar1' : '\n\n' ,
- 'url' : '\a' ,
- 'urlMark' : '\a (\a)',
- 'email' : '\a' ,
- 'emailMark' : '\a (\a)',
- 'img' : '\a' ,
- 'tableOpen' : '.TS\n~A~~B~tab(^); ~C~.',
- 'tableClose' : '.TE' ,
- 'tableRowOpen' : ' ' ,
- 'tableCellSep' : '^' ,
- '_tableAlignCenter' : 'center, ',
- '_tableBorder' : 'allbox, ',
- '_tableColAlignLeft' : 'l' ,
- '_tableColAlignRight' : 'r' ,
- '_tableColAlignCenter' : 'c' ,
- 'comment' : '.\\" \a'
- },
-
- 'pm6': {
- 'paragraphOpen' : '<@Normal:>' ,
- 'title1' : '<@Title1:>\a',
- 'title2' : '<@Title2:>\a',
- 'title3' : '<@Title3:>\a',
- 'title4' : '<@Title4:>\a',
- 'title5' : '<@Title5:>\a',
- 'blockVerbOpen' : '<@PreFormat:>' ,
- 'blockQuoteLine' : '<@Quote:>' ,
- 'fontMonoOpen' : '' ,
- 'fontMonoClose' : '',
- 'fontBoldOpen' : '' ,
- 'fontBoldClose' : ' ' ,
- 'fontItalicOpen' : '' ,
- 'fontItalicClose' : '
' ,
- 'fontUnderlineOpen' : '' ,
- 'fontUnderlineClose' : '
' ,
- 'listOpen' : '<@Bullet:>' ,
- 'listItemOpen' : '*\t' , # \x95 == ~U -> changed to "*"
- 'numlistOpen' : '<@Bullet:>' ,
- 'numlistItemOpen' : '*\t' ,
- 'bar1' : '\a' ,
- 'url' : '\a
' , # underline
- 'urlMark' : '\a \a
' ,
- 'email' : '\a' ,
- 'emailMark' : '\a \a' ,
- 'img' : '\a'
- },
- # http://www.wikicreole.org/wiki/AllMarkup
- 'creole': {
- 'title1' : '= \a =' ,
- 'title2' : '== \a ==' ,
- 'title3' : '=== \a ===' ,
- 'title4' : '==== \a ====' ,
- 'title5' : '===== \a =====',
- 'blockVerbOpen' : '{{{' ,
- 'blockVerbClose' : '}}}' ,
- 'blockQuoteLine' : ' ' ,
- # 'fontMonoOpen' : '##' , # planned for 2.0,
- # 'fontMonoClose' : '##' , # meanwhile we disable it
- 'fontBoldOpen' : '**' ,
- 'fontBoldClose' : '**' ,
- 'fontItalicOpen' : '//' ,
- 'fontItalicClose' : '//' ,
- 'fontUnderlineOpen' : '//' , # no underline in 1.0, planned for 2.0,
- 'fontUnderlineClose' : '//' , # meanwhile we can use italic (emphasized)
- # 'fontStrikeOpen' : '--' , # planned for 2.0,
- # 'fontStrikeClose' : '--' , # meanwhile we disable it
- 'listItemLine' : '*' ,
- 'numlistItemLine' : '#' ,
- 'deflistItem2LinePrefix': ':' ,
- 'bar1' : '----' ,
- 'url' : '[[\a]]' ,
- 'urlMark' : '[[\a|\a]]' ,
- 'img' : '{{\a}}' ,
- 'tableTitleRowOpen' : '|= ' ,
- 'tableTitleRowClose' : '|' ,
- 'tableTitleCellSep' : ' |= ' ,
- 'tableRowOpen' : '| ' ,
- 'tableRowClose' : ' |' ,
- 'tableCellSep' : ' | ' ,
- # TODO: placeholder (mark for unknown syntax)
- # if possible: http://www.wikicreole.org/wiki/Placeholder
- }
- }
-
- # Exceptions for --css-sugar
- if config['css-sugar'] and config['target'] in ('html','xhtml'):
- # Change just HTML because XHTML inherits it
- htmltags = alltags['html']
- # Table with no cellpadding
- htmltags['tableOpen'] = htmltags['tableOpen'].replace(' CELLPADDING="4"', '')
- # DIVs
- htmltags['tocOpen' ] = '
'
- htmltags['tocClose'] = '
'
- htmltags['bodyOpen'] = ''
- htmltags['bodyClose']= '
'
-
- # Make the HTML -> XHTML inheritance
- xhtml = alltags['html'].copy()
- for key in xhtml.keys(): xhtml[key] = xhtml[key].lower()
- # Some like HTML tags as lowercase, some don't... (headers out)
- if HTML_LOWER: alltags['html'] = xhtml.copy()
- xhtml.update(alltags['xhtml'])
- alltags['xhtml'] = xhtml.copy()
-
- # Compose the target tags dictionary
- tags = {}
- target_tags = alltags[config['target']].copy()
-
- for key in keys: tags[key] = '' # create empty keys
- for key in target_tags.keys():
- tags[key] = maskEscapeChar(target_tags[key]) # populate
-
- # Map strong line to pagebreak
- if rules['mapbar2pagebreak'] and tags['pageBreak']:
- tags['bar2'] = tags['pageBreak']
-
- # Map strong line to separator if not defined
- if not tags['bar2'] and tags['bar1']:
- tags['bar2'] = tags['bar1']
-
- return tags
-
-
-##############################################################################
-
-
-def getRules(config):
- "Returns all the target-specific syntax rules"
-
- ret = {}
- allrules = [
-
- # target rules (ON/OFF)
- 'linkable', # target supports external links
- 'tableable', # target supports tables
- 'imglinkable', # target supports images as links
- 'imgalignable', # target supports image alignment
- 'imgasdefterm', # target supports image as definition term
- 'autonumberlist', # target supports numbered lists natively
- 'autonumbertitle', # target supports numbered titles natively
- 'stylable', # target supports external style files
- 'parainsidelist', # lists items supports paragraph
- 'compactlist', # separate enclosing tags for compact lists
- 'spacedlistitem', # lists support blank lines between items
- 'listnotnested', # lists cannot be nested
- 'quotenotnested', # quotes cannot be nested
- 'verbblocknotescaped', # don't escape specials in verb block
- 'verbblockfinalescape', # do final escapes in verb block
- 'escapeurl', # escape special in link URL
- 'labelbeforelink', # label comes before the link on the tag
- 'onelinepara', # dump paragraph as a single long line
- 'tabletitlerowinbold', # manually bold any cell on table titles
- 'tablecellstrip', # strip extra spaces from each table cell
- 'tablecellspannable', # the table cells can have span attribute
- 'tablecellmulticol', # separate open+close tags for multicol cells
- 'barinsidequote', # bars are allowed inside quote blocks
- 'finalescapetitle', # perform final escapes on title lines
- 'autotocnewpagebefore', # break page before automatic TOC
- 'autotocnewpageafter', # break page after automatic TOC
- 'autotocwithbars', # automatic TOC surrounded by bars
- 'mapbar2pagebreak', # map the strong bar to a page break
- 'titleblocks', # titles must be on open/close section blocks
-
- # Target code beautify (ON/OFF)
- 'indentverbblock', # add leading spaces to verb block lines
- 'breaktablecell', # break lines after any table cell
- 'breaktablelineopen', # break line after opening table line
- 'notbreaklistopen', # don't break line after opening a new list
- 'keepquoteindent', # don't remove the leading TABs on quotes
- 'keeplistindent', # don't remove the leading spaces on lists
- 'blankendautotoc', # append a blank line at the auto TOC end
- 'tagnotindentable', # tags must be placed at the line beginning
- 'spacedlistitemopen', # append a space after the list item open tag
- 'spacednumlistitemopen',# append a space after the numlist item open tag
- 'deflisttextstrip', # strip the contents of the deflist text
- 'blanksaroundpara', # put a blank line before and after paragraphs
- 'blanksaroundverb', # put a blank line before and after verb blocks
- 'blanksaroundquote', # put a blank line before and after quotes
- 'blanksaroundlist', # put a blank line before and after lists
- 'blanksaroundnumlist', # put a blank line before and after numlists
- 'blanksarounddeflist', # put a blank line before and after deflists
- 'blanksaroundtable', # put a blank line before and after tables
- 'blanksaroundbar', # put a blank line before and after bars
- 'blanksaroundtitle', # put a blank line before and after titles
- 'blanksaroundnumtitle', # put a blank line before and after numtitles
-
- # Value settings
- 'listmaxdepth', # maximum depth for lists
- 'quotemaxdepth', # maximum depth for quotes
- 'tablecellaligntype', # type of table cell align: cell, column
- ]
-
- rules_bank = {
- 'txt': {
- 'indentverbblock':1,
- 'spacedlistitem':1,
- 'parainsidelist':1,
- 'keeplistindent':1,
- 'barinsidequote':1,
- 'autotocwithbars':1,
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'art': {
- #TIP art inherits all TXT rules
- },
- 'html': {
- 'indentverbblock':1,
- 'linkable':1,
- 'stylable':1,
- 'escapeurl':1,
- 'imglinkable':1,
- 'imgalignable':1,
- 'imgasdefterm':1,
- 'autonumberlist':1,
- 'spacedlistitem':1,
- 'parainsidelist':1,
- 'tableable':1,
- 'tablecellstrip':1,
- 'breaktablecell':1,
- 'breaktablelineopen':1,
- 'keeplistindent':1,
- 'keepquoteindent':1,
- 'barinsidequote':1,
- 'autotocwithbars':1,
- 'tablecellspannable':1,
- 'tablecellaligntype':'cell',
-
- # 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- # 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'xhtml': {
- #TIP xhtml inherits all HTML rules
- },
- 'sgml': {
- 'linkable':1,
- 'escapeurl':1,
- 'autonumberlist':1,
- 'spacedlistitem':1,
- 'tableable':1,
- 'tablecellstrip':1,
- 'blankendautotoc':1,
- 'quotenotnested':1,
- 'keeplistindent':1,
- 'keepquoteindent':1,
- 'barinsidequote':1,
- 'finalescapetitle':1,
- 'tablecellaligntype':'column',
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'dbk': {
- 'linkable':1,
- 'tableable':0, # activate when table tags are ready
- 'imglinkable':1,
- 'imgalignable':1,
- 'imgasdefterm':1,
- 'autonumberlist':1,
- 'autonumbertitle':1,
- 'parainsidelist':1,
- 'spacedlistitem':1,
- 'titleblocks':1,
- },
- 'mgp': {
- 'tagnotindentable':1,
- 'spacedlistitem':1,
- 'imgalignable':1,
- 'autotocnewpagebefore':1,
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- # 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- 'blanksaroundbar':1,
- # 'blanksaroundtitle':1,
- # 'blanksaroundnumtitle':1,
- },
- 'tex': {
- 'stylable':1,
- 'escapeurl':1,
- 'autonumberlist':1,
- 'autonumbertitle':1,
- 'spacedlistitem':1,
- 'compactlist':1,
- 'parainsidelist':1,
- 'tableable':1,
- 'tablecellstrip':1,
- 'tabletitlerowinbold':1,
- 'verbblocknotescaped':1,
- 'keeplistindent':1,
- 'listmaxdepth':4, # deflist is 6
- 'quotemaxdepth':6,
- 'barinsidequote':1,
- 'finalescapetitle':1,
- 'autotocnewpageafter':1,
- 'mapbar2pagebreak':1,
- 'tablecellaligntype':'column',
- 'tablecellmulticol':1,
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- # 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'lout': {
- 'keepquoteindent':1,
- 'deflisttextstrip':1,
- 'escapeurl':1,
- 'verbblocknotescaped':1,
- 'imgalignable':1,
- 'mapbar2pagebreak':1,
- 'titleblocks':1,
- 'autonumberlist':1,
- 'parainsidelist':1,
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- # 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'moin': {
- 'spacedlistitem':1,
- 'linkable':1,
- 'keeplistindent':1,
- 'tableable':1,
- 'barinsidequote':1,
- 'tabletitlerowinbold':1,
- 'tablecellstrip':1,
- 'autotocwithbars':1,
- 'tablecellaligntype':'cell',
- 'deflisttextstrip':1,
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- # 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- # 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'gwiki': {
- 'spacedlistitem':1,
- 'linkable':1,
- 'keeplistindent':1,
- 'tableable':1,
- 'tabletitlerowinbold':1,
- 'tablecellstrip':1,
- 'autonumberlist':1,
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- # 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- # 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'adoc': {
- 'spacedlistitem':1,
- 'linkable':1,
- 'keeplistindent':1,
- 'autonumberlist':1,
- 'autonumbertitle':1,
- 'listnotnested':1,
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'doku': {
- 'indentverbblock':1, # DokuWiki uses ' ' to mark verb blocks
- 'spacedlistitem':1,
- 'linkable':1,
- 'keeplistindent':1,
- 'tableable':1,
- 'barinsidequote':1,
- 'tablecellstrip':1,
- 'autotocwithbars':1,
- 'autonumberlist':1,
- 'imgalignable':1,
- 'tablecellaligntype':'cell',
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- # 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'pmw': {
- 'indentverbblock':1,
- 'spacedlistitem':1,
- 'linkable':1,
- 'labelbeforelink':1,
- # 'keeplistindent':1,
- 'tableable':1,
- 'barinsidequote':1,
- 'tablecellstrip':1,
- 'autotocwithbars':1,
- 'autonumberlist':1,
- 'spacedlistitemopen':1,
- 'spacednumlistitemopen':1,
- 'imgalignable':1,
- 'tabletitlerowinbold':1,
- 'tablecellaligntype':'cell',
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'wiki': {
- 'linkable':1,
- 'tableable':1,
- 'tablecellstrip':1,
- 'autotocwithbars':1,
- 'spacedlistitemopen':1,
- 'spacednumlistitemopen':1,
- 'deflisttextstrip':1,
- 'autonumberlist':1,
- 'imgalignable':1,
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- # 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'man': {
- 'spacedlistitem':1,
- 'tagnotindentable':1,
- 'tableable':1,
- 'tablecellaligntype':'column',
- 'tabletitlerowinbold':1,
- 'tablecellstrip':1,
- 'barinsidequote':1,
- 'parainsidelist':0,
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- # 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- # 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'pm6': {
- 'keeplistindent':1,
- 'verbblockfinalescape':1,
- #TODO add support for these
- # maybe set a JOINNEXT char and do it on addLineBreaks()
- 'notbreaklistopen':1,
- 'barinsidequote':1,
- 'autotocwithbars':1,
- 'onelinepara':1,
-
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- # 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- # 'blanksaroundtable':1,
- # 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- 'blanksaroundnumtitle':1,
- },
- 'creole': {
- 'linkable':1,
- 'tableable':1,
- 'imglinkable':1,
- 'tablecellstrip':1,
- 'autotocwithbars':1,
- 'spacedlistitemopen':1,
- 'spacednumlistitemopen':1,
- 'deflisttextstrip':1,
- 'verbblocknotescaped':1,
- 'blanksaroundpara':1,
- 'blanksaroundverb':1,
- 'blanksaroundquote':1,
- 'blanksaroundlist':1,
- 'blanksaroundnumlist':1,
- 'blanksarounddeflist':1,
- 'blanksaroundtable':1,
- 'blanksaroundbar':1,
- 'blanksaroundtitle':1,
- },
- }
-
- # Exceptions for --css-sugar
- if config['css-sugar'] and config['target'] in ('html','xhtml'):
- rules_bank['html']['indentverbblock'] = 0
- rules_bank['html']['autotocwithbars'] = 0
-
- # Get the target specific rules
- if config['target'] == 'xhtml':
- myrules = rules_bank['html'].copy() # inheritance
- myrules.update(rules_bank['xhtml']) # get XHTML specific
- elif config['target'] == 'art':
- myrules = rules_bank['txt'].copy() # inheritance
- if config['slides']:
- myrules['blanksaroundtitle'] = 0
- myrules['blanksaroundnumtitle'] = 0
- else:
- myrules = rules_bank[config['target']].copy()
-
- # Populate return dictionary
- for key in allrules: ret[key] = 0 # reset all
- ret.update(myrules) # get rules
-
- return ret
-
-
-##############################################################################
-
-
-def getRegexes():
- "Returns all the regexes used to find the t2t marks"
-
- bank = {
- 'blockVerbOpen':
- re.compile(r'^```\s*$'),
- 'blockVerbClose':
- re.compile(r'^```\s*$'),
- 'blockRawOpen':
- re.compile(r'^"""\s*$'),
- 'blockRawClose':
- re.compile(r'^"""\s*$'),
- 'blockTaggedOpen':
- re.compile(r"^'''\s*$"),
- 'blockTaggedClose':
- re.compile(r"^'''\s*$"),
- 'blockCommentOpen':
- re.compile(r'^%%%\s*$'),
- 'blockCommentClose':
- re.compile(r'^%%%\s*$'),
- 'quote':
- re.compile(r'^\t+'),
- '1lineVerb':
- re.compile(r'^``` (?=.)'),
- '1lineRaw':
- re.compile(r'^""" (?=.)'),
- '1lineTagged':
- re.compile(r"^''' (?=.)"),
- # mono, raw, bold, italic, underline:
- # - marks must be glued with the contents, no boundary spaces
- # - they are greedy, so in ****bold****, turns to **bold**
- 'fontMono':
- re.compile( r'``([^\s](|.*?[^\s])`*)``'),
- 'raw':
- re.compile( r'""([^\s](|.*?[^\s])"*)""'),
- 'tagged':
- re.compile( r"''([^\s](|.*?[^\s])'*)''"),
- 'fontBold':
- re.compile(r'\*\*([^\s](|.*?[^\s])\**)\*\*'),
- 'fontItalic':
- re.compile( r'//([^\s](|.*?[^\s])/*)//'),
- 'fontUnderline':
- re.compile( r'__([^\s](|.*?[^\s])_*)__'),
- 'fontStrike':
- re.compile( r'--([^\s](|.*?[^\s])-*)--'),
- 'list':
- re.compile(r'^( *)(-) (?=[^ ])'),
- 'numlist':
- re.compile(r'^( *)(\+) (?=[^ ])'),
- 'deflist':
- re.compile(r'^( *)(:) (.*)$'),
- 'listclose':
- re.compile(r'^( *)([-+:])\s*$'),
- 'bar':
- re.compile(r'^(\s*)([_=-]{20,})\s*$'),
- 'table':
- re.compile(r'^ *\|\|? '),
- 'blankline':
- re.compile(r'^\s*$'),
- 'comment':
- re.compile(r'^%'),
-
- # Auxiliary tag regexes
- '_imgAlign' : re.compile(r'~A~', re.I),
- '_tableAlign' : re.compile(r'~A~', re.I),
- '_anchor' : re.compile(r'~A~', re.I),
- '_tableBorder' : re.compile(r'~B~', re.I),
- '_tableColAlign' : re.compile(r'~C~', re.I),
- '_tableCellColSpan': re.compile(r'~S~', re.I),
- '_tableCellAlign' : re.compile(r'~A~', re.I),
- }
-
- # Special char to place data on TAGs contents (\a == bell)
- bank['x'] = re.compile('\a')
-
- # %%macroname [ (formatting) ]
- bank['macros'] = re.compile(r'%%%%(?P%s)\b(\((?P.*?)\))?' % (
- '|'.join(MACROS.keys())), re.I)
-
- # %%TOC special macro for TOC positioning
- bank['toc'] = re.compile(r'^ *%%toc\s*$', re.I)
-
- # Almost complicated title regexes ;)
- titskel = r'^ *(?P%s)(?P%s)\1(\[(?P[\w-]*)\])?\s*$'
- bank[ 'title'] = re.compile(titskel%('[=]{1,5}','[^=](|.*[^=])'))
- bank['numtitle'] = re.compile(titskel%('[+]{1,5}','[^+](|.*[^+])'))
-
- ### Complicated regexes begin here ;)
- #
- # Textual descriptions on --help's style: [...] is optional, | is OR
-
-
- ### First, some auxiliary variables
- #
-
- # [image.EXT]
- patt_img = r'\[([\w_,.+%$#@!?+~/-]+\.(png|jpe?g|gif|eps|bmp))\]'
-
- # Link things
- # http://www.gbiv.com/protocols/uri/rfc/rfc3986.html
- # pchar: A-Za-z._~- / %FF / !$&'()*+,;= / :@
- # Recomended order: scheme://user:pass@domain/path?query=foo#anchor
- # Also works : scheme://user:pass@domain/path#anchor?query=foo
- # TODO form: !'():
- urlskel = {
- 'proto' : r'(https?|ftp|news|telnet|gopher|wais)://',
- 'guess' : r'(www[23]?|ftp)\.', # w/out proto, try to guess
- 'login' : r'A-Za-z0-9_.-', # for ftp://login@domain.com
- 'pass' : r'[^ @]*', # for ftp://login:pass@dom.com
- 'chars' : r'A-Za-z0-9%._/~:,=$@&+-', # %20(space), :80(port), D&D
- 'anchor': r'A-Za-z0-9%._-', # %nn(encoded)
- 'form' : r'A-Za-z0-9/%&=+:;.,$@*_-', # .,@*_-(as is)
- 'punct' : r'.,;:!?'
- }
-
- # username [ :password ] @
- patt_url_login = r'([%s]+(:%s)?@)?'%(urlskel['login'],urlskel['pass'])
-
- # [ http:// ] [ username:password@ ] domain.com [ / ]
- # [ #anchor | ?form=data ]
- retxt_url = r'\b(%s%s|%s)[%s]+\b/*(\?[%s]+)?(#[%s]*)?'%(
- urlskel['proto'],patt_url_login, urlskel['guess'],
- urlskel['chars'],urlskel['form'],urlskel['anchor'])
-
- # filename | [ filename ] #anchor
- retxt_url_local = r'[%s]+|[%s]*(#[%s]*)'%(
- urlskel['chars'],urlskel['chars'],urlskel['anchor'])
-
- # user@domain [ ?form=data ]
- patt_email = r'\b[%s]+@([A-Za-z0-9_-]+\.)+[A-Za-z]{2,4}\b(\?[%s]+)?'%(
- urlskel['login'],urlskel['form'])
-
- # Saving for future use
- bank['_urlskel'] = urlskel
-
- ### And now the real regexes
- #
-
- bank['email'] = re.compile(patt_email,re.I)
-
- # email | url
- bank['link'] = re.compile(r'%s|%s'%(retxt_url,patt_email), re.I)
-
- # \[ label | imagetag url | email | filename \]
- bank['linkmark'] = re.compile(
- r'\[(?P%s|[^]]+) (?P %s|%s|%s)\]'%(
- patt_img, retxt_url, patt_email, retxt_url_local),
- re.L+re.I)
-
- # Image
- bank['img'] = re.compile(patt_img, re.L+re.I)
-
- # Special things
- bank['special'] = re.compile(r'^%!\s*')
- return bank
-### END OF regex nightmares
-
-################# functions for the ASCII Art backend ########################
-
-def aa_line(char, length):
- return char * length
-
-def aa_box(txt, length):
- len_txt = len(txt)
- nspace = int((length - len_txt - 4) / 2)
- line_box = " " * nspace + AA['corner'] + AA['border'] * (len_txt + 2) + AA['corner']
- # <----- nspace " " -----> "+" <----- len_txt+2 "-" -----> "+"
- # +-------------------------------+
- # | all theeeeeeeeeeeeeeeeee text |
- # <----- nspace " " -----> "| " <--------- txt ---------> " |"
- line_txt = " " * nspace + AA['side'] + ' ' + txt + ' ' + AA['side']
- return [line_box, line_txt, line_box]
-
-def aa_header(header_data, length, n, end):
- header = [aa_line(AA['bar2'], length)]
- header.extend(['']*int(n)) #n must be int!
- for h in 'HEADER1', 'HEADER2', 'HEADER3':
- if header_data[h]:
- header.extend(aa_box(header_data[h], length))
- header.extend(['']*int(n)) #Again, n must be int!!
- header.extend(['']*end)
- header.append(aa_line(AA['bar2'], length))
- return header
-
-def aa_slide(title, length):
- res = [aa_line(AA['bar2'], length)]
- res.append('')
- res.append(title.center(length))
- res.append('')
- res.append(aa_line(AA['bar2'], length))
- return res
-
-def aa_table(table):
- data = [row[2:-2].split(' | ') for row in table]
- n = max([len(line) for line in data])
- data = [line + (n - len(line)) * [''] for line in data]
- tab = []
- for i in range(n):
- tab.append([line[i] for line in data])
- length = [max([len(el) for el in line]) for line in tab]
- res = "+"
- for i in range(n):
- res = res + (length[i] + 2) * "-" + '+'
- ret = []
- for line in data:
- aff = "|"
- ret.append(res)
- for j,el in enumerate(line):
- aff = aff + " " + el + (length[j] - len(el) + 1) * " " + "|"
- ret.append(aff)
- ret.append(res)
- return ret
-
-##############################################################################
-
-class error(Exception):
- pass
-def echo(msg): # for quick debug
- print('\033[32;1m%s\033[m'%msg)
-def Quit(msg=''):
- if msg: print(msg)
- sys.exit(0)
-def Error(msg):
- msg = _("%s: Error: ")%my_name + msg
- raise error(msg)
-def getTraceback():
- try:
- from traceback import format_exception
- etype, value, tb = sys.exc_info()
- return ''.join(format_exception(etype, value, tb))
- except: pass
-def getUnknownErrorMessage():
- msg = '%s\n%s (%s):\n\n%s'%(
- _('Sorry! Txt2tags aborted by an unknown error.'),
- _('Please send the following Error Traceback to the author'),
- my_email, getTraceback())
- return msg
-def Message(msg,level):
- if level <= VERBOSE and not QUIET:
- prefix = '-'*5
- print("%s %s"%(prefix*level, msg))
-def Debug(msg,id_=0,linenr=None):
- "Show debug messages, categorized (colored or not)"
- if QUIET or not DEBUG: return
- if int(id_) not in range(8): id_ = 0
- # 0:black 1:red 2:green 3:yellow 4:blue 5:pink 6:cyan 7:white ;1:light
- ids = ['INI','CFG','SRC','BLK','HLD','GUI','OUT','DET']
- colors_bgdark = ['7;1','1;1','3;1','6;1','4;1','5;1','2;1','7;1']
- colors_bglight = ['0' ,'1' ,'3' ,'6' ,'4' ,'5' ,'2' ,'0' ]
- if linenr is not None: msg = "LINE %04d: %s"%(linenr,msg)
- if COLOR_DEBUG:
- if BG_LIGHT: color = colors_bglight[id_]
- else : color = colors_bgdark[id_]
- msg = '\033[3%sm%s\033[m'%(color,msg)
- print("++ %s: %s"%(ids[id_],msg))
-
-def Readfile(file_path, remove_linebreaks=0, ignore_error=0):
- data = []
- if file_path == '-':
- try:
- data = sys.stdin.readlines()
- except:
- if not ignore_error:
- Error(_('You must feed me with data on STDIN!'))
- else:
- try:
- f = open(file_path)
- data = f.readlines()
- f.close()
- except:
- if not ignore_error:
- Error(_("Cannot read file:") + ' ' + file_path)
- if remove_linebreaks:
- data = [re.sub('[\n\r]+$', '', x) for x in data]
- Message(_("File read (%d lines): %s") % (len(data), file_path), 2)
- return data
-
-def Savefile(file_path, contents):
- try:
- f = open(file_path, 'w')
- except:
- Error(_("Cannot open file for writing:") + ' ' + file_path)
- if isinstance(contents, type([])):
- doit = f.writelines
- else:
- doit = f.write
- doit(contents)
- f.close()
-
-def showdic(dic):
- for k in dic.keys(): print("%15s : %s" % (k,dic[k]))
-def dotted_spaces(txt=''):
- return txt.replace(' ', '.')
-
-# TIP: win env vars http://www.winnetmag.com/Article/ArticleID/23873/23873.html
-def get_rc_path():
- "Return the full path for the users' RC file"
- # Try to get the path from an env var. if yes, we're done
- user_defined = os.environ.get('T2TCONFIG')
- if user_defined: return user_defined
- # Env var not found, so perform automatic path composing
- # Set default filename according system platform
- rc_names = {'default':'.txt2tagsrc', 'win':'_t2trc'}
- rc_file = rc_names.get(sys.platform[:3]) or rc_names['default']
- # The file must be on the user directory, but where is this dir?
- rc_dir_search = ['HOME', 'HOMEPATH']
- for var in rc_dir_search:
- rc_dir = os.environ.get(var)
- if rc_dir: break
- # rc dir found, now we must join dir+file to compose the full path
- if rc_dir:
- # Compose path and return it if the file exists
- rc_path = os.path.join(rc_dir, rc_file)
- # On windows, prefix with the drive (%homedrive%: 2k/XP/NT)
- if sys.platform.startswith('win'):
- rc_drive = os.environ.get('HOMEDRIVE')
- rc_path = os.path.join(rc_drive,rc_path)
- return rc_path
- # Sorry, not found
- return ''
-
-
-
-##############################################################################
-
-class CommandLine:
- """
- Command Line class - Masters command line
-
- This class checks and extract data from the provided command line.
- The --long options and flags are taken from the global OPTIONS,
- FLAGS and ACTIONS dictionaries. The short options are registered
- here, and also their equivalence to the long ones.
-
- _compose_short_opts() -> str
- _compose_long_opts() -> list
- Compose the valid short and long options list, on the
- 'getopt' format.
-
- parse() -> (opts, args)
- Call getopt to check and parse the command line.
- It expects to receive the command line as a list, and
- without the program name (sys.argv[1:]).
-
- get_raw_config() -> [RAW config]
- Scans command line and convert the data to the RAW config
- format. See ConfigMaster class to the RAW format description.
- Optional 'ignore' and 'filter_' arguments are used to filter
- in or out specified keys.
-
- compose_cmdline(dict) -> [Command line]
- Compose a command line list from an already parsed config
- dictionary, generated from RAW by ConfigMaster(). Use
- this to compose an optimal command line for a group of
- options.
-
- The get_raw_config() calls parse(), so the typical use of this
- class is:
-
- raw = CommandLine().get_raw_config(sys.argv[1:])
- """
- def __init__(self):
- self.all_options = list(OPTIONS.keys())
- self.all_flags = list(FLAGS.keys())
- self.all_actions = list(ACTIONS.keys())
-
- # short:long options equivalence
- self.short_long = {
- 'C':'config-file',
- 'h':'help',
- 'H':'no-headers',
- 'i':'infile',
- 'n':'enum-title',
- 'o':'outfile',
- 'q':'quiet',
- 't':'target',
- 'v':'verbose',
- 'V':'version',
- }
-
- # Compose valid short and long options data for getopt
- self.short_opts = self._compose_short_opts()
- self.long_opts = self._compose_long_opts()
-
- def _compose_short_opts(self):
- "Returns a string like 'hVt:o' with all short options/flags"
- ret = []
- for opt in self.short_long.keys():
- long_ = self.short_long[opt]
- if long_ in self.all_options: # is flag or option?
- opt = opt+':' # option: have param
- ret.append(opt)
- #Debug('Valid SHORT options: %s'%ret)
- return ''.join(ret)
-
- def _compose_long_opts(self):
- "Returns a list with all the valid long options/flags"
- ret = [x+'=' for x in self.all_options] # add =
- ret.extend(self.all_flags) # flag ON
- ret.extend(self.all_actions) # actions
- ret.extend(['no-'+x for x in self.all_flags]) # add no-*
- ret.extend(['no-style','no-encoding']) # turn OFF
- ret.extend(['no-outfile','no-infile']) # turn OFF
- ret.extend(['no-dump-config', 'no-dump-source']) # turn OFF
- ret.extend(['no-targets']) # turn OFF
- #Debug('Valid LONG options: %s'%ret)
- return ret
-
- def _tokenize(self, cmd_string=''):
- "Convert a command line string to a list"
- #TODO protect quotes contents -- Don't use it, pass cmdline as list
- return cmd_string.split()
-
- def parse(self, cmdline=[]):
- "Check/Parse a command line list TIP: no program name!"
- # Get the valid options
- short, long_ = self.short_opts, self.long_opts
- # Parse it!
- try:
- opts, args = getopt.getopt(cmdline, short, long_)
- except getopt.error as errmsg:
- Error(_("%s (try --help)")%errmsg)
- return (opts, args)
-
- def get_raw_config(self, cmdline=[], ignore=[], filter_=[], relative=0):
- "Returns the options/arguments found as RAW config"
-
- if not cmdline: return []
- ret = []
-
- # We need lists, not strings (such as from %!options)
- if type(cmdline) in (type(''), type('')):
- cmdline = self._tokenize(cmdline)
-
- # Extract name/value pair of all configs, check for invalid names
- options, arguments = self.parse(cmdline[:])
-
- # Some cleanup on the raw config
- for name, value in options:
-
- # Remove leading - and --
- name = re.sub('^--?', '', name)
-
- # Fix old misspelled --suGGar, --no-suGGar
- name = name.replace('suggar', 'sugar')
-
- # Translate short option to long
- if len(name) == 1:
- name = self.short_long[name]
-
- # Outfile exception: path relative to PWD
- if name == 'outfile' and relative and value not in [STDOUT, MODULEOUT]:
- value = os.path.abspath(value)
-
- # -C, --config-file inclusion, path relative to PWD
- if name == 'config-file':
- ret.extend(ConfigLines().include_config_file(value))
- continue
-
- # Save this config
- ret.append(['all', name, value])
-
- # All configuration was read and saved
-
- # Get infile, if any
- while arguments:
- infile = arguments.pop(0)
- ret.append(['all', 'infile', infile])
-
- # Apply 'ignore' and 'filter_' rules (filter_ is stronger)
- if (ignore or filter_):
- filtered = []
- for target, name, value in ret:
- if (filter_ and name in filter_) or \
- (ignore and name not in ignore):
- filtered.append([target, name, value])
- ret = filtered[:]
-
- # Add the original command line string as 'realcmdline'
- ret.append( ['all', 'realcmdline', cmdline] )
-
- return ret
-
- def compose_cmdline(self, conf={}, no_check=0):
- "compose a full (and diet) command line from CONF dict"
- if not conf: return []
- args = []
- dft_options = OPTIONS.copy()
- cfg = conf.copy()
- valid_opts = self.all_options + self.all_flags
- use_short = {'no-headers':'H', 'enum-title':'n'}
- # Remove useless options
- if not no_check and cfg.get('toc-only'):
- if 'no-headers' in cfg:
- del cfg['no-headers']
- if 'outfile' in cfg:
- del cfg['outfile'] # defaults to STDOUT
- if cfg.get('target') == 'txt':
- del cfg['target'] # already default
- args.append('--toc-only') # must be the first
- del cfg['toc-only']
- # Add target type
- if 'target' in cfg:
- args.append('-t '+cfg['target'])
- del cfg['target']
- # Add other options
- for key in cfg.keys():
- if key not in valid_opts: continue # may be a %!setting
- if key == 'outfile' or key == 'infile': continue # later
- val = cfg[key]
- if not val: continue
- # Default values are useless on cmdline
- if val == dft_options.get(key): continue
- # -short format
- if key in use_short.keys():
- args.append('-'+use_short[key])
- continue
- # --long format
- if key in self.all_flags: # add --option
- args.append('--'+key)
- else: # add --option=value
- args.append('--%s=%s'%(key,val))
- # The outfile using -o
- if 'outfile' in cfg and \
- cfg['outfile'] != dft_options.get('outfile'):
- args.append('-o '+cfg['outfile'])
- # Place input file(s) always at the end
- if 'infile' in cfg:
- args.append(' '.join(cfg['infile']))
- # Return as a nice list
- Debug("Diet command line: %s"%' '.join(args), 1)
- return args
-
-##############################################################################
-
-class SourceDocument:
- """
- SourceDocument class - scan document structure, extract data
-
- It knows about full files. It reads a file and identify all
- the areas beginning (Head,Conf,Body). With this info it can
- extract each area contents.
- Note: the original line break is removed.
-
- DATA:
- self.arearef - Save Head, Conf, Body init line number
- self.areas - Store the area names which are not empty
- self.buffer - The full file contents (with NO \\r, \\n)
-
- METHODS:
- get() - Access the contents of an Area. Example:
- config = SourceDocument(file).get('conf')
-
- split() - Get all the document Areas at once. Example:
- head, conf, body = SourceDocument(file).split()
-
- RULES:
- * The document parts are sequential: Head, Conf and Body.
- * One ends when the next begins.
- * The Conf Area is optional, so a document can have just
- Head and Body Areas.
-
- These are the Areas limits:
- - Head Area: the first three lines
- - Body Area: from the first valid text line to the end
- - Conf Area: the comments between Head and Body Areas
-
- Exception: If the first line is blank, this means no
- header info, so the Head Area is just the first line.
- """
- def __init__(self, filename='', contents=[]):
- self.areas = ['head','conf','body']
- self.arearef = []
- self.areas_fancy = ''
- self.filename = filename
- self.buffer = []
- if filename:
- self.scan_file(filename)
- elif contents:
- self.scan(contents)
-
- def split(self):
- "Returns all document parts, splitted into lists."
- return self.get('head'), self.get('conf'), self.get('body')
-
- def get(self, areaname):
- "Returns head|conf|body contents from self.buffer"
- # Sanity
- if areaname not in self.areas: return []
- if not self.buffer : return []
- # Go get it
- bufini = 1
- bufend = len(self.buffer)
- if areaname == 'head':
- ini = bufini
- end = self.arearef[1] or self.arearef[2] or bufend
- elif areaname == 'conf':
- ini = self.arearef[1]
- end = self.arearef[2] or bufend
- elif areaname == 'body':
- ini = self.arearef[2]
- end = bufend
- else:
- Error("Unknown Area name '%s'"%areaname)
- lines = self.buffer[ini:end]
- # Make sure head will always have 3 lines
- while areaname == 'head' and len(lines) < 3:
- lines.append('')
- return lines
-
- def scan_file(self, filename):
- Debug("source file: %s"%filename)
- Message(_("Loading source document"),1)
- buf = Readfile(filename, remove_linebreaks=1)
- self.scan(buf)
-
- def scan(self, lines):
- "Run through source file and identify head/conf/body areas"
- buf = lines
- if len(buf) == 0:
- Error(_('The input file is empty: %s')%self.filename)
- cfg_parser = ConfigLines().parse_line
- buf.insert(0, '') # text start at pos 1
- ref = [1,4,0]
- if not buf[1].strip(): # no header
- ref[0] = 0 ; ref[1] = 2
- rgx = getRegexes()
- on_comment_block = 0
- for i in range(ref[1],len(buf)): # find body init:
- # Handle comment blocks inside config area
- if not on_comment_block \
- and rgx['blockCommentOpen'].search(buf[i]):
- on_comment_block = 1
- continue
- if on_comment_block \
- and rgx['blockCommentOpen'].search(buf[i]):
- on_comment_block = 0
- continue
- if on_comment_block: continue
-
- if buf[i].strip() and ( # ... not blank and
- buf[i][0] != '%' or # ... not comment or
- rgx['macros'].match(buf[i]) or # ... %%macro
- rgx['toc'].match(buf[i]) or # ... %%toc
- cfg_parser(buf[i],'include')[1] or # ... %!include
- cfg_parser(buf[i],'csv')[1] # ... %!csv
- ):
- ref[2] = i ; break
- if ref[1] == ref[2]: ref[1] = 0 # no conf area
- for i in 0,1,2: # del !existent
- if ref[i] >= len(buf): ref[i] = 0 # title-only
- if not ref[i]: self.areas[i] = ''
- Debug('Head,Conf,Body start line: %s'%ref)
- self.arearef = ref # save results
- self.buffer = buf
- # Fancyness sample: head conf body (1 4 8)
- self.areas_fancy = "%s (%s)"%(
- ' '.join(self.areas),
- ' '.join(map(str, [x or '' for x in ref])))
- Message(_("Areas found: %s")%self.areas_fancy, 2)
-
- def get_raw_config(self):
- "Handy method to get the CONF area RAW config (if any)"
- if not self.areas.count('conf'): return []
- Message(_("Scanning source document CONF area"),1)
- raw = ConfigLines(
- file_=self.filename, lines=self.get('conf'),
- first_line=self.arearef[1]).get_raw_config()
- Debug("document raw config: %s"%raw, 1)
- return raw
-
-##############################################################################
-
-class ConfigMaster:
- """
- ConfigMaster class - the configuration wizard
-
- This class is the configuration master. It knows how to handle
- the RAW and PARSED config format. It also performs the sanity
- checking for a given configuration.
-
- DATA:
- self.raw - Stores the config on the RAW format
- self.parsed - Stores the config on the PARSED format
- self.defaults - Stores the default values for all keys
- self.off - Stores the OFF values for all keys
- self.multi - List of keys which can have multiple values
- self.numeric - List of keys which value must be a number
- self.incremental - List of keys which are incremental
-
- RAW FORMAT:
- The RAW format is a list of lists, being each mother list item
- a full configuration entry. Any entry is a 3 item list, on
- the following format: [ TARGET, KEY, VALUE ]
- Being a list, the order is preserved, so it's easy to use
- different kinds of configs, as CONF area and command line,
- respecting the precedence.
- The special target 'all' is used when no specific target was
- defined on the original config.
-
- PARSED FORMAT:
- The PARSED format is a dictionary, with all the 'key : value'
- found by reading the RAW config. The self.target contents
- matters, so this dictionary only contains the target's
- config. The configs of other targets are ignored.
-
- The CommandLine and ConfigLines classes have the get_raw_config()
- method which convert the configuration found to the RAW format.
- Just feed it to parse() and get a brand-new ready-to-use config
- dictionary. Example:
-
- >>> raw = CommandLine().get_raw_config(['-n', '-H'])
- >>> print raw
- [['all', 'enum-title', ''], ['all', 'no-headers', '']]
- >>> parsed = ConfigMaster(raw).parse()
- >>> print parsed
- {'enum-title': 1, 'headers': 0}
- """
- def __init__(self, raw=[], target=''):
- self.raw = raw
- self.target = target
- self.parsed = {}
- self.dft_options = OPTIONS.copy()
- self.dft_flags = FLAGS.copy()
- self.dft_actions = ACTIONS.copy()
- self.dft_settings = SETTINGS.copy()
- self.defaults = self._get_defaults()
- self.off = self._get_off()
- self.incremental = ['verbose']
- self.numeric = ['toc-level', 'split', 'width', 'height']
- self.multi = ['infile', 'preproc', 'postproc', 'options', 'style']
-
- def _get_defaults(self):
- "Get the default values for all config/options/flags"
- empty = {}
- for kw in CONFIG_KEYWORDS: empty[kw] = ''
- empty.update(self.dft_options)
- empty.update(self.dft_flags)
- empty.update(self.dft_actions)
- empty.update(self.dft_settings)
- empty['realcmdline'] = '' # internal use only
- empty['sourcefile'] = '' # internal use only
- return empty
-
- def _get_off(self):
- "Turns OFF all the config/options/flags"
- off = {}
- for key in self.defaults.keys():
- kind = type(self.defaults[key])
- if isinstance(0, kind):
- off[key] = 0
- elif isinstance('', kind):
- off[key] = ''
- elif isinstance([], kind):
- off[key] = []
- else:
- Error('ConfigMaster: %s: Unknown type' % key)
- return off
-
- def _check_target(self):
- "Checks if the target is already defined. If not, do it"
- if not self.target:
- self.target = self.find_value('target')
-
- def get_target_raw(self):
- "Returns the raw config for self.target or 'all'"
- ret = []
- self._check_target()
- for entry in self.raw:
- if entry[0] == self.target or entry[0] == 'all':
- ret.append(entry)
- return ret
-
- def add(self, key, val):
- "Adds the key:value pair to the config dictionary (if needed)"
- # %!options
- if key == 'options':
- ignoreme = list(self.dft_actions.keys()) + ['target']
- ignoreme.remove('dump-config')
- ignoreme.remove('dump-source')
- ignoreme.remove('targets')
- raw_opts = CommandLine().get_raw_config(
- val, ignore=ignoreme)
- for target, key, val in raw_opts:
- self.add(key, val)
- return
- # The no- prefix turns OFF this key
- if key.startswith('no-'):
- key = key[3:] # remove prefix
- val = self.off.get(key) # turn key OFF
- # Is this key valid?
- if key not in self.defaults.keys():
- Debug('Bogus Config %s:%s'%(key,val),1)
- return
- # Is this value the default one?
- if val == self.defaults.get(key):
- # If default value, remove previous key:val
- if key in self.parsed:
- del self.parsed[key]
- # Nothing more to do
- return
- # Flags ON comes empty. we'll add the 1 value now
- if val == '' and (
- key in self.dft_flags.keys() or
- key in self.dft_actions.keys()):
- val = 1
- # Multi value or single?
- if key in self.multi:
- # First one? start new list
- if key not in self.parsed:
- self.parsed[key] = []
- self.parsed[key].append(val)
- # Incremental value? so let's add it
- elif key in self.incremental:
- self.parsed[key] = (self.parsed.get(key) or 0) + val
- else:
- self.parsed[key] = val
- fancykey = dotted_spaces("%12s"%key)
- Message(_("Added config %s : %s")%(fancykey,val),3)
-
- def get_outfile_name(self, config={}):
- "Dirname is the same for {in,out}file"
- infile, outfile = config['sourcefile'], config['outfile']
- if outfile and outfile not in (STDOUT, MODULEOUT) \
- and not os.path.isabs(outfile):
- outfile = os.path.join(os.path.dirname(infile), outfile)
- if infile == STDIN and not outfile: outfile = STDOUT
- if infile == MODULEIN and not outfile: outfile = MODULEOUT
- if not outfile and (infile and config.get('target')):
- basename = re.sub('\.(txt|t2t)$','',infile)
- outfile = "%s.%s"%(basename, config['target'])
- Debug(" infile: '%s'"%infile , 1)
- Debug("outfile: '%s'"%outfile, 1)
- return outfile
-
- def sanity(self, config, gui=0):
- "Basic config sanity checking"
- global AA
- if not config: return {}
- target = config.get('target')
- # Some actions don't require target specification
- if not target:
- for action in NO_TARGET:
- if config.get(action):
- target = 'txt'
- break
- # On GUI, some checking are skipped
- if not gui:
- # We *need* a target
- if not target:
- Error(_('No target specified (try --help)') + '\n\n' +
- _('Please inform a target using the -t option or the %!target command.') + '\n' +
- _('Example:') + ' %s -t html %s' % (my_name, _('file.t2t')) + '\n\n' +
- _("Run 'txt2tags --targets' to see all the available targets."))
- # And of course, an infile also
- # TODO#1: It seems that this checking is never reached
- if not config.get('infile'):
- Error(_('Missing input file (try --help)'))
- # Is the target valid?
- if not TARGETS.count(target):
- Error(_("Invalid target '%s'") % target + '\n\n' +
- _("Run 'txt2tags --targets' to see all the available targets."))
- # Ensure all keys are present
- empty = self.defaults.copy() ; empty.update(config)
- config = empty.copy()
- # Check integers options
- for key in config.keys():
- if key in self.numeric:
- try:
- config[key] = int(config[key])
- except ValueError:
- Error(_('--%s value must be a number') % key)
- # Check split level value
- if config['split'] not in (0,1,2):
- Error(_('Option --split must be 0, 1 or 2'))
- # Slides needs width and height
- if config['slides'] and target == 'art':
- if not config['width']:
- config['width'] = DFT_SLIDE_WIDTH
- if not config['height']:
- config['height'] = DFT_SLIDE_HEIGHT
- # ASCII Art needs a width
- if target == 'art' and not config['width']:
- config['width'] = DFT_TEXT_WIDTH
- # Check/set user ASCII Art formatting characters
- if config['art-chars']:
- if len(config['art-chars']) != len(AA_VALUES):
- Error(_("--art-chars: Expected %i chars, got %i") % (
- len(AA_VALUES), len(config['art-chars'])))
- else:
- AA = dict(zip(AA_KEYS, config['art-chars']))
- # --toc-only is stronger than others
- if config['toc-only']:
- config['headers'] = 0
- config['toc'] = 0
- config['split'] = 0
- config['gui'] = 0
- config['outfile'] = config['outfile'] or STDOUT
- # Splitting is disable for now (future: HTML only, no STDOUT)
- config['split'] = 0
- # Restore target
- config['target'] = target
- # Set output file name
- config['outfile'] = self.get_outfile_name(config)
- # Checking suicide
- if config['sourcefile'] == config['outfile'] and \
- config['outfile'] not in [STDOUT,MODULEOUT] and not gui:
- Error(_("Input and Output files are the same: %s") % config['outfile'])
- return config
-
- def parse(self):
- "Returns the parsed config for the current target"
- raw = self.get_target_raw()
- for target, key, value in raw:
- self.add(key, value)
- Message(_("Added the following keys: %s") % ', '.join(self.parsed.keys()), 2)
- return self.parsed.copy()
-
- def find_value(self, key='', target=''):
- "Scans ALL raw config to find the desired key"
- ret = []
- # Scan and save all values found
- for targ, k, val in self.raw:
- if k == key and (targ == target or targ == 'all'):
- ret.append(val)
- if not ret: return ''
- # If not multi value, return only the last found
- if key in self.multi: return ret
- else : return ret[-1]
-
-########################################################################
-
-class ConfigLines:
- """
- ConfigLines class - the config file data extractor
-
- This class reads and parse the config lines on the %!key:val
- format, converting it to RAW config. It deals with user
- config file (RC file), source document CONF area and
- %!includeconf directives.
-
- Call it passing a file name or feed the desired config lines.
- Then just call the get_raw_config() method and wait to
- receive the full config data on the RAW format. This method
- also follows the possible %!includeconf directives found on
- the config lines. Example:
-
- raw = ConfigLines(file=".txt2tagsrc").get_raw_config()
-
- The parse_line() method is also useful to be used alone,
- to identify and tokenize a single config line. For example,
- to get the %!include command components, on the source
- document BODY:
-
- target, key, value = ConfigLines().parse_line(body_line)
- """
- def __init__(self, file_='', lines=[], first_line=1):
- self.file = file_ or 'NOFILE'
- self.lines = lines
- self.first_line = first_line
-
- def load_lines(self):
- "Make sure we've loaded the file contents into buffer"
- if not self.lines and not self.file:
- Error("ConfigLines: No file or lines provided")
- if not self.lines:
- self.lines = self.read_config_file(self.file)
-
- def read_config_file(self, filename=''):
- "Read a Config File contents, aborting on invalid line"
- if not filename: return []
- errormsg = _("Invalid CONFIG line on %s")+"\n%03d:%s"
- lines = Readfile(filename, remove_linebreaks=1)
- # Sanity: try to find invalid config lines
- for i in range(len(lines)):
- line = lines[i].rstrip()
- if not line: continue # empty
- if line[0] != '%': Error(errormsg%(filename,i+1,line))
- return lines
-
- def include_config_file(self, file_=''):
- "Perform the %!includeconf action, returning RAW config"
- if not file_: return []
- # Current dir relative to the current file (self.file)
- current_dir = os.path.dirname(self.file)
- file_ = os.path.join(current_dir, file_)
- # Read and parse included config file contents
- lines = self.read_config_file(file_)
- return ConfigLines(file_=file_, lines=lines).get_raw_config()
-
- def get_raw_config(self):
- "Scan buffer and extract all config as RAW (including includes)"
- ret = []
- self.load_lines()
- first = self.first_line
- for i in range(len(self.lines)):
- line = self.lines[i]
- Message(_("Processing line %03d: %s")%(first+i,line),2)
- target, key, val = self.parse_line(line)
- if not key: continue # no config on this line
- if key == 'includeconf':
- err = _('A file cannot include itself (loop!)')
- if val == self.file:
- Error("%s: %%!includeconf: %s" % (err, self.file))
- more_raw = self.include_config_file(val)
- ret.extend(more_raw)
- Message(_("Finished Config file inclusion: %s") % val, 2)
- else:
- ret.append([target, key, val])
- Message(_("Added %s")%key,3)
- return ret
-
- def parse_line(self, line='', keyname='', target=''):
- "Detects %!key:val config lines and extract data from it"
- empty = ['', '', '']
- if not line: return empty
- no_target = ['target', 'includeconf']
- re_name = keyname or '[a-z]+'
- re_target = target or '[a-z]*'
- # XXX TODO \S.+? requires TWO chars, breaks %!include:a
- cfgregex = re.compile("""
- ^%%!\s* # leading id with opt spaces
- (?P%s)\s* # config name
- (\((?P%s)\))? # optional target spec inside ()
- \s*:\s* # key:value delimiter with opt spaces
- (?P\S.+?) # config value
- \s*$ # rstrip() spaces and hit EOL
- """%(re_name, re_target), re.I+re.VERBOSE)
- prepostregex = re.compile("""
- # ---[ PATTERN ]---
- ^( "([^"]*)" # "double quoted" or
- | '([^']*)' # 'single quoted' or
- | ([^\s]+) # single_word
- )
- \s+ # separated by spaces
-
- # ---[ REPLACE ]---
- ( "([^"]*)" # "double quoted" or
- | '([^']*)' # 'single quoted' or
- | (.*) # anything
- )
- \s*$
- """, re.VERBOSE)
- guicolors = re.compile("^([^\s]+\s+){3}[^\s]+") # 4 tokens
-
- # Give me a match or get out
- match = cfgregex.match(line)
- if not match: return empty
-
- # Save information about this config
- name = (match.group('name') or '').lower()
- target = (match.group('target') or 'all').lower()
- value = match.group('value')
-
- # %!keyword(target) not allowed for these
- if name in no_target and match.group('target'):
- Error(
- _("You can't use (target) with %s") % ('%!' + name)
- + "\n%s" % line)
-
- # Force no_target keywords to be valid for all targets
- if name in no_target:
- target = 'all'
-
- # Special config for GUI colors
- if name == 'guicolors':
- valmatch = guicolors.search(value)
- if not valmatch: return empty
- value = re.split('\s+', value)
-
- # Special config with two quoted values (%!preproc: "foo" 'bar')
- if name == 'preproc' or name == 'postproc':
- valmatch = prepostregex.search(value)
- if not valmatch: return empty
- getval = valmatch.group
- patt = getval(2) or getval(3) or getval(4) or ''
- repl = getval(6) or getval(7) or getval(8) or ''
- value = (patt, repl)
- return [target, name, value]
-
-##############################################################################
-
-class MaskMaster:
- "(Un)Protect important structures from escaping and formatting"
- def __init__(self):
- self.linkmask = 'vvvLINKvvv'
- self.monomask = 'vvvMONOvvv'
- self.macromask = 'vvvMACROvvv'
- self.rawmask = 'vvvRAWvvv'
- self.taggedmask= 'vvvTAGGEDvvv'
- self.tocmask = 'vvvTOCvvv'
- self.macroman = MacroMaster()
- self.reset()
-
- def reset(self):
- self.linkbank = []
- self.monobank = []
- self.macrobank = []
- self.rawbank = []
- self.taggedbank = []
-
- def mask(self, line=''):
- global AUTOTOC
-
- # The verbatim, raw and tagged inline marks are mutually exclusive.
- # This means that one can't appear inside the other.
- # If found, the inner marks must be ignored.
- # Example: ``foo ""bar"" ''baz''``
- # In HTML: foo ""bar"" ''baz''
- #
- # The trick here is to protect the mark who appears first on the line.
- # The three regexes are tried and the one with the lowest index wins.
- # If none is found (else), we get out of the loop.
- #
- while True:
-
- # Try to match the line for the three marks
- # Note: 'z' > 999999
- #
- t = r = v = 1000000 #Python 3 doesn't allow comparison between str and int!
- try: t = regex['tagged'].search(line).start()
- except: pass
- try: r = regex['raw'].search(line).start()
- except: pass
- try: v = regex['fontMono'].search(line).start()
- except: pass
-
- # Protect tagged text
- if t >= 0 and t < r and t < v:
- txt = regex['tagged'].search(line).group(1)
- self.taggedbank.append(txt)
- line = regex['tagged'].sub(self.taggedmask,line,1)
-
- # Protect raw text
- elif r >= 0 and r < t and r < v:
- txt = regex['raw'].search(line).group(1)
- txt = doEscape(TARGET,txt)
- self.rawbank.append(txt)
- line = regex['raw'].sub(self.rawmask,line,1)
-
- # Protect verbatim text
- elif v >= 0 and v < t and v < r:
- txt = regex['fontMono'].search(line).group(1)
- txt = doEscape(TARGET,txt)
- self.monobank.append(txt)
- line = regex['fontMono'].sub(self.monomask,line,1)
- else:
- break
-
- # Protect macros
- while regex['macros'].search(line):
- txt = regex['macros'].search(line).group()
- self.macrobank.append(txt)
- line = regex['macros'].sub(self.macromask,line,1)
-
- # Protect TOC location
- while regex['toc'].search(line):
- line = regex['toc'].sub(self.tocmask,line)
- AUTOTOC = 0
-
- # Protect URLs and emails
- while regex['linkmark'].search(line) or \
- regex['link' ].search(line):
-
- # Try to match plain or named links
- match_link = regex['link'].search(line)
- match_named = regex['linkmark'].search(line)
-
- # Define the current match
- if match_link and match_named:
- # Both types found, which is the first?
- m = match_link
- if match_named.start() < match_link.start():
- m = match_named
- else:
- # Just one type found, we're fine
- m = match_link or match_named
-
- # Extract link data and apply mask
- if m == match_link: # plain link
- link = m.group()
- label = ''
- link_re = regex['link']
- else: # named link
- link = m.group('link')
- label = m.group('label').rstrip()
- link_re = regex['linkmark']
- line = link_re.sub(self.linkmask,line,1)
-
- # Save link data to the link bank
- self.linkbank.append((label, link))
- return line
-
- def undo(self, line):
-
- # url & email
- for label,url in self.linkbank:
- link = get_tagged_link(label, url)
- line = line.replace(self.linkmask, link, 1)
-
- # Expand macros
- for macro in self.macrobank:
- macro = self.macroman.expand(macro)
- line = line.replace(self.macromask, macro, 1)
-
- # Expand verb
- for mono in self.monobank:
- open_,close = TAGS['fontMonoOpen'],TAGS['fontMonoClose']
- line = line.replace(self.monomask, open_+mono+close, 1)
-
- # Expand raw
- for raw in self.rawbank:
- line = line.replace(self.rawmask, raw, 1)
-
- # Expand tagged
- for tagged in self.taggedbank:
- line = line.replace(self.taggedmask, tagged, 1)
-
- return line
-
-
-##############################################################################
-
-
-class TitleMaster:
- "Title things"
- def __init__(self):
- self.count = ['',0,0,0,0,0]
- self.toc = []
- self.level = 0
- self.kind = ''
- self.txt = ''
- self.label = ''
- self.tag = ''
- self.tag_hold = []
- self.last_level = 0
- self.count_id = ''
- self.user_labels = {}
- self.anchor_count = 0
- self.anchor_prefix = 'toc'
-
- def _open_close_blocks(self):
- "Open new title blocks, closing the previous (if any)"
- if not rules['titleblocks']: return
- tag = ''
- last = self.last_level
- curr = self.level
-
- # Same level, just close the previous
- if curr == last:
- tag = TAGS.get('title%dClose'%last)
- if tag: self.tag_hold.append(tag)
-
- # Section -> subsection, more depth
- while curr > last:
- last += 1
-
- # Open the new block of subsections
- tag = TAGS.get('blockTitle%dOpen'%last)
- if tag: self.tag_hold.append(tag)
-
- # Jump from title1 to title3 or more
- # Fill the gap with an empty section
- if curr - last > 0:
- tag = TAGS.get('title%dOpen'%last)
- tag = regex['x'].sub('', tag) # del \a
- if tag: self.tag_hold.append(tag)
-
- # Section <- subsection, less depth
- while curr < last:
- # Close the current opened subsection
- tag = TAGS.get('title%dClose'%last)
- if tag: self.tag_hold.append(tag)
-
- # Close the current opened block of subsections
- tag = TAGS.get('blockTitle%dClose'%last)
- if tag: self.tag_hold.append(tag)
-
- last -= 1
-
- # Close the previous section of the same level
- # The subsections were under it
- if curr == last:
- tag = TAGS.get('title%dClose'%last)
- if tag: self.tag_hold.append(tag)
-
- def add(self, line):
- "Parses a new title line."
- if not line: return
- self._set_prop(line)
- self._open_close_blocks()
- self._set_count_id()
- self._set_label()
- self._save_toc_info()
-
- def close_all(self):
- "Closes all opened title blocks"
- ret = []
- ret.extend(self.tag_hold)
- while self.level:
- tag = TAGS.get('title%dClose'%self.level)
- if tag: ret.append(tag)
- tag = TAGS.get('blockTitle%dClose'%self.level)
- if tag: ret.append(tag)
- self.level -= 1
- return ret
-
- def _save_toc_info(self):
- "Save TOC info, used by self.dump_marked_toc()"
- self.toc.append((self.level, self.count_id, self.txt, self.label))
-
- def _set_prop(self, line=''):
- "Extract info from original line and set data holders."
- # Detect title type (numbered or not)
- id_ = line.lstrip()[0]
- if id_ == '=': kind = 'title'
- elif id_ == '+': kind = 'numtitle'
- else: Error("Unknown Title ID '%s'"%id_)
- # Extract line info
- match = regex[kind].search(line)
- level = len(match.group('id'))
- txt = match.group('txt').strip()
- label = match.group('label')
- # Parse info & save
- if CONF['enum-title']: kind = 'numtitle' # force
- if rules['titleblocks']:
- self.tag = TAGS.get('%s%dOpen'%(kind,level)) or \
- TAGS.get('title%dOpen'%level)
- else:
- self.tag = TAGS.get(kind+repr(level)) or \
- TAGS.get('title'+repr(level))
- self.last_level = self.level
- self.kind = kind
- self.level = level
- self.txt = txt
- self.label = label
-
- def _set_count_id(self):
- "Compose and save the title count identifier (if needed)."
- count_id = ''
- if self.kind == 'numtitle' and not rules['autonumbertitle']:
- # Manually increase title count
- self.count[self.level] += 1
- # Reset sublevels count (if any)
- max_levels = len(self.count)
- if self.level < max_levels-1:
- for i in range(self.level+1, max_levels):
- self.count[i] = 0
- # Compose count id from hierarchy
- for i in range(self.level):
- count_id= "%s%d."%(count_id, self.count[i+1])
- self.count_id = count_id
-
- def _set_label(self):
- "Compose and save title label, used by anchors."
- # Remove invalid chars from label set by user
- self.label = re.sub('[^A-Za-z0-9_-]', '', self.label or '')
- # Generate name as 15 first :alnum: chars
- #TODO how to translate safely accented chars to plain?
- #self.label = re.sub('[^A-Za-z0-9]', '', self.txt)[:15]
- # 'tocN' label - sequential count, ignoring 'toc-level'
- #self.label = self.anchor_prefix + str(len(self.toc)+1)
-
- def _get_tagged_anchor(self):
- "Return anchor if user defined a label, or TOC is on."
- ret = ''
- label = self.label
- if CONF['toc'] and self.level <= CONF['toc-level']:
- # This count is needed bcos self.toc stores all
- # titles, regardless of the 'toc-level' setting,
- # so we can't use self.toc length to number anchors
- self.anchor_count += 1
- # Autonumber label (if needed)
- label = label or '%s%s' % (self.anchor_prefix, self.anchor_count)
- if label and TAGS['anchor']:
- ret = regex['x'].sub(label,TAGS['anchor'])
- return ret
-
- def _get_full_title_text(self):
- "Returns the full title contents, already escaped."
- ret = self.txt
- # Insert count_id (if any) before text
- if self.count_id:
- ret = '%s %s'%(self.count_id, ret)
- # Escape specials
- ret = doEscape(TARGET, ret)
- # Same targets needs final escapes on title lines
- # It's here because there is a 'continue' after title
- if rules['finalescapetitle']:
- ret = doFinalEscape(TARGET, ret)
- return ret
-
- def get(self):
- "Returns the tagged title as a list."
- global AA_TITLE
- ret = []
-
- # Maybe some anchoring before?
- anchor = self._get_tagged_anchor()
- self.tag = regex['_anchor'].sub(anchor, self.tag)
-
- ### Compose & escape title text (TOC uses unescaped)
- full_title = self._get_full_title_text()
-
- # Close previous section area
- ret.extend(self.tag_hold)
- self.tag_hold = []
-
- tagged = regex['x'].sub(full_title, self.tag)
-
- # Adds "underline" on TXT target
- if TARGET == 'txt':
- if BLOCK.count > 1: ret.append('') # blank line before
- ret.append(tagged)
- #Can't be used on Python 3 because every string is unicode unless declared as b'non-unicode string. Array of bytes'
- #It doesn't support 'decode'
- #
- # Get the right letter count for UTF
- #if CONF['encoding'].lower() == 'utf-8':
- # i = len(full_title.decode('utf-8'))
- #else:
- i = len(full_title)
- ret.append(regex['x'].sub('='*i, self.tag))
- elif TARGET == 'art' and self.level == 1:
- if CONF['slides'] :
- AA_TITLE = tagged
- else :
- if BLOCK.count > 1: ret.append('') # blank line before
- ret.extend(aa_box(tagged, CONF['width']))
- elif TARGET == 'art':
- level = 'level'+str(self.level)
- if BLOCK.count > 1: ret.append('') # blank line before
- ret.append(tagged)
- ret.append(AA[level] * len(full_title))
- else:
- ret.append(tagged)
- return ret
-
- def dump_marked_toc(self, max_level=99):
- "Dumps all toc itens as a valid t2t-marked list"
- ret = []
- toc_count = 1
- for level, count_id, txt, label in self.toc:
- if level > max_level: continue # ignore
- indent = ' '*level
- id_txt = ('%s %s'%(count_id, txt)).lstrip()
- label = label or self.anchor_prefix+repr(toc_count)
- toc_count += 1
-
- # TOC will have crosslinks to anchors
- if TAGS['anchor']:
- if CONF['enum-title'] and level == 1:
- # 1. [Foo #anchor] is more readable than [1. Foo #anchor] in level 1.
- # This is a stoled idea from Windows .CHM help files.
- tocitem = '%s+ [""%s"" #%s]' % (indent, txt, label)
- else:
- tocitem = '%s- [""%s"" #%s]' % (indent, id_txt, label)
-
- # TOC will be plain text (no links)
- else:
- if TARGET in ['txt', 'man', 'art']:
- # For these, the list is not necessary, just dump the text
- tocitem = '%s""%s""' % (indent, id_txt)
- else:
- tocitem = '%s- ""%s""' % (indent, id_txt)
- ret.append(tocitem)
- return ret
-
-
-##############################################################################
-
-#TODO check all this table mess
-# It uses parse_row properties for table lines
-# BLOCK.table() replaces the cells by the parsed content
-class TableMaster:
- def __init__(self, line=''):
- self.rows = []
- self.border = 0
- self.align = 'Left'
- self.cellalign = []
- self.colalign = []
- self.cellspan = []
- if line:
- prop = self.parse_row(line)
- self.border = prop['border']
- self.align = prop['align']
- self.cellalign = prop['cellalign']
- self.cellspan = prop['cellspan']
- self.colalign = self._get_col_align()
-
- def _get_col_align(self):
- colalign = []
- for cell in range(0,len(self.cellalign)):
- align = self.cellalign[cell]
- span = self.cellspan[cell]
- colalign.extend([align] * span)
- return colalign
-
- def _get_open_tag(self):
- topen = TAGS['tableOpen']
- tborder = TAGS['_tableBorder']
- talign = TAGS['_tableAlign'+self.align]
- calignsep = TAGS['tableColAlignSep']
- calign = ''
-
- # The first line defines if table has border or not
- if not self.border: tborder = ''
- # Set the columns alignment
- if rules['tablecellaligntype'] == 'column':
- calign = [TAGS['_tableColAlign%s'%x] for x in self.colalign]
- calign = calignsep.join(calign)
- # Align full table, set border and Column align (if any)
- topen = regex['_tableAlign' ].sub(talign , topen)
- topen = regex['_tableBorder' ].sub(tborder, topen)
- topen = regex['_tableColAlign'].sub(calign , topen)
- # Tex table spec, border or not: {|l|c|r|} , {lcr}
- if calignsep and not self.border:
- # Remove cell align separator
- topen = topen.replace(calignsep, '')
- return topen
-
- def _get_cell_align(self, cells):
- ret = []
- for cell in cells:
- align = 'Left'
- if cell.strip():
- if cell[0] == ' ' and cell[-1] == ' ':
- align = 'Center'
- elif cell[0] == ' ':
- align = 'Right'
- ret.append(align)
- return ret
-
- def _get_cell_span(self, cells):
- ret = []
- for cell in cells:
- span = 1
- m = re.search('\a(\|+)$', cell)
- if m: span = len(m.group(1))+1
- ret.append(span)
- return ret
-
- def _tag_cells(self, rowdata):
- row = []
- cells = rowdata['cells']
- open_ = TAGS['tableCellOpen']
- close = TAGS['tableCellClose']
- sep = TAGS['tableCellSep']
- calign = [TAGS['_tableCellAlign'+x] for x in rowdata['cellalign']]
- calignsep = TAGS['tableColAlignSep']
- ncolumns = len(self.colalign)
-
- # Populate the span and multicol open tags
- cspan = []
- multicol = []
- colindex = 0
- for cellindex in range(0,len(rowdata['cellspan'])):
-
- span = rowdata['cellspan'][cellindex]
- align = rowdata['cellalign'][cellindex]
-
- if span > 1:
- cspan.append(regex['x'].sub(
- str(span), TAGS['_tableCellColSpan']))
-
- mcopen = regex['x'].sub(str(span), TAGS['_tableCellMulticolOpen'])
- multicol.append(mcopen)
- else:
- cspan.append('')
-
- if colindex < ncolumns and align != self.colalign[colindex]:
- mcopen = regex['x'].sub('1', TAGS['_tableCellMulticolOpen'])
- multicol.append(mcopen)
- else:
- multicol.append('')
-
- if not self.border:
- multicol[-1] = multicol[-1].replace(calignsep, '')
-
- colindex += span
-
- # Maybe is it a title row?
- if rowdata['title']:
- open_ = TAGS['tableTitleCellOpen'] or open_
- close = TAGS['tableTitleCellClose'] or close
- sep = TAGS['tableTitleCellSep'] or sep
-
- # Should we break the line on *each* table cell?
- if rules['breaktablecell']: close = close+'\n'
-
- # Cells pre processing
- if rules['tablecellstrip']:
- cells = [x.strip() for x in cells]
- if rowdata['title'] and rules['tabletitlerowinbold']:
- cells = [enclose_me('fontBold',x) for x in cells]
-
- # Add cell BEGIN/END tags
- for cell in cells:
- copen = open_
- cclose = close
- # Make sure we will pop from some filled lists
- # Fixes empty line bug '| |'
- this_align = this_span = this_mcopen = ''
- if calign: this_align = calign.pop(0)
- if cspan : this_span = cspan.pop(0)
- if multicol: this_mcopen = multicol.pop(0)
-
- # Insert cell align into open tag (if cell is alignable)
- if rules['tablecellaligntype'] == 'cell':
- copen = regex['_tableCellAlign'].sub(
- this_align, copen)
-
- # Insert cell span into open tag (if cell is spannable)
- if rules['tablecellspannable']:
- copen = regex['_tableCellColSpan'].sub(
- this_span, copen)
-
- # Use multicol tags instead (if multicol supported, and if
- # cell has a span or is aligned differently to column)
- if rules['tablecellmulticol']:
- if this_mcopen:
- copen = regex['_tableColAlign'].sub(this_align, this_mcopen)
- cclose = TAGS['_tableCellMulticolClose']
-
- row.append(copen + cell + cclose)
-
- # Maybe there are cell separators?
- return sep.join(row)
-
- def add_row(self, cells):
- self.rows.append(cells)
-
- def parse_row(self, line):
- # Default table properties
- ret = {
- 'border':0, 'title':0, 'align':'Left',
- 'cells':[], 'cellalign':[], 'cellspan':[]
- }
- # Detect table align (and remove spaces mark)
- if line[0] == ' ': ret['align'] = 'Center'
- line = line.lstrip()
- # Detect title mark
- if line[1] == '|': ret['title'] = 1
- # Detect border mark and normalize the EOL
- m = re.search(' (\|+) *$', line)
- if m: line = line+' ' ; ret['border'] = 1
- else: line = line+' | '
- # Delete table mark
- line = regex['table'].sub('', line)
- # Detect colspan | foo | bar baz |||
- line = re.sub(' (\|+)\| ', '\a\\1 | ', line)
- # Split cells (the last is fake)
- ret['cells'] = line.split(' | ')[:-1]
- # Find cells span
- ret['cellspan'] = self._get_cell_span(ret['cells'])
- # Remove span ID
- ret['cells'] = [re.sub('\a\|+$','',x) for x in ret['cells']]
- # Find cells align
- ret['cellalign'] = self._get_cell_align(ret['cells'])
- # Hooray!
- Debug('Table Prop: %s' % ret, 7)
- return ret
-
- def dump(self):
- open_ = self._get_open_tag()
- rows = self.rows
- close = TAGS['tableClose']
-
- rowopen = TAGS['tableRowOpen']
- rowclose = TAGS['tableRowClose']
- rowsep = TAGS['tableRowSep']
- titrowopen = TAGS['tableTitleRowOpen'] or rowopen
- titrowclose = TAGS['tableTitleRowClose'] or rowclose
-
- if rules['breaktablelineopen']:
- rowopen = rowopen + '\n'
- titrowopen = titrowopen + '\n'
-
- # Tex gotchas
- if TARGET == 'tex':
- if not self.border:
- rowopen = titrowopen = ''
- else:
- close = rowopen + close
-
- # Now we tag all the table cells on each row
- #tagged_cells = map(lambda x: self._tag_cells(x), rows) #!py15
- tagged_cells = []
- for cell in rows: tagged_cells.append(self._tag_cells(cell))
-
- # Add row separator tags between lines
- tagged_rows = []
- if rowsep:
- #!py15
- #tagged_rows = map(lambda x:x+rowsep, tagged_cells)
- for cell in tagged_cells:
- tagged_rows.append(cell+rowsep)
- # Remove last rowsep, because the table is over
- tagged_rows[-1] = tagged_rows[-1].replace(rowsep, '')
- # Add row BEGIN/END tags for each line
- else:
- for rowdata in rows:
- if rowdata['title']:
- o,c = titrowopen, titrowclose
- else:
- o,c = rowopen, rowclose
- row = tagged_cells.pop(0)
- tagged_rows.append(o + row + c)
-
- # Join the pieces together
- fulltable = []
- if open_: fulltable.append(open_)
- fulltable.extend(tagged_rows)
- if close: fulltable.append(close)
-
- return fulltable
-
-
-##############################################################################
-
-
-class BlockMaster:
- "TIP: use blockin/out to add/del holders"
- def __init__(self):
- self.BLK = []
- self.HLD = []
- self.PRP = []
- self.depth = 0
- self.count = 0
- self.last = ''
- self.tableparser = None
- self.contains = {
- 'para' :['comment','raw','tagged'],
- 'verb' :[],
- 'table' :['comment'],
- 'raw' :[],
- 'tagged' :[],
- 'comment' :[],
- 'quote' :['quote','comment','raw','tagged'],
- 'list' :['list','numlist','deflist','para','verb','comment','raw','tagged'],
- 'numlist' :['list','numlist','deflist','para','verb','comment','raw','tagged'],
- 'deflist' :['list','numlist','deflist','para','verb','comment','raw','tagged'],
- 'bar' :[],
- 'title' :[],
- 'numtitle':[],
- }
- self.allblocks = list(self.contains.keys())
-
- # If one is found inside another, ignore the marks
- self.exclusive = ['comment','verb','raw','tagged']
-
- # May we include bars inside quotes?
- if rules['barinsidequote']:
- self.contains['quote'].append('bar')
-
- def block(self):
- if not self.BLK: return ''
- return self.BLK[-1]
-
- def isblock(self, name=''):
- return self.block() == name
-
- def prop(self, key):
- if not self.PRP: return ''
- return self.PRP[-1].get(key) or ''
-
- def propset(self, key, val):
- self.PRP[-1][key] = val
- #Debug('BLOCK prop ++: %s->%s'%(key,repr(val)), 1)
- #Debug('BLOCK props: %s'%(repr(self.PRP)), 1)
-
- def hold(self):
- if not self.HLD: return []
- return self.HLD[-1]
-
- def holdadd(self, line):
- if self.block().endswith('list'): line = [line]
- self.HLD[-1].append(line)
- Debug('HOLD add: %s'%repr(line), 4)
- Debug('FULL HOLD: %s'%self.HLD, 4)
-
- def holdaddsub(self, line):
- self.HLD[-1][-1].append(line)
- Debug('HOLD addsub: %s'%repr(line), 4)
- Debug('FULL HOLD: %s'%self.HLD, 4)
-
- def holdextend(self, lines):
- if self.block().endswith('list'): lines = [lines]
- self.HLD[-1].extend(lines)
- Debug('HOLD extend: %s'%repr(lines), 4)
- Debug('FULL HOLD: %s'%self.HLD, 4)
-
- def blockin(self, block):
- ret = []
- if block not in self.allblocks:
- Error("Invalid block '%s'"%block)
-
- # First, let's close other possible open blocks
- while self.block() and block not in self.contains[self.block()]:
- ret.extend(self.blockout())
-
- # Now we can gladly add this new one
- self.BLK.append(block)
- self.HLD.append([])
- self.PRP.append({})
- self.count += 1
- if block == 'table': self.tableparser = TableMaster()
- # Deeper and deeper
- self.depth = len(self.BLK)
- Debug('block ++ (%s): %s' % (block,self.BLK), 3)
- return ret
-
- def blockout(self):
- global AA_COUNT
-
- if not self.BLK: Error('No block to pop')
- blockname = self.BLK.pop()
- result = getattr(self, blockname)()
- parsed = self.HLD.pop()
- self.PRP.pop()
- self.depth = len(self.BLK)
- if blockname == 'table': del self.tableparser
-
- # Inserting a nested block into mother
- if self.block():
- if blockname != 'comment': # ignore comment blocks
- if self.block().endswith('list'):
- self.HLD[-1][-1].append(result)
- else:
- self.HLD[-1].append(result)
- # Reset now. Mother block will have it all
- result = []
-
- Debug('block -- (%s): %s' % (blockname,self.BLK), 3)
- Debug('RELEASED (%s): %s' % (blockname,parsed), 3)
-
- # Save this top level block name (produced output)
- # The next block will use it
- if result:
- self.last = blockname
- Debug('BLOCK: %s'%result, 6)
-
- # ASCII Art processing
- if TARGET == 'art' and CONF['slides'] and not CONF['toc-only'] and not CONF.get('art-no-title'):
- n = (CONF['height'] - 1) - (AA_COUNT % (CONF['height'] - 1) + 1)
- if n < len(result) and not (TITLE.level == 1 and blockname in ["title", "numtitle"]):
- result = ([''] * n) + [aa_line(AA['bar1'], CONF['width'])] + aa_slide(AA_TITLE, CONF['width']) + [''] + result
- if blockname in ["title", "numtitle"] and TITLE.level == 1:
- aa_title = aa_slide(AA_TITLE, CONF['width']) + ['']
- if AA_COUNT:
- aa_title = ([''] * n) + [aa_line(AA['bar2'], CONF['width'])] + aa_title
- result = aa_title + result
- AA_COUNT += len(result)
-
- return result
-
- def _last_escapes(self, line):
- return doFinalEscape(TARGET, line)
-
- def _get_escaped_hold(self):
- ret = []
- for line in self.hold():
- linetype = type(line)
- if isinstance('', linetype):
- ret.append(self._last_escapes(line))
- elif isinstance([], linetype):
- ret.extend(line)
- else:
- Error("BlockMaster: Unknown HOLD item type: %s" % linetype)
- return ret
-
- def _remove_twoblanks(self, lastitem):
- if len(lastitem) > 1 and lastitem[-2:] == ['','']:
- return lastitem[:-2]
- return lastitem
-
- def _should_add_blank_line(self, where, blockname):
- "Validates the blanksaround* rules"
-
- # Nestable blocks: only mother blocks (level 1) are spaced
- if blockname.endswith('list') and self.depth > 1:
- return False
-
- # The blank line after the block is always added
- if where == 'after' \
- and rules['blanksaround'+blockname]:
- return True
-
- # # No blank before if it's the first block of the body
- # elif where == 'before' \
- # and BLOCK.count == 1:
- # return False
-
- # # No blank before if it's the first block of this level (nested)
- # elif where == 'before' \
- # and self.count == 1:
- # return False
-
- # The blank line before the block is only added if
- # the previous block haven't added a blank line
- # (to avoid consecutive blanks)
- elif where == 'before' \
- and rules['blanksaround'+blockname] \
- and not rules.get('blanksaround'+self.last):
- return True
-
- # Nested quotes are handled here,
- # because the mother quote isn't closed yet
- elif where == 'before' \
- and blockname == 'quote' \
- and rules['blanksaround'+blockname] \
- and self.depth > 1:
- return True
-
- return False
-
- def comment(self):
- return ''
-
- def raw(self):
- lines = self.hold()
- return [doEscape(TARGET, x) for x in lines]
-
- def tagged(self):
- return self.hold()
-
- def para(self):
- result = []
- open_ = TAGS['paragraphOpen']
- close = TAGS['paragraphClose']
- lines = self._get_escaped_hold()
-
- # Blank line before?
- if self._should_add_blank_line('before', 'para'): result.append('')
-
- # Open tag
- if open_: result.append(open_)
-
- # Pagemaker likes a paragraph as a single long line
- if rules['onelinepara']:
- result.append(' '.join(lines))
- # Others are normal :)
- else:
- result.extend(lines)
-
- # Close tag
- if close: result.append(close)
-
- # Blank line after?
- if self._should_add_blank_line('after', 'para'): result.append('')
-
- # Very very very very very very very very very UGLY fix
- # Needed because can't appear inside
- try:
- if len(lines) == 1 and \
- TARGET in ('html', 'xhtml') and \
- re.match('^\s*
.* \s*$', lines[0]):
- result = [lines[0]]
- except: pass
-
- return result
-
- def verb(self):
- "Verbatim lines are not masked, so there's no need to unmask"
- result = []
- open_ = TAGS['blockVerbOpen']
- close = TAGS['blockVerbClose']
-
- # Blank line before?
- if self._should_add_blank_line('before', 'verb'): result.append('')
-
- # Open tag
- if open_: result.append(open_)
-
- # Get contents
- for line in self.hold():
- if self.prop('mapped') == 'table':
- line = MacroMaster().expand(line)
- if not rules['verbblocknotescaped']:
- line = doEscape(TARGET,line)
- if rules['indentverbblock']:
- line = ' '+line
- if rules['verbblockfinalescape']:
- line = doFinalEscape(TARGET, line)
- result.append(line)
-
- # Close tag
- if close: result.append(close)
-
- # Blank line after?
- if self._should_add_blank_line('after', 'verb'): result.append('')
-
- return result
-
- def numtitle(self): return self.title('numtitle')
- def title(self, name='title'):
- result = []
-
- # Blank line before?
- if self._should_add_blank_line('before', name): result.append('')
-
- # Get contents
- result.extend(TITLE.get())
-
- # Blank line after?
- if self._should_add_blank_line('after', name): result.append('')
-
- return result
-
- def table(self):
- result = []
-
- # Blank line before?
- if self._should_add_blank_line('before', 'table'): result.append('')
-
- # Rewrite all table cells by the unmasked and escaped data
- lines = self._get_escaped_hold()
- for i in range(len(lines)):
- cells = lines[i].split(SEPARATOR)
- self.tableparser.rows[i]['cells'] = cells
- result.extend(self.tableparser.dump())
-
- # Blank line after?
- if self._should_add_blank_line('after', 'table'): result.append('')
-
- return result
-
- def quote(self):
- result = []
- open_ = TAGS['blockQuoteOpen'] # block based
- close = TAGS['blockQuoteClose']
- qline = TAGS['blockQuoteLine'] # line based
- indent = tagindent = '\t'*self.depth
-
- # Apply rules
- if rules['tagnotindentable']: tagindent = ''
- if not rules['keepquoteindent']: indent = ''
-
- # Blank line before?
- if self._should_add_blank_line('before', 'quote'): result.append('')
-
- # Open tag
- if open_: result.append(tagindent+open_)
-
- # Get contents
- for item in self.hold():
- if isinstance(item, type([])):
- result.extend(item) # subquotes
- else:
- item = regex['quote'].sub('', item) # del TABs
- item = self._last_escapes(item)
- item = qline*self.depth + item
- result.append(indent+item) # quote line
-
- # Close tag
- if close: result.append(tagindent+close)
-
- # Blank line after?
- if self._should_add_blank_line('after', 'quote'): result.append('')
-
- return result
-
- def bar(self):
- result = []
- bar_tag = ''
-
- # Blank line before?
- if self._should_add_blank_line('before', 'bar'): result.append('')
-
- # Get the original bar chars
- bar_chars = self.hold()[0].strip()
-
- # Set bar type
- if bar_chars.startswith('='): bar_tag = TAGS['bar2']
- else : bar_tag = TAGS['bar1']
-
- # To avoid comment tag confusion like (sgml)
- if TAGS['comment'].count('--'):
- bar_chars = bar_chars.replace('--', '__')
-
- # Get the bar tag (may contain \a)
- result.append(regex['x'].sub(bar_chars, bar_tag))
-
- # Blank line after?
- if self._should_add_blank_line('after', 'bar'): result.append('')
-
- return result
-
- def deflist(self): return self.list('deflist')
- def numlist(self): return self.list('numlist')
- def list(self, name='list'):
- result = []
- items = self.hold()
- indent = self.prop('indent')
- tagindent = indent
- listline = TAGS.get(name+'ItemLine')
- itemcount = 0
-
- if name == 'deflist':
- itemopen = TAGS[name+'Item1Open']
- itemclose = TAGS[name+'Item2Close']
- itemsep = TAGS[name+'Item1Close']+\
- TAGS[name+'Item2Open']
- else:
- itemopen = TAGS[name+'ItemOpen']
- itemclose = TAGS[name+'ItemClose']
- itemsep = ''
-
- # Apply rules
- if rules['tagnotindentable']: tagindent = ''
- if not rules['keeplistindent']: indent = tagindent = ''
-
- # ItemLine: number of leading chars identifies list depth
- if listline:
- itemopen = listline*self.depth + itemopen
-
- # Adds trailing space on opening tags
- if (name == 'list' and rules['spacedlistitemopen']) or \
- (name == 'numlist' and rules['spacednumlistitemopen']):
- itemopen = itemopen + ' '
-
- # Remove two-blanks from list ending mark, to avoid
- items[-1] = self._remove_twoblanks(items[-1])
-
- # Blank line before?
- if self._should_add_blank_line('before', name): result.append('')
-
- # Tag each list item (multiline items), store in listbody
- itemopenorig = itemopen
- listbody = []
- widelist = 0
- for item in items:
-
- # Add "manual" item count for noautonum targets
- itemcount += 1
- if name == 'numlist' and not rules['autonumberlist']:
- n = str(itemcount)
- itemopen = regex['x'].sub(n, itemopenorig)
- del n
-
- # Tag it
- item[0] = self._last_escapes(item[0])
- if name == 'deflist':
- z,term,rest = item[0].split(SEPARATOR, 2)
- item[0] = rest
- if not item[0]: del item[0] # to avoid
- listbody.append(tagindent+itemopen+term+itemsep)
- else:
- fullitem = tagindent+itemopen
- listbody.append(item[0].replace(SEPARATOR, fullitem))
- del item[0]
-
- # Process next lines for this item (if any)
- for line in item:
- if isinstance(line, type([])): # sublist inside
- listbody.extend(line)
- else:
- line = self._last_escapes(line)
-
- # Blank lines turns to
- if not line and rules['parainsidelist']:
- line = indent + TAGS['paragraphOpen'] + TAGS['paragraphClose']
- line = line.rstrip()
- widelist = 1
-
- # Some targets don't like identation here (wiki)
- if not rules['keeplistindent'] or (name == 'deflist' and rules['deflisttextstrip']):
- line = line.lstrip()
-
- # Maybe we have a line prefix to add? (wiki)
- if name == 'deflist' and TAGS['deflistItem2LinePrefix']:
- line = TAGS['deflistItem2LinePrefix'] + line
-
- listbody.append(line)
-
- # Close item (if needed)
- if itemclose: listbody.append(tagindent+itemclose)
-
- if not widelist and rules['compactlist']:
- listopen = TAGS.get(name+'OpenCompact')
- listclose = TAGS.get(name+'CloseCompact')
- else:
- listopen = TAGS.get(name+'Open')
- listclose = TAGS.get(name+'Close')
-
- # Open list (not nestable lists are only opened at mother)
- if listopen and not \
- (rules['listnotnested'] and BLOCK.depth != 1):
- result.append(tagindent+listopen)
-
- result.extend(listbody)
-
- # Close list (not nestable lists are only closed at mother)
- if listclose and not \
- (rules['listnotnested'] and self.depth != 1):
- result.append(tagindent+listclose)
-
- # Blank line after?
- if self._should_add_blank_line('after', name): result.append('')
-
- return result
-
-
-##############################################################################
-
-
-class MacroMaster:
- def __init__(self, config={}):
- self.name = ''
- self.config = config or CONF
- self.infile = self.config['sourcefile']
- self.outfile = self.config['outfile']
- self.currdate = time.localtime(time.time())
- self.rgx = regex.get('macros') or getRegexes()['macros']
- self.fileinfo = { 'infile': None, 'outfile': None }
- self.dft_fmt = MACROS
-
- def walk_file_format(self, fmt):
- "Walks the %%{in/out}file format string, expanding the % flags"
- i = 0; ret = '' # counter/hold
- while i < len(fmt): # char by char
- c = fmt[i]; i += 1
- if c == '%': # hot char!
- if i == len(fmt): # % at the end
- ret = ret + c
- break
- c = fmt[i]; i += 1 # read next
- ret = ret + self.expand_file_flag(c)
- else:
- ret = ret +c # common char
- return ret
-
- def expand_file_flag(self, flag):
- "%f: filename %F: filename (w/o extension)"
- "%d: dirname %D: dirname (only parent dir)"
- "%p: file path %e: extension"
- info = self.fileinfo[self.name] # get dict
- if flag == '%': x = '%' # %% -> %
- elif flag == 'f': x = info['name']
- elif flag == 'F': x = re.sub('\.[^.]*$','',info['name'])
- elif flag == 'd': x = info['dir']
- elif flag == 'D': x = os.path.split(info['dir'])[-1]
- elif flag == 'p': x = info['path']
- elif flag == 'e': x = re.search('.(\.([^.]+))?$', info['name']).group(2) or ''
- #TODO simpler way for %e ?
- else : x = '%'+flag # false alarm
- return x
-
- def set_file_info(self, macroname):
- if self.fileinfo.get(macroname): return # already done
- file_ = getattr(self, self.name) # self.infile
- if file_ == STDOUT or file_ == MODULEOUT:
- dir_ = ''
- path = name = file_
- else:
- path = os.path.abspath(file_)
- dir_ = os.path.dirname(path)
- name = os.path.basename(path)
- self.fileinfo[macroname] = {'path':path,'dir':dir_,'name':name}
-
- def expand(self, line=''):
- "Expand all macros found on the line"
- while self.rgx.search(line):
- m = self.rgx.search(line)
- name = self.name = m.group('name').lower()
- fmt = m.group('fmt') or self.dft_fmt.get(name)
- if name == 'date':
- txt = time.strftime(fmt,self.currdate)
- elif name == 'mtime':
- if self.infile in (STDIN, MODULEIN):
- fdate = self.currdate
- else:
- mtime = os.path.getmtime(self.infile)
- fdate = time.localtime(mtime)
- txt = time.strftime(fmt,fdate)
- elif name == 'infile' or name == 'outfile':
- self.set_file_info(name)
- txt = self.walk_file_format(fmt)
- else:
- Error("Unknown macro name '%s'"%name)
- line = self.rgx.sub(txt,line,1)
- return line
-
-
-##############################################################################
-
-
-def listTargets():
- """list all available targets"""
- targets = sorted(TARGETS)
- for target in targets:
- print("%s\t%s" % (target, TARGET_NAMES.get(target)))
-
-def dumpConfig(source_raw, parsed_config):
- onoff = {1:_('ON'), 0:_('OFF')}
- data = [
- (_('RC file') , RC_RAW ),
- (_('source document'), source_raw ),
- (_('command line') , CMDLINE_RAW)
- ]
- # First show all RAW data found
- for label, cfg in data:
- print(_('RAW config for %s')%label)
- for target,key,val in cfg:
- target = '(%s)'%target
- key = dotted_spaces("%-14s"%key)
- val = val or _('ON')
- print(' %-8s %s: %s'%(target,key,val))
- print()
- # Then the parsed results of all of them
- print(_('Full PARSED config'))
- for key in sorted( parsed_config.keys() ):
- val = parsed_config[key]
- # Filters are the last
- if key == 'preproc' or key == 'postproc':
- continue
- # Flag beautifier
- if key in FLAGS.keys() or key in ACTIONS.keys():
- val = onoff.get(val) or val
- # List beautifier
- if isinstance(val, type([])):
- if key == 'options': sep = ' '
- else : sep = ', '
- val = sep.join(val)
- print("%25s: %s"%(dotted_spaces("%-14s"%key),val))
- print()
- print(_('Active filters'))
- for filter_ in ['preproc', 'postproc']:
- for rule in parsed_config.get(filter_) or []:
- print("%25s: %s -> %s" % (
- dotted_spaces("%-14s"%filter_), rule[0], rule[1]))
-
-
-def get_file_body(file_):
- "Returns all the document BODY lines"
- return process_source_file(file_, noconf=1)[1][2]
-
-
-def finish_him(outlist, config):
- "Writing output to screen or file"
- outfile = config['outfile']
- outlist = unmaskEscapeChar(outlist)
- outlist = expandLineBreaks(outlist)
-
- # Apply PostProc filters
- if config['postproc']:
- filters = compile_filters(config['postproc'],
- _('Invalid PostProc filter regex'))
- postoutlist = []
- errmsg = _('Invalid PostProc filter replacement')
- for line in outlist:
- for rgx,repl in filters:
- try: line = rgx.sub(repl, line)
- except: Error("%s: '%s'"%(errmsg, repl))
- postoutlist.append(line)
- outlist = postoutlist[:]
-
- if outfile == MODULEOUT:
- return outlist
- elif outfile == STDOUT:
- if GUI:
- return outlist, config
- else:
- for line in outlist: print(line)
- else:
- Savefile(outfile, addLineBreaks(outlist))
- if not GUI and not QUIET:
- print(_('%s wrote %s')%(my_name,outfile))
-
- if config['split']:
- if not QUIET: print("--- html...")
- sgml2html = 'sgml2html -s %s -l %s %s' % (
- config['split'], config['lang'] or lang, outfile)
- if not QUIET: print("Running system command:", sgml2html)
- os.system(sgml2html)
-
-
-def toc_inside_body(body, toc, config):
- ret = []
- if AUTOTOC: return body # nothing to expand
- toc_mark = MaskMaster().tocmask
- # Expand toc mark with TOC contents
- for line in body:
- if line.count(toc_mark): # toc mark found
- if config['toc']:
- ret.extend(toc) # include if --toc
- else:
- pass # or remove %%toc line
- else:
- ret.append(line) # common line
- return ret
-
-def toc_tagger(toc, config):
- "Returns the tagged TOC, as a single tag or a tagged list"
- ret = []
- # Convert the TOC list (t2t-marked) to the target's list format
- if config['toc-only'] or (config['toc'] and not TAGS['TOC']):
- fakeconf = config.copy()
- fakeconf['headers'] = 0
- fakeconf['toc-only'] = 0
- fakeconf['mask-email'] = 0
- fakeconf['preproc'] = []
- fakeconf['postproc'] = []
- fakeconf['css-sugar'] = 0
- fakeconf['art-no-title'] = 1 # needed for --toc and --slides together, avoids slide title before TOC
- ret,foo = convert(toc, fakeconf)
- set_global_config(config) # restore config
- # Our TOC list is not needed, the target already knows how to do a TOC
- elif config['toc'] and TAGS['TOC']:
- ret = [TAGS['TOC']]
- return ret
-
-def toc_formatter(toc, config):
- "Formats TOC for automatic placement between headers and body"
-
- if config['toc-only']: return toc # no formatting needed
- if not config['toc'] : return [] # TOC disabled
- ret = toc
-
- # Art: An automatic "Table of Contents" header is added to the TOC slide
- if config['target'] == 'art' and config['slides']:
- n = (config['height'] - 1) - (len(toc) + 6) % (config['height'] - 1)
- toc = aa_slide(_("Table of Contents"), config['width']) + toc + ([''] * n)
- toc.append(aa_line(AA['bar2'], config['width']))
- return toc
-
- # TOC open/close tags (if any)
- if TAGS['tocOpen' ]: ret.insert(0, TAGS['tocOpen'])
- if TAGS['tocClose']: ret.append(TAGS['tocClose'])
-
- # Autotoc specific formatting
- if AUTOTOC:
- if rules['autotocwithbars']: # TOC between bars
- para = TAGS['paragraphOpen']+TAGS['paragraphClose']
- bar = regex['x'].sub('-' * DFT_TEXT_WIDTH, TAGS['bar1'])
- tocbar = [para, bar, para]
- if config['target'] == 'art' and config['headers']:
- # exception: header already printed a bar
- ret = [para] + ret + tocbar
- else:
- ret = tocbar + ret + tocbar
- if rules['blankendautotoc']: # blank line after TOC
- ret.append('')
- if rules['autotocnewpagebefore']: # page break before TOC
- ret.insert(0,TAGS['pageBreak'])
- if rules['autotocnewpageafter']: # page break after TOC
- ret.append(TAGS['pageBreak'])
- return ret
-
-
-def doHeader(headers, config):
- if not config['headers']: return []
- if not headers: headers = ['','','']
- target = config['target']
- if target not in HEADER_TEMPLATE:
- Error("doHeader: Unknown target '%s'"%target)
-
- if target in ('html','xhtml') and config.get('css-sugar'):
- template = HEADER_TEMPLATE[target+'css'].split('\n')
- else:
- template = HEADER_TEMPLATE[target].split('\n')
-
- head_data = {'STYLE':[], 'ENCODING':''}
- for key in head_data.keys():
- val = config.get(key.lower())
- # Remove .sty extension from each style filename (freaking tex)
- # XXX Can't handle --style foo.sty,bar.sty
- if target == 'tex' and key == 'STYLE':
- val = [re.sub('(?i)\.sty$','',x) for x in val]
- if key == 'ENCODING':
- val = get_encoding_string(val, target)
- head_data[key] = val
- # Parse header contents
- for i in 0,1,2:
- # Expand macros
- contents = MacroMaster(config=config).expand(headers[i])
- # Escapes - on tex, just do it if any \tag{} present
- if target != 'tex' or \
- (target == 'tex' and re.search(r'\\\w+{', contents)):
- contents = doEscape(target, contents)
- if target == 'lout':
- contents = doFinalEscape(target, contents)
-
- head_data['HEADER%d'%(i+1)] = contents
-
- # css-inside removes STYLE line
- #XXX In tex, this also removes the modules call (%!style:amsfonts)
- if target in ('html','xhtml') and config.get('css-inside') and \
- config.get('style'):
- head_data['STYLE'] = []
-
- Debug("Header Data: %s"%head_data, 1)
-
- # ASCII Art does not use a header template, aa_header() formats the header
- if target == 'art':
- n_h = len([v for v in head_data if v.startswith("HEADER") and head_data[v]])
- if not n_h :
- return []
- if config['slides']:
- x = config['height'] - 3 - (n_h * 3)
- n = x / (n_h + 1)
- end = x % (n_h + 1)
- template = aa_header(head_data, config['width'], n, end)
- else:
- template = [''] + aa_header(head_data, config['width'], 2, 0)
- # Header done, let's get out
- return template
-
- # Scan for empty dictionary keys
- # If found, scan template lines for that key reference
- # If found, remove the reference
- # If there isn't any other key reference on the same line, remove it
- #TODO loop by template line > key
- for key in head_data.keys():
- if head_data.get(key): continue
- for line in template:
- if line.count('%%(%s)s'%key):
- sline = line.replace('%%(%s)s'%key, '')
- if not re.search(r'%\([A-Z0-9]+\)s', sline):
- template.remove(line)
- # Style is a multiple tag.
- # - If none or just one, use default template
- # - If two or more, insert extra lines in a loop (and remove original)
- styles = head_data['STYLE']
- if len(styles) == 1:
- head_data['STYLE'] = styles[0]
- elif len(styles) > 1:
- style_mark = '%(STYLE)s'
- for i in range(len(template)):
- if template[i].count(style_mark):
- while styles:
- template.insert(i+1, template[i].replace(style_mark, styles.pop()))
- del template[i]
- break
- # Populate template with data (dict expansion)
- template = '\n'.join(template) % head_data
-
- # Adding CSS contents into template (for --css-inside)
- # This code sux. Dirty++
- if target in ('html','xhtml') and config.get('css-inside') and \
- config.get('style'):
- set_global_config(config) # usually on convert(), needed here
- for i in range(len(config['style'])):
- cssfile = config['style'][i]
- if not os.path.isabs(cssfile):
- infile = config.get('sourcefile')
- cssfile = os.path.join(
- os.path.dirname(infile), cssfile)
- try:
- contents = Readfile(cssfile, 1)
- css = "\n%s\n%s\n%s\n%s\n" % (
- doCommentLine("Included %s" % cssfile),
- TAGS['cssOpen'],
- '\n'.join(contents),
- TAGS['cssClose'])
- # Style now is content, needs escaping (tex)
- #css = maskEscapeChar(css)
- except:
- errmsg = "CSS include failed for %s" % cssfile
- css = "\n%s\n" % (doCommentLine(errmsg))
- # Insert this CSS file contents on the template
- template = re.sub('(?i)()', css+r'\1', template)
- # template = re.sub(r'(?i)(\\begin{document})',
- # css+'\n'+r'\1', template) # tex
-
- # The last blank line to keep everything separated
- template = re.sub('(?i)()', '\n'+r'\1', template)
-
- return template.split('\n')
-
-def doCommentLine(txt):
- # The -- string ends a (h|sg|xht)ml comment :(
- txt = maskEscapeChar(txt)
- if TAGS['comment'].count('--') and txt.count('--'):
- txt = re.sub('-(?=-)', r'-\\', txt)
-
- if TAGS['comment']:
- return regex['x'].sub(txt, TAGS['comment'])
- return ''
-
-def doFooter(config):
- ret = []
-
- # No footer. The --no-headers option hides header AND footer
- if not config['headers']:
- return []
-
- # Only add blank line before footer if last block doesn't added by itself
- if not rules.get('blanksaround'+BLOCK.last):
- ret.append('')
-
- # Add txt2tags info at footer, if target supports comments
- if TAGS['comment']:
-
- # Not using TARGET_NAMES because it's i18n'ed.
- # It's best to always present this info in english.
- target = config['target']
- if config['target'] == 'tex':
- target = 'LaTeX2e'
-
- t2t_version = '%s code generated by %s %s (%s)' % (target, my_name, my_version, my_url)
- cmdline = 'cmdline: %s %s' % (my_name, ' '.join(config['realcmdline']))
-
- ret.append(doCommentLine(t2t_version))
- ret.append(doCommentLine(cmdline))
-
- # Maybe we have a specific tag to close the document?
- if TAGS['EOD']:
- ret.append(TAGS['EOD'])
-
- return ret
-
-def doEscape(target,txt):
- "Target-specific special escapes. Apply *before* insert any tag."
- tmpmask = 'vvvvThisEscapingSuxvvvv'
- if target in ('html','sgml','xhtml','dbk'):
- txt = re.sub('&','&',txt)
- txt = re.sub('<','<',txt)
- txt = re.sub('>','>',txt)
- if target == 'sgml':
- txt = re.sub('\xff','ÿ',txt) # "+y
- elif target == 'pm6':
- txt = re.sub('<','<\#60>',txt)
- elif target == 'mgp':
- txt = re.sub('^%',' %',txt) # add leading blank to avoid parse
- elif target == 'man':
- txt = re.sub("^([.'])", '\\&\\1',txt) # command ID
- txt = txt.replace(ESCCHAR, ESCCHAR+'e') # \e
- elif target == 'lout':
- # TIP: / moved to FinalEscape to avoid //italic//
- # TIP: these are also converted by lout: ... --- --
- txt = txt.replace(ESCCHAR, tmpmask) # \
- txt = txt.replace('"', '"%s""'%ESCCHAR) # "\""
- txt = re.sub('([|&{}@#^~])', '"\\1"', txt) # "@"
- txt = txt.replace(tmpmask, '"%s"'%(ESCCHAR*2)) # "\\"
- elif target == 'tex':
- # Mark literal \ to be changed to $\backslash$ later
- txt = txt.replace(ESCCHAR, tmpmask)
- txt = re.sub('([#$&%{}])', ESCCHAR+r'\1' , txt) # \%
- txt = re.sub('([~^])' , ESCCHAR+r'\1{}', txt) # \~{}
- txt = re.sub('([<|>])' , r'$\1$', txt) # $>$
- txt = txt.replace(tmpmask, maskEscapeChar(r'$\backslash$'))
- # TIP the _ is escaped at the end
- return txt
-
-# TODO man: where - really needs to be escaped?
-def doFinalEscape(target, txt):
- "Last escapes of each line"
- if target == 'pm6' : txt = txt.replace(ESCCHAR+'<', r'<\#92><')
- elif target == 'man' : txt = txt.replace('-', r'\-')
- elif target == 'sgml': txt = txt.replace('[', '[')
- elif target == 'lout': txt = txt.replace('/', '"/"')
- elif target == 'tex' :
- txt = txt.replace('_', r'\_')
- txt = txt.replace('vvvvTexUndervvvv', '_') # shame!
- return txt
-
-def EscapeCharHandler(action, data):
- "Mask/Unmask the Escape Char on the given string"
- if not data.strip(): return data
- if action not in ('mask','unmask'):
- Error("EscapeCharHandler: Invalid action '%s'"%action)
- if action == 'mask': return data.replace('\\', ESCCHAR)
- else: return data.replace(ESCCHAR, '\\')
-
-def maskEscapeChar(data):
- "Replace any Escape Char \ with a text mask (Input: str or list)"
- if isinstance(data, type([])):
- return [EscapeCharHandler('mask', x) for x in data]
- return EscapeCharHandler('mask',data)
-
-def unmaskEscapeChar(data):
- "Undo the Escape char \ masking (Input: str or list)"
- if isinstance(data, type([])):
- return [EscapeCharHandler('unmask', x) for x in data]
- return EscapeCharHandler('unmask',data)
-
-def addLineBreaks(mylist):
- "use LB to respect sys.platform"
- ret = []
- for line in mylist:
- line = line.replace('\n', LB) # embedded \n's
- ret.append(line+LB) # add final line break
- return ret
-
-# Convert ['foo\nbar'] to ['foo', 'bar']
-def expandLineBreaks(mylist):
- ret = []
- for line in mylist:
- ret.extend(line.split('\n'))
- return ret
-
-def compile_filters(filters, errmsg='Filter'):
- if filters:
- for i in range(len(filters)):
- patt,repl = filters[i]
- try: rgx = re.compile(patt)
- except: Error("%s: '%s'"%(errmsg, patt))
- filters[i] = (rgx,repl)
- return filters
-
-def enclose_me(tagname, txt):
- return TAGS.get(tagname+'Open') + txt + TAGS.get(tagname+'Close')
-
-def beautify_me(name, line):
- "where name is: bold, italic, underline or strike"
-
- # Exception: Doesn't parse an horizontal bar as strike
- if name == 'strike' and regex['bar'].search(line): return line
-
- name = 'font%s' % name.capitalize()
- open_ = TAGS['%sOpen'%name]
- close = TAGS['%sClose'%name]
- txt = r'%s\1%s'%(open_, close)
- line = regex[name].sub(txt,line)
- return line
-
-def get_tagged_link(label, url):
- ret = ''
- target = CONF['target']
- image_re = regex['img']
-
- # Set link type
- if regex['email'].match(url):
- linktype = 'email'
- else:
- linktype = 'url';
-
- # Escape specials from TEXT parts
- label = doEscape(target,label)
-
- # Escape specials from link URL
- if not rules['linkable'] or rules['escapeurl']:
- url = doEscape(target, url)
-
- # Adding protocol to guessed link
- guessurl = ''
- if linktype == 'url' and \
- re.match('(?i)'+regex['_urlskel']['guess'], url):
- if url[0] in 'Ww': guessurl = 'http://' +url
- else : guessurl = 'ftp://' +url
-
- # Not link aware targets -> protocol is useless
- if not rules['linkable']: guessurl = ''
-
- # Simple link (not guessed)
- if not label and not guessurl:
- if CONF['mask-email'] and linktype == 'email':
- # Do the email mask feature (no TAGs, just text)
- url = url.replace('@', ' (a) ')
- url = url.replace('.', ' ')
- url = "<%s>" % url
- if rules['linkable']: url = doEscape(target, url)
- ret = url
- else:
- # Just add link data to tag
- tag = TAGS[linktype]
- ret = regex['x'].sub(url,tag)
-
- # Named link or guessed simple link
- else:
- # Adjusts for guessed link
- if not label: label = url # no protocol
- if guessurl : url = guessurl # with protocol
-
- # Image inside link!
- if image_re.match(label):
- if rules['imglinkable']: # get image tag
- label = parse_images(label)
- else: # img@link !supported
- label = "(%s)"%image_re.match(label).group(1)
-
- # Putting data on the right appearance order
- if rules['labelbeforelink'] or not rules['linkable']:
- urlorder = [label, url] # label before link
- else:
- urlorder = [url, label] # link before label
-
- # Add link data to tag (replace \a's)
- ret = TAGS["%sMark"%linktype]
- for data in urlorder:
- ret = regex['x'].sub(data,ret,1)
-
- return ret
-
-
-def parse_deflist_term(line):
- "Extract and parse definition list term contents"
- img_re = regex['img']
- term = regex['deflist'].search(line).group(3)
-
- # Mask image inside term as (image.jpg), where not supported
- if not rules['imgasdefterm'] and img_re.search(term):
- while img_re.search(term):
- imgfile = img_re.search(term).group(1)
- term = img_re.sub('(%s)'%imgfile, term, 1)
-
- #TODO tex: escape ] on term. \], \rbrack{} and \verb!]! don't work :(
- return term
-
-
-def get_image_align(line):
- "Return the image (first found) align for the given line"
-
- # First clear marks that can mess align detection
- line = re.sub(SEPARATOR+'$', '', line) # remove deflist sep
- line = re.sub('^'+SEPARATOR, '', line) # remove list sep
- line = re.sub('^[\t]+' , '', line) # remove quote mark
-
- # Get image position on the line
- m = regex['img'].search(line)
- ini = m.start() ; head = 0
- end = m.end() ; tail = len(line)
-
- # The align detection algorithm
- if ini == head and end != tail: align = 'left' # ^img + text$
- elif ini != head and end == tail: align = 'right' # ^text + img$
- else : align = 'center' # default align
-
- # Some special cases
- if BLOCK.isblock('table'): align = 'center' # ignore when table
-# if TARGET == 'mgp' and align == 'center': align = 'center'
-
- return align
-
-
-# Reference: http://www.iana.org/assignments/character-sets
-# http://www.drclue.net/F1.cgi/HTML/META/META.html
-def get_encoding_string(enc, target):
- if not enc: return ''
- # Target specific translation table
- translate = {
- 'tex': {
- # missing: ansinew , applemac , cp437 , cp437de , cp865
- 'utf-8' : 'utf8',
- 'us-ascii' : 'ascii',
- 'windows-1250': 'cp1250',
- 'windows-1252': 'cp1252',
- 'ibm850' : 'cp850',
- 'ibm852' : 'cp852',
- 'iso-8859-1' : 'latin1',
- 'iso-8859-2' : 'latin2',
- 'iso-8859-3' : 'latin3',
- 'iso-8859-4' : 'latin4',
- 'iso-8859-5' : 'latin5',
- 'iso-8859-9' : 'latin9',
- 'koi8-r' : 'koi8-r'
- }
- }
- # Normalization
- enc = re.sub('(?i)(us[-_]?)?ascii|us|ibm367','us-ascii' , enc)
- enc = re.sub('(?i)(ibm|cp)?85([02])' ,'ibm85\\2' , enc)
- enc = re.sub('(?i)(iso[_-]?)?8859[_-]?' ,'iso-8859-' , enc)
- enc = re.sub('iso-8859-($|[^1-9]).*' ,'iso-8859-1', enc)
- # Apply translation table
- try: enc = translate[target][enc.lower()]
- except: pass
- return enc
-
-
-##############################################################################
-##MerryChristmas,IdontwanttofighttonightwithyouImissyourbodyandIneedyourlove##
-##############################################################################
-
-
-def process_source_file(file_='', noconf=0, contents=[]):
- """
- Find and Join all the configuration available for a source file.
- No sanity checking is done on this step.
- It also extracts the source document parts into separate holders.
-
- The config scan order is:
- 1. The user configuration file (i.e. $HOME/.txt2tagsrc)
- 2. The source document's CONF area
- 3. The command line options
-
- The return data is a tuple of two items:
- 1. The parsed config dictionary
- 2. The document's parts, as a (head, conf, body) tuple
-
- All the conversion process will be based on the data and
- configuration returned by this function.
- The source files is read on this step only.
- """
- if contents:
- source = SourceDocument(contents=contents)
- else:
- source = SourceDocument(file_)
- head, conf, body = source.split()
- Message(_("Source document contents stored"),2)
- if not noconf:
- # Read document config
- source_raw = source.get_raw_config()
- # Join all the config directives found, then parse it
- full_raw = RC_RAW + source_raw + CMDLINE_RAW
- Message(_("Parsing and saving all config found (%03d items)") % (len(full_raw)), 1)
- full_parsed = ConfigMaster(full_raw).parse()
- # Add manually the filename to the conf dic
- if contents:
- full_parsed['sourcefile'] = MODULEIN
- full_parsed['infile'] = MODULEIN
- full_parsed['outfile'] = MODULEOUT
- else:
- full_parsed['sourcefile'] = file_
- # Maybe should we dump the config found?
- if full_parsed.get('dump-config'):
- dumpConfig(source_raw, full_parsed)
- Quit()
- # The user just want to know a single config value (hidden feature)
- #TODO pick a better name than --show-config-value
- elif full_parsed.get('show-config-value'):
- config_value = full_parsed.get(full_parsed['show-config-value'])
- if config_value:
- if isinstance(config_value, type([])):
- print('\n'.join(config_value))
- else:
- print(config_value)
- Quit()
- # Okay, all done
- Debug("FULL config for this file: %s"%full_parsed, 1)
- else:
- full_parsed = {}
- return full_parsed, (head,conf,body)
-
-def get_infiles_config(infiles):
- """
- Find and Join into a single list, all configuration available
- for each input file. This function is supposed to be the very
- first one to be called, before any processing.
- """
- return list(map(process_source_file, infiles))
-
-def convert_this_files(configs):
- global CONF
- for myconf,doc in configs: # multifile support
- target_head = []
- target_toc = []
- target_body = []
- target_foot = []
- source_head, source_conf, source_body = doc
- myconf = ConfigMaster().sanity(myconf)
- # Compose the target file Headers
- #TODO escape line before?
- #TODO see exceptions by tex and mgp
- Message(_("Composing target Headers"),1)
- target_head = doHeader(source_head, myconf)
- # Parse the full marked body into tagged target
- first_body_line = (len(source_head) or 1)+ len(source_conf) + 1
- Message(_("Composing target Body"),1)
- target_body, marked_toc = convert(source_body, myconf, firstlinenr=first_body_line)
- # If dump-source, we're done
- if myconf['dump-source']:
- for line in source_head+source_conf+target_body:
- print(line)
- return
-
- # Close the last slide
- if myconf['slides'] and not myconf['toc-only'] and myconf['target'] == 'art':
- n = (myconf['height'] - 1) - (AA_COUNT % (myconf['height'] - 1) + 1)
- target_body = target_body + ([''] * n) + [aa_line(AA['bar2'], myconf['width'])]
-
- # Compose the target file Footer
- Message(_("Composing target Footer"),1)
- target_foot = doFooter(myconf)
-
- # Make TOC (if needed)
- Message(_("Composing target TOC"),1)
- tagged_toc = toc_tagger(marked_toc, myconf)
- target_toc = toc_formatter(tagged_toc, myconf)
- target_body = toc_inside_body(target_body, target_toc, myconf)
- if not AUTOTOC and not myconf['toc-only']: target_toc = []
- # Finally, we have our document
- outlist = target_head + target_toc + target_body + target_foot
- # If on GUI, abort before finish_him
- # If module, return finish_him as list
- # Else, write results to file or STDOUT
- if GUI:
- return outlist, myconf
- elif myconf.get('outfile') == MODULEOUT:
- return finish_him(outlist, myconf), myconf
- else:
- Message(_("Saving results to the output file"),1)
- finish_him(outlist, myconf)
-
-
-def parse_images(line):
- "Tag all images found"
- while regex['img'].search(line) and TAGS['img'] != '[\a]':
- txt = regex['img'].search(line).group(1)
- tag = TAGS['img']
-
- # If target supports image alignment, here we go
- if rules['imgalignable']:
-
- align = get_image_align(line) # right
- align_name = align.capitalize() # Right
-
- # The align is a full tag, or part of the image tag (~A~)
- if TAGS['imgAlign'+align_name]:
- tag = TAGS['imgAlign'+align_name]
- else:
- align_tag = TAGS['_imgAlign'+align_name]
- tag = regex['_imgAlign'].sub(align_tag, tag, 1)
-
- # Dirty fix to allow centered solo images
- if align == 'center' and TARGET in ('html','xhtml'):
- rest = regex['img'].sub('',line,1)
- if re.match('^\s+$', rest):
- tag = "
%s " %tag
-
- if TARGET == 'tex':
- tag = re.sub(r'\\b',r'\\\\b',tag)
- txt = txt.replace('_', 'vvvvTexUndervvvv')
-
- # Ugly hack to avoid infinite loop when target's image tag contains []
- tag = tag.replace('[', 'vvvvEscapeSquareBracketvvvv')
-
- line = regex['img'].sub(tag,line,1)
- line = regex['x'].sub(txt,line,1)
- return line.replace('vvvvEscapeSquareBracketvvvv','[')
-
-
-def add_inline_tags(line):
- # Beautifiers
- for beauti in ('bold', 'italic', 'underline', 'strike'):
- if regex['font%s'%beauti.capitalize()].search(line):
- line = beautify_me(beauti, line)
-
- line = parse_images(line)
- return line
-
-
-def get_include_contents(file_, path=''):
- "Parses %!include: value and extract file contents"
- ids = {'`':'verb', '"':'raw', "'":'tagged' }
- id_ = 't2t'
- # Set include type and remove identifier marks
- mark = file_[0]
- if mark in ids.keys():
- if file_[:2] == file_[-2:] == mark*2:
- id_ = ids[mark] # set type
- file_ = file_[2:-2] # remove marks
- # Handle remote dir execution
- filepath = os.path.join(path, file_)
- # Read included file contents
- lines = Readfile(filepath, remove_linebreaks=1)
- # Default txt2tags marked text, just BODY matters
- if id_ == 't2t':
- lines = get_file_body(filepath)
- #TODO fix images relative path if file has a path, ie.: chapter1/index.t2t (wait until tree parsing)
- #TODO for the images path fix, also respect outfile path, if different from infile (wait until tree parsing)
- lines.insert(0, '%%INCLUDED(%s) starts here: %s'%(id_,file_))
- # This appears when included hit EOF with verbatim area open
- #lines.append('%%INCLUDED(%s) ends here: %s'%(id_,file_))
- return id_, lines
-
-
-def set_global_config(config):
- global CONF, TAGS, regex, rules, TARGET
- CONF = config
- rules = getRules(CONF)
- TAGS = getTags(CONF)
- regex = getRegexes()
- TARGET = config['target'] # save for buggy functions that need global
-
-
-def convert(bodylines, config, firstlinenr=1):
- global BLOCK, TITLE
-
- set_global_config(config)
-
- target = config['target']
- BLOCK = BlockMaster()
- MASK = MaskMaster()
- TITLE = TitleMaster()
-
- ret = []
- dump_source = []
- f_lastwasblank = 0
-
- # Compiling all PreProc regexes
- pre_filter = compile_filters(
- CONF['preproc'], _('Invalid PreProc filter regex'))
-
- # Let's mark it up!
- linenr = firstlinenr-1
- lineref = 0
- while lineref < len(bodylines):
- # Defaults
- MASK.reset()
- results_box = ''
-
- untouchedline = bodylines[lineref]
- dump_source.append(untouchedline)
-
- line = re.sub('[\n\r]+$','',untouchedline) # del line break
-
- # Apply PreProc filters
- if pre_filter:
- errmsg = _('Invalid PreProc filter replacement')
- for rgx,repl in pre_filter:
- try: line = rgx.sub(repl, line)
- except: Error("%s: '%s'"%(errmsg, repl))
-
- line = maskEscapeChar(line) # protect \ char
- linenr += 1
- lineref += 1
-
- Debug(repr(line), 2, linenr) # heavy debug: show each line
-
- #------------------[ Comment Block ]------------------------
-
- # We're already on a comment block
- if BLOCK.block() == 'comment':
-
- # Closing comment
- if regex['blockCommentClose'].search(line):
- ret.extend(BLOCK.blockout() or [])
- continue
-
- # Normal comment-inside line. Ignore it.
- continue
-
- # Detecting comment block init
- if regex['blockCommentOpen'].search(line) \
- and BLOCK.block() not in BLOCK.exclusive:
- ret.extend(BLOCK.blockin('comment'))
- continue
-
- #-------------------------[ Tagged Text ]----------------------
-
- # We're already on a tagged block
- if BLOCK.block() == 'tagged':
-
- # Closing tagged
- if regex['blockTaggedClose'].search(line):
- ret.extend(BLOCK.blockout())
- continue
-
- # Normal tagged-inside line
- BLOCK.holdadd(line)
- continue
-
- # Detecting tagged block init
- if regex['blockTaggedOpen'].search(line) \
- and BLOCK.block() not in BLOCK.exclusive:
- ret.extend(BLOCK.blockin('tagged'))
- continue
-
- # One line tagged text
- if regex['1lineTagged'].search(line) \
- and BLOCK.block() not in BLOCK.exclusive:
- ret.extend(BLOCK.blockin('tagged'))
- line = regex['1lineTagged'].sub('',line)
- BLOCK.holdadd(line)
- ret.extend(BLOCK.blockout())
- continue
-
- #-------------------------[ Raw Text ]----------------------
-
- # We're already on a raw block
- if BLOCK.block() == 'raw':
-
- # Closing raw
- if regex['blockRawClose'].search(line):
- ret.extend(BLOCK.blockout())
- continue
-
- # Normal raw-inside line
- BLOCK.holdadd(line)
- continue
-
- # Detecting raw block init
- if regex['blockRawOpen'].search(line) \
- and BLOCK.block() not in BLOCK.exclusive:
- ret.extend(BLOCK.blockin('raw'))
- continue
-
- # One line raw text
- if regex['1lineRaw'].search(line) \
- and BLOCK.block() not in BLOCK.exclusive:
- ret.extend(BLOCK.blockin('raw'))
- line = regex['1lineRaw'].sub('',line)
- BLOCK.holdadd(line)
- ret.extend(BLOCK.blockout())
- continue
-
- #------------------------[ Verbatim ]----------------------
-
- #TIP We'll never support beautifiers inside verbatim
-
- # Closing table mapped to verb
- if BLOCK.block() == 'verb' \
- and BLOCK.prop('mapped') == 'table' \
- and not regex['table'].search(line):
- ret.extend(BLOCK.blockout())
-
- # We're already on a verb block
- if BLOCK.block() == 'verb':
-
- # Closing verb
- if regex['blockVerbClose'].search(line):
- ret.extend(BLOCK.blockout())
- continue
-
- # Normal verb-inside line
- BLOCK.holdadd(line)
- continue
-
- # Detecting verb block init
- if regex['blockVerbOpen'].search(line) \
- and BLOCK.block() not in BLOCK.exclusive:
- ret.extend(BLOCK.blockin('verb'))
- f_lastwasblank = 0
- continue
-
- # One line verb-formatted text
- if regex['1lineVerb'].search(line) \
- and BLOCK.block() not in BLOCK.exclusive:
- ret.extend(BLOCK.blockin('verb'))
- line = regex['1lineVerb'].sub('',line)
- BLOCK.holdadd(line)
- ret.extend(BLOCK.blockout())
- f_lastwasblank = 0
- continue
-
- # Tables are mapped to verb when target is not table-aware
- if not rules['tableable'] and regex['table'].search(line):
- if not BLOCK.isblock('verb'):
- ret.extend(BLOCK.blockin('verb'))
- BLOCK.propset('mapped', 'table')
- BLOCK.holdadd(line)
- continue
-
- #---------------------[ blank lines ]-----------------------
-
- if regex['blankline'].search(line):
-
- # Close open paragraph
- if BLOCK.isblock('para'):
- ret.extend(BLOCK.blockout())
- f_lastwasblank = 1
- continue
-
- # Close all open tables
- if BLOCK.isblock('table'):
- ret.extend(BLOCK.blockout())
- f_lastwasblank = 1
- continue
-
- # Close all open quotes
- while BLOCK.isblock('quote'):
- ret.extend(BLOCK.blockout())
-
- # Closing all open lists
- if f_lastwasblank: # 2nd consecutive blank
- if BLOCK.block().endswith('list'):
- BLOCK.holdaddsub('') # helps parser
- while BLOCK.depth: # closes list (if any)
- ret.extend(BLOCK.blockout())
- continue # ignore consecutive blanks
-
- # Paragraph (if any) is wanted inside lists also
- if BLOCK.block().endswith('list'):
- BLOCK.holdaddsub('')
-
- f_lastwasblank = 1
- continue
-
-
- #---------------------[ special ]---------------------------
-
- if regex['special'].search(line):
-
- targ, key, val = ConfigLines().parse_line(line, None, target)
-
- if key:
- Debug("Found config '%s', value '%s'" % (key, val), 1, linenr)
- else:
- Debug('Bogus Special Line', 1, linenr)
-
- # %!include command
- if key == 'include':
-
- incpath = os.path.dirname(CONF['sourcefile'])
- incfile = val
- err = _('A file cannot include itself (loop!)')
- if CONF['sourcefile'] == incfile:
- Error("%s: %s"%(err,incfile))
- inctype, inclines = get_include_contents(incfile, incpath)
-
- # Verb, raw and tagged are easy
- if inctype != 't2t':
- ret.extend(BLOCK.blockin(inctype))
- BLOCK.holdextend(inclines)
- ret.extend(BLOCK.blockout())
- else:
- # Insert include lines into body
- #TODO include maxdepth limit
- bodylines = bodylines[:lineref] + inclines + bodylines[lineref:]
- #TODO fix path if include@include
- # Remove %!include call
- if CONF['dump-source']:
- dump_source.pop()
-
- # This line is done, go to next
- continue
-
- # %!csv command
- elif key == 'csv':
-
- if not csv:
- Error("Python module 'csv' not found, but needed for %!csv")
-
- table = []
- filename = val
- reader = csv.reader(Readfile(filename))
-
- # Convert each CSV line to a txt2tags' table line
- # foo,bar,baz -> | foo | bar | baz |
- try:
- for row in reader:
- table.append('| %s |' % ' | '.join(row))
- except csv.Error as e:
- Error('CSV: file %s: %s' % (filename, e))
-
- # Parse and convert the new table
- # Note: cell contents is raw, no t2t marks are parsed
- if rules['tableable']:
- ret.extend(BLOCK.blockin('table'))
- if table:
- BLOCK.tableparser.__init__(table[0])
- for row in table:
- tablerow = TableMaster().parse_row(row)
- BLOCK.tableparser.add_row(tablerow)
-
- # Very ugly, but necessary for escapes
- line = SEPARATOR.join(tablerow['cells'])
- BLOCK.holdadd(doEscape(target, line))
- ret.extend(BLOCK.blockout())
-
- # Tables are mapped to verb when target is not table-aware
- else:
- if target == 'art' and table:
- table = aa_table(table)
- ret.extend(BLOCK.blockin('verb'))
- BLOCK.propset('mapped', 'table')
- for row in table:
- BLOCK.holdadd(row)
- ret.extend(BLOCK.blockout())
-
- # This line is done, go to next
- continue
-
- #---------------------[ dump-source ]-----------------------
-
- # We don't need to go any further
- if CONF['dump-source']:
- continue
-
- #---------------------[ Comments ]--------------------------
-
- # Just skip them (if not macro)
- if regex['comment'].search(line) and not \
- regex['macros'].match(line) and not \
- regex['toc'].match(line):
- continue
-
- #---------------------[ Triggers ]--------------------------
-
- # Valid line, reset blank status
- f_lastwasblank = 0
-
- # Any NOT quote line closes all open quotes
- if BLOCK.isblock('quote') and not regex['quote'].search(line):
- while BLOCK.isblock('quote'):
- ret.extend(BLOCK.blockout())
-
- # Any NOT table line closes an open table
- if BLOCK.isblock('table') and not regex['table'].search(line):
- ret.extend(BLOCK.blockout())
-
-
- #---------------------[ Horizontal Bar ]--------------------
-
- if regex['bar'].search(line):
-
- # Bars inside quotes are handled on the Quote processing
- # Otherwise we parse the bars right here
- #
- if not (BLOCK.isblock('quote') or regex['quote'].search(line)) \
- or (BLOCK.isblock('quote') and not rules['barinsidequote']):
-
- # Close all the opened blocks
- ret.extend(BLOCK.blockin('bar'))
-
- # Extract the bar chars (- or =)
- m = regex['bar'].search(line)
- bar_chars = m.group(2)
-
- # Process and dump the tagged bar
- BLOCK.holdadd(bar_chars)
- ret.extend(BLOCK.blockout())
- Debug("BAR: %s"%line, 6)
-
- # We're done, nothing more to process
- continue
-
-
- #---------------------[ Title ]-----------------------------
-
- if (regex['title'].search(line) or regex['numtitle'].search(line)) \
- and not BLOCK.block().endswith('list'):
-
- if regex['title'].search(line):
- name = 'title'
- else:
- name = 'numtitle'
-
- # Close all the opened blocks
- ret.extend(BLOCK.blockin(name))
-
- # Process title
- TITLE.add(line)
- ret.extend(BLOCK.blockout())
-
- # We're done, nothing more to process
- continue
-
- #---------------------[ %%toc ]-----------------------
-
- # %%toc line closes paragraph
- if BLOCK.block() == 'para' and regex['toc'].search(line):
- ret.extend(BLOCK.blockout())
-
- #---------------------[ apply masks ]-----------------------
-
- line = MASK.mask(line)
-
- #XXX from here, only block-inside lines will pass
-
- #---------------------[ Quote ]-----------------------------
-
- if regex['quote'].search(line):
-
- # Store number of leading TABS
- quotedepth = len(regex['quote'].search(line).group(0))
-
- # SGML doesn't support nested quotes
- if rules['quotenotnested']: quotedepth = 1
-
- # Don't cross depth limit
- maxdepth = rules['quotemaxdepth']
- if maxdepth and quotedepth > maxdepth:
- quotedepth = maxdepth
-
- # New quote
- if not BLOCK.isblock('quote'):
- ret.extend(BLOCK.blockin('quote'))
-
- # New subquotes
- while BLOCK.depth < quotedepth:
- BLOCK.blockin('quote')
-
- # Closing quotes
- while quotedepth < BLOCK.depth:
- ret.extend(BLOCK.blockout())
-
- # Bar inside quote
- if regex['bar'].search(line) and rules['barinsidequote']:
- tempBlock = BlockMaster()
- tagged_bar = []
- tagged_bar.extend(tempBlock.blockin('bar'))
- tempBlock.holdadd(line)
- tagged_bar.extend(tempBlock.blockout())
- BLOCK.holdextend(tagged_bar)
- continue
-
- #---------------------[ Lists ]-----------------------------
-
- # An empty item also closes the current list
- if BLOCK.block().endswith('list'):
- m = regex['listclose'].match(line)
- if m:
- listindent = m.group(1)
- listtype = m.group(2)
- currlisttype = BLOCK.prop('type')
- currlistindent = BLOCK.prop('indent')
- if listindent == currlistindent and \
- listtype == currlisttype:
- ret.extend(BLOCK.blockout())
- continue
-
- if regex['list'].search(line) or \
- regex['numlist'].search(line) or \
- regex['deflist'].search(line):
-
- listindent = BLOCK.prop('indent')
- listids = ''.join(LISTNAMES.keys())
- m = re.match('^( *)([%s]) '%listids, line)
- listitemindent = m.group(1)
- listtype = m.group(2)
- listname = LISTNAMES[listtype]
- results_box = BLOCK.holdadd
-
- # Del list ID (and separate term from definition)
- if listname == 'deflist':
- term = parse_deflist_term(line)
- line = regex['deflist'].sub(
- SEPARATOR+term+SEPARATOR,line)
- else:
- line = regex[listname].sub(SEPARATOR,line)
-
- # Don't cross depth limit
- maxdepth = rules['listmaxdepth']
- if maxdepth and BLOCK.depth == maxdepth:
- if len(listitemindent) > len(listindent):
- listitemindent = listindent
-
- # List bumping (same indent, diff mark)
- # Close the currently open list to clear the mess
- if BLOCK.block().endswith('list') \
- and listname != BLOCK.block() \
- and len(listitemindent) == len(listindent):
- ret.extend(BLOCK.blockout())
- listindent = BLOCK.prop('indent')
-
- # Open mother list or sublist
- if not BLOCK.block().endswith('list') or \
- len(listitemindent) > len(listindent):
- ret.extend(BLOCK.blockin(listname))
- BLOCK.propset('indent',listitemindent)
- BLOCK.propset('type',listtype)
-
- # Closing sublists
- while len(listitemindent) < len(BLOCK.prop('indent')):
- ret.extend(BLOCK.blockout())
-
- # O-oh, sublist before list ("\n\n - foo\n- foo")
- # Fix: close sublist (as mother), open another list
- if not BLOCK.block().endswith('list'):
- ret.extend(BLOCK.blockin(listname))
- BLOCK.propset('indent',listitemindent)
- BLOCK.propset('type',listtype)
-
- #---------------------[ Table ]-----------------------------
-
- #TODO escape undesired format inside table
- #TODO add pm6 target
- if regex['table'].search(line):
-
- if not BLOCK.isblock('table'): # first table line!
- ret.extend(BLOCK.blockin('table'))
- BLOCK.tableparser.__init__(line)
-
- tablerow = TableMaster().parse_row(line)
- BLOCK.tableparser.add_row(tablerow) # save config
-
- # Maintain line to unmask and inlines
- # XXX Bug: | **bo | ld** | turns **bo\x01ld** and gets converted :(
- # TODO isolate unmask+inlines parsing to use here
- line = SEPARATOR.join(tablerow['cells'])
-
- #---------------------[ Paragraph ]-------------------------
-
- if not BLOCK.block() and \
- not line.count(MASK.tocmask): # new para!
- ret.extend(BLOCK.blockin('para'))
-
-
- ############################################################
- ############################################################
- ############################################################
-
-
- #---------------------[ Final Parses ]----------------------
-
- # The target-specific special char escapes for body lines
- line = doEscape(target,line)
-
- line = add_inline_tags(line)
- line = MASK.undo(line)
-
-
- #---------------------[ Hold or Return? ]-------------------
-
- ### Now we must choose where to put the parsed line
- #
- if not results_box:
- # List item extra lines
- if BLOCK.block().endswith('list'):
- results_box = BLOCK.holdaddsub
- # Other blocks
- elif BLOCK.block():
- results_box = BLOCK.holdadd
- # No blocks
- else:
- line = doFinalEscape(target, line)
- results_box = ret.append
-
- results_box(line)
-
- # EOF: close any open para/verb/lists/table/quotes
- Debug('EOF',7)
- while BLOCK.block():
- ret.extend(BLOCK.blockout())
-
- # Maybe close some opened title area?
- if rules['titleblocks']:
- ret.extend(TITLE.close_all())
-
- # Maybe a major tag to enclose body? (like DIV for CSS)
- if TAGS['bodyOpen' ]: ret.insert(0, TAGS['bodyOpen'])
- if TAGS['bodyClose']: ret.append(TAGS['bodyClose'])
-
- if CONF['toc-only']: ret = []
- marked_toc = TITLE.dump_marked_toc(CONF['toc-level'])
-
- # If dump-source, all parsing is ignored
- if CONF['dump-source']: ret = dump_source[:]
-
- return ret, marked_toc
-
-
-
-##############################################################################
-################################### GUI ######################################
-##############################################################################
-#
-# Tk help: http://python.org/topics/tkinter/
-# Tuto: http://ibiblio.org/obp/py4fun/gui/tkPhone.html
-# /usr/lib/python*/lib-tk/Tkinter.py
-#
-# grid table : row=0, column=0, columnspan=2, rowspan=2
-# grid align : sticky='n,s,e,w' (North, South, East, West)
-# pack place : side='top,bottom,right,left'
-# pack fill : fill='x,y,both,none', expand=1
-# pack align : anchor='n,s,e,w' (North, South, East, West)
-# padding : padx=10, pady=10, ipadx=10, ipady=10 (internal)
-# checkbox : offvalue is return if the _user_ deselected the box
-# label align: justify=left,right,center
-
-def load_GUI_resources():
- "Load all extra modules and methods used by GUI"
- global askopenfilename, showinfo, showwarning, showerror, tkinter
- from tkinter.filedialog import askopenfilename
- from tkinter.messagebox import showinfo,showwarning,showerror
- import tkinter
-
-class Gui:
- "Graphical Tk Interface"
- def __init__(self, conf={}):
- self.root = tkinter.Tk() # mother window, come to butthead
- self.root.title(my_name) # window title bar text
- self.window = self.root # variable "focus" for inclusion
- self.row = 0 # row count for grid()
-
- self.action_length = 150 # left column length (pixel)
- self.frame_margin = 10 # frame margin size (pixel)
- self.frame_border = 6 # frame border size (pixel)
-
- # The default Gui colors, can be changed by %!guicolors
- self.dft_gui_colors = ['#6c6','white','#cf9','#030']
- self.gui_colors = []
- self.bg1 = self.fg1 = self.bg2 = self.fg2 = ''
-
- # On Tk, vars need to be set/get using setvar()/get()
- self.infile = self.setvar('')
- self.target = self.setvar('')
- self.target_name = self.setvar('')
-
- # The checks appearance order
- self.checks = [
- 'headers', 'enum-title', 'toc', 'mask-email', 'toc-only', 'stdout'
- ]
-
- # Creating variables for all checks
- for check in self.checks:
- setattr(self, 'f_'+check, self.setvar(''))
-
- # Load RC config
- self.conf = {}
- if conf: self.load_config(conf)
-
- def load_config(self, conf):
- self.conf = conf
- self.gui_colors = conf.get('guicolors') or self.dft_gui_colors
- self.bg1, self.fg1, self.bg2, self.fg2 = self.gui_colors
- self.root.config(bd=15,bg=self.bg1)
-
- ### Config as dic for python 1.5 compat (**opts don't work :( )
- def entry(self, **opts): return tkinter.Entry(self.window, opts)
- def label(self, txt='', bg=None, **opts):
- opts.update({'text':txt,'bg':bg or self.bg1})
- return tkinter.Label(self.window, opts)
- def button(self,name,cmd,**opts):
- opts.update({'text':name,'command':cmd})
- return tkinter.Button(self.window, opts)
- def check(self,name,checked=0,**opts):
- bg, fg = self.bg2, self.fg2
- opts.update({
- 'text':name,
- 'onvalue':1,
- 'offvalue':0,
- 'activeforeground':fg,
- 'activebackground':bg,
- 'highlightbackground':bg,
- 'fg':fg,
- 'bg':bg,
- 'anchor':'w'
- })
- chk = tkinter.Checkbutton(self.window, opts)
- if checked: chk.select()
- chk.grid(columnspan=2, sticky='w', padx=0)
- def menu(self,sel,items):
- return tkinter.OptionMenu(*(self.window,sel)+tuple(items))
-
- # Handy auxiliary functions
- def action(self, txt):
- self.label(
- txt,
- fg=self.fg1,
- bg=self.bg1,
- wraplength=self.action_length).grid(column=0,row=self.row)
- def frame_open(self):
- self.window = tkinter.Frame(
- self.root,
- bg=self.bg2,
- borderwidth=self.frame_border)
- def frame_close(self):
- self.window.grid(
- column=1,
- row=self.row,
- sticky='w',
- padx=self.frame_margin)
- self.window = self.root
- self.label('').grid()
- self.row += 2 # update row count
- def target_name2key(self):
- name = self.target_name.get()
- target = [x for x in TARGETS if TARGET_NAMES[x] == name]
- try : key = target[0]
- except: key = ''
- self.target = self.setvar(key)
- def target_key2name(self):
- key = self.target.get()
- name = TARGET_NAMES.get(key) or key
- self.target_name = self.setvar(name)
-
- def exit(self): self.root.destroy()
- def setvar(self, val): z = tkinter.StringVar() ; z.set(val) ; return z
-
- def askfile(self):
- ftypes= [(_('txt2tags files'), ('*.t2t','*.txt')), (_('All files'),'*')]
- newfile = askopenfilename(filetypes=ftypes)
- if newfile:
- self.infile.set(newfile)
- newconf = process_source_file(newfile)[0]
- newconf = ConfigMaster().sanity(newconf, gui=1)
- # Restate all checkboxes after file selection
- #TODO how to make a refresh without killing it?
- self.root.destroy()
- self.__init__(newconf)
- self.mainwindow()
-
- def scrollwindow(self, txt='no text!', title=''):
- # Create components
- win = tkinter.Toplevel() ; win.title(title)
- frame = tkinter.Frame(win)
- scroll = tkinter.Scrollbar(frame)
- text = tkinter.Text(frame,yscrollcommand=scroll.set)
- button = tkinter.Button(win)
- # Config
- text.insert(tkinter.END, '\n'.join(txt))
- scroll.config(command=text.yview)
- button.config(text=_('Close'), command=win.destroy)
- button.focus_set()
- # Packing
- text.pack(side='left', fill='both', expand=1)
- scroll.pack(side='right', fill='y')
- frame.pack(fill='both', expand=1)
- button.pack(ipadx=30)
-
- def runprogram(self):
- global CMDLINE_RAW
- # Prepare
- self.target_name2key()
- infile, target = self.infile.get(), self.target.get()
- # Sanity
- if not target:
- showwarning(my_name,_("You must select a target type!"))
- return
- if not infile:
- showwarning(my_name,_("You must provide the source file location!"))
- return
- # Compose cmdline
- guiflags = []
- real_cmdline_conf = ConfigMaster(CMDLINE_RAW).parse()
- if 'infile' in real_cmdline_conf:
- del real_cmdline_conf['infile']
- if 'target' in real_cmdline_conf:
- del real_cmdline_conf['target']
- real_cmdline = CommandLine().compose_cmdline(real_cmdline_conf)
- default_outfile = ConfigMaster().get_outfile_name(
- {'sourcefile':infile, 'outfile':'', 'target':target})
- for opt in self.checks:
- val = int(getattr(self, 'f_%s'%opt).get() or "0")
- if opt == 'stdout': opt = 'outfile'
- on_config = self.conf.get(opt) or 0
- on_cmdline = real_cmdline_conf.get(opt) or 0
- if opt == 'outfile':
- if on_config == STDOUT: on_config = 1
- else: on_config = 0
- if on_cmdline == STDOUT: on_cmdline = 1
- else: on_cmdline = 0
- if val != on_config or (
- val == on_config == on_cmdline and
- opt in real_cmdline_conf):
- if val:
- # Was not set, but user selected on GUI
- Debug("user turned ON: %s"%opt)
- if opt == 'outfile': opt = '-o-'
- else: opt = '--%s'%opt
- else:
- # Was set, but user deselected on GUI
- Debug("user turned OFF: %s"%opt)
- if opt == 'outfile':
- opt = "-o%s"%default_outfile
- else: opt = '--no-%s'%opt
- guiflags.append(opt)
- cmdline = [my_name, '-t', target] + real_cmdline + guiflags + [infile]
- Debug('Gui/Tk cmdline: %s' % cmdline, 5)
- # Run!
- cmdline_raw_orig = CMDLINE_RAW
- try:
- # Fake the GUI cmdline as the real one, and parse file
- CMDLINE_RAW = CommandLine().get_raw_config(cmdline[1:])
- data = process_source_file(infile)
- # On GUI, convert_* returns the data, not finish_him()
- outlist, config = convert_this_files([data])
- # On GUI and STDOUT, finish_him() returns the data
- result = finish_him(outlist, config)
- # Show outlist in s a nice new window
- if result:
- outlist, config = result
- title = _('%s: %s converted to %s') % (
- my_name,
- os.path.basename(infile),
- config['target'].upper())
- self.scrollwindow(outlist, title)
- # Show the "file saved" message
- else:
- msg = "%s\n\n %s\n%s\n\n %s\n%s"%(
- _('Conversion done!'),
- _('FROM:'), infile,
- _('TO:'), config['outfile'])
- showinfo(my_name, msg)
- except error: # common error (windowed), not quit
- pass
- except: # fatal error (windowed and printed)
- errormsg = getUnknownErrorMessage()
- print(errormsg)
- showerror(_('%s FATAL ERROR!')%my_name,errormsg)
- self.exit()
- CMDLINE_RAW = cmdline_raw_orig
-
- def mainwindow(self):
- self.infile.set(self.conf.get('sourcefile') or '')
- self.target.set(self.conf.get('target') or _('-- select one --'))
- outfile = self.conf.get('outfile')
- if outfile == STDOUT: # map -o-
- self.conf['stdout'] = 1
- if self.conf.get('headers') == None:
- self.conf['headers'] = 1 # map default
-
- action1 = _("Enter the source file location:")
- action2 = _("Choose the target document type:")
- action3 = _("Some options you may check:")
- action4 = _("Some extra options:")
- checks_txt = {
- 'headers' : _("Include headers on output"),
- 'enum-title': _("Number titles (1, 1.1, 1.1.1, etc)"),
- 'toc' : _("Do TOC also (Table of Contents)"),
- 'mask-email': _("Hide e-mails from SPAM robots"),
-
- 'toc-only' : _("Just do TOC, nothing more"),
- 'stdout' : _("Dump to screen (Don't save target file)")
- }
- targets_menu = [TARGET_NAMES[x] for x in TARGETS]
-
- # Header
- self.label("%s %s"%(my_name.upper(), my_version),
- bg=self.bg2, fg=self.fg2).grid(columnspan=2, ipadx=10)
- self.label(_("ONE source, MULTI targets")+'\n%s\n'%my_url,
- bg=self.bg1, fg=self.fg1).grid(columnspan=2)
- self.row = 2
- # Choose input file
- self.action(action1) ; self.frame_open()
- e_infile = self.entry(textvariable=self.infile,width=25)
- e_infile.grid(row=self.row, column=0, sticky='e')
- if not self.infile.get(): e_infile.focus_set()
- self.button(_("Browse"), self.askfile).grid(
- row=self.row, column=1, sticky='w', padx=10)
- # Show outfile name, style and encoding (if any)
- txt = ''
- if outfile:
- txt = outfile
- if outfile == STDOUT: txt = _('')
- l_output = self.label(_('Output: ')+txt, fg=self.fg2, bg=self.bg2)
- l_output.grid(columnspan=2, sticky='w')
- for setting in ['style','encoding']:
- if self.conf.get(setting):
- name = setting.capitalize()
- val = self.conf[setting]
- self.label('%s: %s'%(name, val),
- fg=self.fg2, bg=self.bg2).grid(
- columnspan=2, sticky='w')
- # Choose target
- self.frame_close() ; self.action(action2)
- self.frame_open()
- self.target_key2name()
- self.menu(self.target_name, targets_menu).grid(
- columnspan=2, sticky='w')
- # Options checkboxes label
- self.frame_close() ; self.action(action3)
- self.frame_open()
- # Compose options check boxes, example:
- # self.check(checks_txt['toc'],1,variable=self.f_toc)
- for check in self.checks:
- # Extra options label
- if check == 'toc-only':
- self.frame_close() ; self.action(action4)
- self.frame_open()
- txt = checks_txt[check]
- var = getattr(self, 'f_'+check)
- checked = self.conf.get(check)
- self.check(txt,checked,variable=var)
- self.frame_close()
- # Spacer and buttons
- self.label('').grid() ; self.row += 1
- b_quit = self.button(_("Quit"), self.exit)
- b_quit.grid(row=self.row, column=0, sticky='w', padx=30)
- b_conv = self.button(_("Convert!"), self.runprogram)
- b_conv.grid(row=self.row, column=1, sticky='e', padx=30)
- if self.target.get() and self.infile.get():
- b_conv.focus_set()
-
- # As documentation told me
- if sys.platform.startswith('win'):
- self.root.iconify()
- self.root.update()
- self.root.deiconify()
-
- self.root.mainloop()
-
-
-##############################################################################
-##############################################################################
-
-def exec_command_line(user_cmdline=[]):
- global CMDLINE_RAW, RC_RAW, DEBUG, VERBOSE, QUIET, GUI, Error
-
- # Extract command line data
- cmdline_data = user_cmdline or sys.argv[1:]
- CMDLINE_RAW = CommandLine().get_raw_config(cmdline_data, relative=1)
- cmdline_parsed = ConfigMaster(CMDLINE_RAW).parse()
- DEBUG = cmdline_parsed.get('debug' ) or 0
- VERBOSE = cmdline_parsed.get('verbose') or 0
- QUIET = cmdline_parsed.get('quiet' ) or 0
- GUI = cmdline_parsed.get('gui' ) or 0
- infiles = cmdline_parsed.get('infile' ) or []
-
- Message(_("Txt2tags %s processing begins")%my_version,1)
-
- # The easy ones
- if cmdline_parsed.get('help' ): Quit(USAGE)
- if cmdline_parsed.get('version'): Quit(VERSIONSTR)
- if cmdline_parsed.get('targets'):
- listTargets()
- Quit()
-
- # Multifile haters
- if len(infiles) > 1:
- errmsg=_("Option --%s can't be used with multiple input files")
- for option in NO_MULTI_INPUT:
- if cmdline_parsed.get(option):
- Error(errmsg%option)
-
- Debug("system platform: %s"%sys.platform)
- Debug("python version: %s"%(sys.version.split('(')[0]))
- Debug("line break char: %s"%repr(LB))
- Debug("command line: %s"%sys.argv)
- Debug("command line raw config: %s"%CMDLINE_RAW,1)
-
- # Extract RC file config
- if cmdline_parsed.get('rc') == 0:
- Message(_("Ignoring user configuration file"),1)
- else:
- rc_file = get_rc_path()
- if os.path.isfile(rc_file):
- Message(_("Loading user configuration file"),1)
- RC_RAW = ConfigLines(file_=rc_file).get_raw_config()
-
- Debug("rc file: %s"%rc_file)
- Debug("rc file raw config: %s"%RC_RAW,1)
-
- # Get all infiles config (if any)
- infiles_config = get_infiles_config(infiles)
-
- # Is GUI available?
- # Try to load and start GUI interface for --gui
- if GUI:
- try:
- load_GUI_resources()
- Debug("GUI resources OK (Tk module is installed)")
- winbox = Gui()
- Debug("GUI display OK")
- GUI = 1
- except:
- Debug("GUI Error: no Tk module or no DISPLAY")
- GUI = 0
-
- # User forced --gui, but it's not available
- if cmdline_parsed.get('gui') and not GUI:
- print(getTraceback()); print()
- Error(
- "Sorry, I can't run my Graphical Interface - GUI\n"
- "- Check if Python Tcl/Tk module is installed (Tkinter)\n"
- "- Make sure you are in a graphical environment (like X)")
-
- # Okay, we will use GUI
- if GUI:
- Message(_("We are on GUI interface"),1)
-
- # Redefine Error function to raise exception instead sys.exit()
- def Error(msg):
- showerror(_('txt2tags ERROR!'), msg)
- raise error
-
- # If no input file, get RC+cmdline config, else full config
- if not infiles:
- gui_conf = ConfigMaster(RC_RAW+CMDLINE_RAW).parse()
- else:
- try : gui_conf = infiles_config[0][0]
- except: gui_conf = {}
-
- # Sanity is needed to set outfile and other things
- gui_conf = ConfigMaster().sanity(gui_conf, gui=1)
- Debug("GUI config: %s"%gui_conf,5)
-
- # Insert config and populate the nice window!
- winbox.load_config(gui_conf)
- winbox.mainwindow()
-
- # Console mode rocks forever!
- else:
- Message(_("We are on Command Line interface"),1)
-
- # Called with no arguments, show error
- # TODO#1: this checking should be only in ConfigMaster.sanity()
- if not infiles:
- Error(_('Missing input file (try --help)') + '\n\n' +
- _('Please inform an input file (.t2t) at the end of the command.') + '\n' +
- _('Example:') + ' %s -t html %s' % (my_name, _('file.t2t')))
-
- convert_this_files(infiles_config)
-
- Message(_("Txt2tags finished successfully"),1)
-
-if __name__ == '__main__':
- try:
- exec_command_line()
- except error as msg:
- sys.stderr.write("%s\n"%msg)
- sys.stderr.flush()
- sys.exit(1)
- except SystemExit:
- pass
- except:
- sys.stderr.write(getUnknownErrorMessage())
- sys.stderr.flush()
- sys.exit(1)
- Quit()
-
-# The End.