Attachment 'xml.py'
Download 1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - XML Source Parser
4
5 @copyright: 2005 by Davin Dubeau <davin.dubeau@gmail.com>
6 @license: GNU GPL, see COPYING for details.
7
8 @modified by Andrew Seigner <siggy@hotmail.com>
9
10 """
11
12 from MoinMoin.util.ParserBase import ParserBase
13
14 Dependencies = []
15
16 class Parser(ParserBase):
17
18 parsername = "ColorizedXML"
19 extensions = ['.xml']
20 Dependencies = []
21
22 def setupRules(self):
23 ParserBase.setupRules(self)
24
25 #self.addRulePair("Comment","<!--","-->")
26 #self.addRule("Number",r"[0-9]+")
27 #self.addRule("SPChar","[=<>/\"]")
28 #self.addRule("ResWord","(?!<)[\w\s]*(?![\w=\"])?(?![\w\s\.<])+(?!>)*")
29
30 # new rules
31
32 # tags
33 self.addRulePair("ConsWord","<","[\s>]")
34
35 # end tags
36 self.addRule("ConsWord",">")
37
38 # attributes in quotes
39 self.addRulePair("SPChar","[\"]","[\"]")
40
41 # special characters
42 self.addRule("ResWord","[=/\"]")
43
44 # comments
45 self.addRulePair("Comment","<!--","-->")
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.