draft-freed-sieve-in-xml-06.txt   draft-freed-sieve-in-xml-07.txt 
Network Working Group N. Freed Network Working Group N. Freed
Internet-Draft S. Vedam Internet-Draft S. Vedam
Expires: February 14, 2010 Sun Microsystems Expires: April 24, 2010 Sun Microsystems
August 13, 2009 October 21, 2009
Sieve Email Filtering: Sieves and display directives in XML Sieve Email Filtering: Sieves and display directives in XML
draft-freed-sieve-in-xml-06 draft-freed-sieve-in-xml-07
Status of this Memo Status of this Memo
This Internet-Draft is submitted to IETF in full conformance with the This Internet-Draft is submitted to IETF in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet- other groups may also distribute working documents as Internet-
Drafts. Drafts.
skipping to change at page 1, line 32 skipping to change at page 1, line 32
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on February 14, 2010. This Internet-Draft will expire on April 24, 2010.
Copyright Notice Copyright Notice
Copyright (c) 2009 IETF Trust and the persons identified as the Copyright (c) 2009 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents in effect on the date of Provisions Relating to IETF Documents in effect on the date of
publication of this document (http://trustee.ietf.org/license-info). publication of this document (http://trustee.ietf.org/license-info).
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
skipping to change at page 3, line 5 skipping to change at page 2, line 50
the use of "*/" in non-Sieve XML content. the use of "*/" in non-Sieve XML content.
Added XML reference. Added XML reference.
Added a list of all presently defined controls, explained how unknown Added a list of all presently defined controls, explained how unknown
controls would be handled. controls would be handled.
Added a note about the need to remove quotes and other syntax Added a note about the need to remove quotes and other syntax
elements when converting to XML. elements when converting to XML.
Added a note about the fact that different front ends employing
different medadata may not interopate with each other.
Added preamble and postamble containers for displaydata, comment, and
external elements in command blocks. This addresses a unique
particle attribution constraint violation in XML schema.
Added information about the MIME loops extension defining two new
controls: foreverypart and break.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Conventions used in this document . . . . . . . . . . . . . . 5 2. Conventions used in this document . . . . . . . . . . . . . . 5
3. Grammatical structure of Sieve . . . . . . . . . . . . . . . . 5 3. Grammatical structure of Sieve . . . . . . . . . . . . . . . . 5
4. XML Representation of Sieve . . . . . . . . . . . . . . . . . 6 4. XML Representation of Sieve . . . . . . . . . . . . . . . . . 7
4.1. XML Display Directives . . . . . . . . . . . . . . . . . . 9 4.1. XML Display Directives . . . . . . . . . . . . . . . . . . 10
4.2. Structured Comments . . . . . . . . . . . . . . . . . . . 10 4.2. Structured Comments . . . . . . . . . . . . . . . . . . . 11
4.3. Validation . . . . . . . . . . . . . . . . . . . . . . . . 11 4.3. Validation . . . . . . . . . . . . . . . . . . . . . . . . 12
5. Security Considerations . . . . . . . . . . . . . . . . . . . 11 5. Security Considerations . . . . . . . . . . . . . . . . . . . 12
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12
7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 13
7.1. Normative References . . . . . . . . . . . . . . . . . . . 12 7.1. Normative References . . . . . . . . . . . . . . . . . . . 13
7.2. Informative References . . . . . . . . . . . . . . . . . . 13 7.2. Informative References . . . . . . . . . . . . . . . . . . 14
Appendix A. Extended Example . . . . . . . . . . . . . . . . . . 13 Appendix A. Extended Example . . . . . . . . . . . . . . . . . . 14
Appendix B. XML Schema for Sieves in XML . . . . . . . . . . . . 21 Appendix B. XML Schema for Sieves in XML . . . . . . . . . . . . 22
Appendix C. Relax NG Schema for Sieves in XML . . . . . . . . . . 24 Appendix C. Relax NG Schema for Sieves in XML . . . . . . . . . . 25
Appendix D. Stylesheet for conversion from XML . . . . . . . . . 25 Appendix D. Stylesheet for conversion from XML . . . . . . . . . 27
Appendix E. Acknowledgements . . . . . . . . . . . . . . . . . . 31 Appendix E. Acknowledgements . . . . . . . . . . . . . . . . . . 33
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 31 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 33
1. Introduction 1. Introduction
Sieve [RFC5228] is a language for filtering email messages at or Sieve [RFC5228] is a language for filtering email messages at or
around the time of final delivery. It is designed to be around the time of final delivery. It is designed to be
implementable on either a mail client or mail server. It is meant to implementable on either a mail client or mail server. It is meant to
be extensible, simple, and independent of access protocol, mail be extensible, simple, and independent of access protocol, mail
architecture, and operating system and it is intended to be architecture, and operating system and it is intended to be
manipulated by a variety of different user interfaces. manipulated by a variety of different user interfaces.
skipping to change at page 4, line 38 skipping to change at page 4, line 38
Another issue with the creation and manipulation of sieve scripts by Another issue with the creation and manipulation of sieve scripts by
user interfaces is that the language is strictly focused on user interfaces is that the language is strictly focused on
describing email filtering operations. The language contains no describing email filtering operations. The language contains no
mechanisms for indicating how a given script should be presented in a mechanisms for indicating how a given script should be presented in a
user interface. Such information can be represented in XML very user interface. Such information can be represented in XML very
easily so it makes sense to define a framework to do this as part of easily so it makes sense to define a framework to do this as part of
the XML format. A structured comment convention is then used to the XML format. A structured comment convention is then used to
retain this information when the script is converted to normal Sieve retain this information when the script is converted to normal Sieve
format. format.
It should be noted, however, that the ability for different front
ends to use the same mapping and storage facilities does not mean
that the additional XML information produced by different front ends
will interoperate.
Various sieve extensions have already been defined, e.g., [RFC5183] Various sieve extensions have already been defined, e.g., [RFC5183]
[RFC5229] [RFC5230] [RFC5231] [RFC5232] [RFC5233] [RFC5235] [RFC5229] [RFC5230] [RFC5231] [RFC5232] [RFC5233] [RFC5235]
[RFC5293], and more are planned. The set of extensions available [RFC5293], and more are planned. The set of extensions available
varies from one implementation to the next and may even change as a varies from one implementation to the next and may even change as a
result of configuration choices. It is therefore essential that the result of configuration choices. It is therefore essential that the
XML representation of Sieve be able to accommodate Sieve extensions XML representation of Sieve be able to accommodate Sieve extensions
without requiring schema changes. It is also desirable that Sieve without requiring schema changes. It is also desirable that Sieve
extensions not require changes to the code that converts to and from extensions not require changes to the code that converts to and from
the XML representation. the XML representation.
skipping to change at page 6, line 35 skipping to change at page 6, line 39
if anyof (not exists ["From", "Date"], if anyof (not exists ["From", "Date"],
header :contains "from" "fool@example.edu") { header :contains "from" "fool@example.edu") {
discard; discard;
} }
Extensions can add new controls, actions, tests, or new arguments to Extensions can add new controls, actions, tests, or new arguments to
existing controls or actions. Extensions have also changed how existing controls or actions. Extensions have also changed how
string content is interpreted, although this is not relevant to this string content is interpreted, although this is not relevant to this
specification. However, it is especially important to note that so specification. However, it is especially important to note that so
far no Sieve extension has added a new control to the language and it far only one of the many defined Sieve extensions - the foreverypart
seems safe to assume that due to their nature future addition of extension [I-D.ietf-sieve-mime-loop] - has added new controls to the
controls will be rare. language. It seems safe to assume that due to their nature future
addition of controls will be relatively rare.
Finally, comments are allowed between lexical elements in a Sieve Finally, comments are allowed between lexical elements in a Sieve
script. Finally, comments are allowed between lexical elements in a script. One important use case for comments is encoding meta-data
Sieve script. One important use case for comments is encoding meta- about the script, a facility which is lacking in the Sieve language.
data about the script, a facility which is lacking in the Sieve Therefore comments need to be preserved in the XML representation.
language. Therefore comments need to be preserved in the XML
representation.
4. XML Representation of Sieve 4. XML Representation of Sieve
Sieve controls and actions are represented in XML as "control" or Sieve controls and actions are represented in XML as "control" or
"action" elements respectively. The command's identifier appears as "action" elements respectively. The command's identifier appears as
a name attribute on the element itself. This is the only attribute a name attribute on the element itself. This is the only attribute
allowed on controls and actions - arguments, tests, test-lists, and allowed on controls and actions - arguments, tests, test-lists, and
nested command blocks are all represented as nested elements. While nested command blocks are all represented as nested elements. While
naming the element after the control or action itself may seem like a naming the element after the control or action itself may seem like a
better choice, doing so would result in extensions requiring better choice, doing so would result in extensions requiring frequent
corresponding schema changes. corresponding schema changes.
The example Sieve controls shown in the previous section would be The example Sieve controls shown in the previous section would be
represented in XML as: represented in XML as:
<control name="stop"/> <control name="stop"/>
<control name="require"><str>fileinto</str></control> <control name="require"><str>fileinto</str></control>
<control name="if"> <control name="if">
<test name="true"/><control name="stop"/> <test name="true"/><control name="stop"/>
</control> </control>
skipping to change at page 7, line 29 skipping to change at page 7, line 35
The example Sieve actions shown above would appear in XML as: The example Sieve actions shown above would appear in XML as:
<action name="discard"/> <action name="discard"/>
<action name="fileinto"><str>folder</str></action> <action name="fileinto"><str>folder</str></action>
The separation of controls from actions in the XML representation The separation of controls from actions in the XML representation
means that conversion from normal Sieve format to XML has to be able means that conversion from normal Sieve format to XML has to be able
to distinguish between controls and actions. This is easily done by to distinguish between controls and actions. This is easily done by
maintaining a list of all known controls since experience indicates maintaining a list of all known controls since experience indicates
new controls are rarely added. At the time of this writing the list new controls are rarely added. At the time of this writing the list
of defined and proposed controls consists of: of defined controls consists of:
1. if [RFC5228], 1. if [RFC5228],
2. stop [RFC5228], 2. stop [RFC5228],
3. require [RFC5228], 3. require [RFC5228],
4. foreverypart [I-D.ietf-sieve-mime-loop], and 4. foreverypart [I-D.ietf-sieve-mime-loop], and
5. break [I-D.ietf-sieve-mime-loop]. 5. break [I-D.ietf-sieve-mime-loop].
It should be noted that with this approach unknown controls will It should be noted that with this approach unknown controls will
simply be treated as actions and can be passed back and forthe simply be treated as actions and can be passed back and forth between
between the two representations. The treatment of a control as an the two representations. The treatment of a control as an action is
aciton is unlikely to cause other issues since knowledge of a unlikely to cause other issues since knowledge of a control's
control's language semantics is almost always required to take of language semantics is almost always required to take of advantage of
advantage of it. it.
Tests are represented in the same basic way as controls and actions, Tests are represented in the same basic way as controls and actions,
that is, as a "test" element with a name attribute giving the test that is, as a "test" element with a name attribute giving the test
identifier. For example: identifier. For example:
<test name="true"/> <test name="true"/>
<test name="envelope"/> <test name="envelope"/>
<str>to</str><str>me@example.com</str> <str>to</str><str>me@example.com</str>
</test> </test>
<test name="header"/> <test name="header"/>
skipping to change at page 9, line 4 skipping to change at page 9, line 20
</test> </test>
</test> </test>
<test name="header"> <test name="header">
<tag>contains</tag> <tag>contains</tag>
<str>from</str> <str>from</str>
<str>fool@example.edu</str> <str>fool@example.edu</str>
</test> </test>
</test> </test>
<action name="discard"/> <action name="discard"/>
</control> </control>
Finally, Sieve comments are mapped to a special "comment" element in
XML. Both hash and bracketed comments are mapped to the same Sieve comments are mapped to a special "comment" element in XML.
construct so the distinction between the two is lost in XML. XML Both hash and bracketed comments are mapped to the same construct so
comments are not used because some XML tools do not make it the distinction between the two is lost in XML. XML comments are not
convenient to access comment nodes. used because some XML tools do not make it convenient to access
comment nodes.
Comments are allowed between commands and inside "test" elements.
But comments aren't allowed directly inside commands - due to
limitations of XML schema special enclosing "preamble" and
"postamble" elements are needed:
<control name="if">
<preamble>
<comment>Check to see if message should be discarded</comment>
</preamble>
<test name="anyof">
<test name="not">
<test name="exists>
<list><str>From</str><str>Date</str></list>
</test>
</test>
<test name="header">
<tag>contains</tag>
<str>from</str>
<str>fool@example.edu</str>
</test>
</test>
<action name="discard"/>
<postamble>
<comment>End of discard check</comment>
</postamble>
</control>
4.1. XML Display Directives 4.1. XML Display Directives
Sometimes graphical user interfaces are a convenient way to provide Sometimes graphical user interfaces are a convenient way to provide
sieve management functions to users. These interfaces typically sieve management functions to users. These interfaces typically
summarize/annotate/group/display sieve script(s) in an intuitive way summarize/annotate/group/display sieve script(s) in an intuitive way
for end users. for end users.
To do this effectively, the graphical user interface may require To do this effectively, the graphical user interface may require
additional information about the sieve script itself. That additional information about the sieve script itself. That
skipping to change at page 10, line 9 skipping to change at page 10, line 52
part of a sieve script is currently totally implementation specific part of a sieve script is currently totally implementation specific
and is usually done by imposing some type of structure on comments. and is usually done by imposing some type of structure on comments.
However, such information can be represented in XML very easily so it However, such information can be represented in XML very easily so it
makes sense to define a framework to do this as part of the XML makes sense to define a framework to do this as part of the XML
format. Implementations MAY choose to use structured comments to format. Implementations MAY choose to use structured comments to
retain this information when the script is converted to normal Sieve retain this information when the script is converted to normal Sieve
format. format.
The sample schemata for the XML representation of Sieve allows XML in The sample schemata for the XML representation of Sieve allows XML in
foreign namespaces to be inserted in most places in Sieve scripts. foreign namespaces to be inserted in the same places "comment"
This is the preferred means of including additional information. elements can appear in Sieve scripts. This is the preferred means of
Alternately, the schema defines two display directives - displayblock including additional information. Alternately, the schema defines
and displaydata - as containers for meta-data needed by graphical two display directives - displayblock and displaydata - as containers
user interfaces. for meta-data needed by graphical user interfaces.
Editors MAY use displayblock, displaydata and foreign namespaces to Editors MAY use displayblock, displaydata and foreign namespaces to
associate meta-data. Some editors find it inconvenient to preserve associate meta-data. Some editors find it inconvenient to preserve
this additional data during an editing session. Editors MAY preserve this additional data during an editing session. Editors MAY preserve
this data during an editing session for compatibility with other this data during an editing session for compatibility with other
editors. editors.
The displayblock element can be used to enclose any number of sieve The displayblock element can be used to enclose any number of sieve
statements at any level. It is semantically meaningless to the sieve statements at any level. It is semantically meaningless to the sieve
script itself. It allows an arbitrary set of attributes. script itself. It allows an arbitrary set of attributes.
skipping to change at page 11, line 37 skipping to change at page 12, line 31
Any syntactically valid sieve script can be represented in XML. Any syntactically valid sieve script can be represented in XML.
Accordingly, all security considerations applicable to Sieve and any Accordingly, all security considerations applicable to Sieve and any
extensions used also apply to the XML representation. extensions used also apply to the XML representation.
The use of XML carries its own security risks. Section 7 of RFC 3470 The use of XML carries its own security risks. Section 7 of RFC 3470
[RFC3470] discusses these risks. [RFC3470] discusses these risks.
It is axiomatic that a Sieve editor must be trusted to do what the It is axiomatic that a Sieve editor must be trusted to do what the
user specifies. If XML formats are used this trust necessarily must user specifies. If XML formats are used this trust necessarily must
extent to the components involved in converting to and from XML extend to the components involved in converting to and from XML
format. format.
Arbitrary data can be included using other namespaces or placed in Arbitrary data can be included using other namespaces or placed in
the extensible displayblock and displaydata constructs defined in the extensible displayblock and displaydata constructs defined in
this specification, possibly including entire scripts and other this specification, possibly including entire scripts and other
executable content in languages other than Sieve. Appropriate executable content in languages other than Sieve. Such material will
security precautions should be taken when using these facilities. necessarily have its own security considerations, which are beyond
the scope of this document.
6. IANA Considerations 6. IANA Considerations
This section registers a new XML namespace per the procedures in RFC This section registers a new XML namespace per the procedures in RFC
3688 [RFC3688]. 3688 [RFC3688].
URI: urn:ietf:params:xml:ns:sieve URI: urn:ietf:params:xml:ns:sieve
Registrant Contact: IETF Sieve working group Registrant Contact: IETF Sieve working group
<ietf-mta-filters@imc.org> <ietf-mta-filters@imc.org>
skipping to change at page 14, line 23 skipping to change at page 15, line 23
Move messages from IETF filter discussion list to filter mailbox Move messages from IETF filter discussion list to filter mailbox
</comment> </comment>
<control name="if"> <control name="if">
<test name="header"> <test name="header">
<tag>is</tag> <tag>is</tag>
<str>Sender</str> <str>Sender</str>
<str>owner-ietf-mta-filters@imc.org</str> <str>owner-ietf-mta-filters@imc.org</str>
</test> </test>
<action name="fileinto"> <action name="fileinto">
<str>filter</str> <str>filter</str>
</action> <comment>move to "filter" mailbox</comment> </action>
<postamb ,le>
<comment>move to "filter" mailbox</comment>
</postamble>
</control> </control>
<comment> <comment>
Keep all messages to or from people in my company Keep all messages to or from people in my company
</comment> </comment>
<control name="elsif"> <control name="elsif">
<test name="address"> <test name="address">
<tag>domain</tag> <tag>domain</tag>
<tag>is</tag> <tag>is</tag>
<list> <list>
skipping to change at page 15, line 25 skipping to change at page 16, line 28
<str>*make*money*fast*</str> <str>*make*money*fast*</str>
<str>*university*dipl*mas*</str> <str>*university*dipl*mas*</str>
</list> </list>
</test> </test>
</test> </test>
<action name="fileinto"> <action name="fileinto">
<str>spam</str> <str>spam</str>
</action> </action>
</control> </control>
<control name="else"> <control name="else">
<comment> <preamble>
Move all other (non-company) mail to "personal" <comment>
mailbox. Move all other (non-company) mail to "personal"
</comment> mailbox.
</comment>
</preamble>
<action name="fileinto"> <action name="fileinto">
<str>personal</str> <str>personal</str>
</action> </action>
</control> </control>
</sieve> </sieve>
The same script could be annotated with graphical display hints in a The same script could be annotated with graphical display hints in a
variety of ways. Three possible code components that do this are: variety of ways. Three possible code components that do this are:
skipping to change at page 22, line 15 skipping to change at page 23, line 15
<xsd:element ref="displaydata"/> <xsd:element ref="displaydata"/>
<xsd:element ref="comment"/> <xsd:element ref="comment"/>
<xsd:any namespace="##other" processContents="lax"/> <xsd:any namespace="##other" processContents="lax"/>
</xsd:choice> </xsd:choice>
</xsd:sequence> </xsd:sequence>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="comment" type="xsd:string"/> <xsd:element name="comment" type="xsd:string"/>
<xsd:complexType name="ambles">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="displaydata"/>
<xsd:element ref="comment"/>
<xsd:any namespace="##other" processContents="lax"/>
</xsd:choice>
</xsd:complexType>
<xsd:element name="preamble" type="ambles"/>
<xsd:element name="postamble" type="ambles"/>
<xsd:complexType name="command"> <xsd:complexType name="command">
<xsd:sequence> <xsd:sequence>
<xsd:element ref="preamble" minOccurs="0" maxOccurs="1"/>
<xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="str"/> <xsd:element ref="str"/>
<xsd:element ref="num"/> <xsd:element ref="num"/>
<xsd:element ref="list"/> <xsd:element ref="list"/>
<xsd:element ref="tag"/> <xsd:element ref="tag"/>
<xsd:element ref="displaydata"/>
<xsd:element ref="comment"/>
<xsd:any namespace="##other" processContents="lax"/>
</xsd:choice> </xsd:choice>
<xsd:element ref="test" minOccurs="0" maxOccurs="1"/> <xsd:element ref="test" minOccurs="0" maxOccurs="1"/>
<xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="control"/> <xsd:element ref="control"/>
<xsd:element ref="action"/> <xsd:element ref="action"/>
<xsd:element ref="displayblock"/> <xsd:element ref="displayblock"/>
<xsd:element ref="displaydata"/>
<xsd:element ref="comment"/>
<xsd:any namespace="##other" processContents="lax"/>
</xsd:choice> </xsd:choice>
<xsd:element ref="postamble" minOccurs="0" maxOccurs="1"/>
</xsd:sequence> </xsd:sequence>
<xsd:attribute use="required" name="name" type="identifier"/> <xsd:attribute use="required" name="name" type="identifier"/>
</xsd:complexType> </xsd:complexType>
<xsd:element name="control" type="command"/> <xsd:element name="control" type="command"/>
<xsd:element name="action" type="command"/> <xsd:element name="action" type="command"/>
<xsd:element name="test"> <xsd:element name="test">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="str"/> <xsd:element ref="str"/>
<xsd:element ref="num"/> <xsd:element ref="num"/>
<xsd:element ref="list"/> <xsd:element ref="list"/>
<xsd:element ref="tag"/> <xsd:element ref="tag"/>
skipping to change at page 24, line 31 skipping to change at page 25, line 38
can be used as a general-purpose grouping mechanism - arbitrary can be used as a general-purpose grouping mechanism - arbitrary
attributes are allowed on displayblock elements. attributes are allowed on displayblock elements.
namespace sieve = "urn:ietf:params:xml:ns:sieve" namespace sieve = "urn:ietf:params:xml:ns:sieve"
start = element sieve:sieve { ( control | action | displayblock | start = element sieve:sieve { ( control | action | displayblock |
displaydata | comment | ext )* } displaydata | comment | ext )* }
comment = element sieve:comment { xsd:string } comment = element sieve:comment { xsd:string }
ambles =
(
( displaydata | comment | ext )*
),
empty
preamble = element sieve:preamble { ambles }
postamble = element sieve:postamble { ambles }
command = command =
( (
attribute name { attribute name {
xsd:token { xsd:token {
pattern = "[A-Za-z_][A-Za-z0-9_]*" } }, pattern = "[A-Za-z_][A-Za-z0-9_]*" } },
( str | num | \list | tag |
displaydata | comment | ext )*, preamble?,
( str | num | \list | tag )*,
test?, test?,
( control | action | displayblock | ( control | action | displayblock)*,
displaydata | comment | ext )* postamble?
), ),
empty empty
control = element sieve:control { command } control = element sieve:control { command }
action = element sieve:action { command } action = element sieve:action { command }
test = test =
element sieve:test element sieve:test
{ {
attribute name { attribute name {
xsd:token { xsd:token {
pattern = "[A-Za-z_][A-Za-z0-9_]*" } }, pattern = "[A-Za-z_][A-Za-z0-9_]*" } },
( str | num | \list | tag | comment | ext )*, ( str | num | \list | tag | comment | ext )*,
test* test*
skipping to change at page 28, line 4 skipping to change at page 29, line 20
<xsl:when test="count(sieve:control|sieve:action) &gt; 0"> <xsl:when test="count(sieve:control|sieve:action) &gt; 0">
<xsl:text xml:space="preserve"> <xsl:text xml:space="preserve">
</xsl:text> </xsl:text>
<xsl:value-of select="$prefix"/> <xsl:value-of select="$prefix"/>
<xsl:text>}</xsl:text> <xsl:text>}</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text>;</xsl:text> <xsl:text>;</xsl:text>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template>
<xsl:template match="sieve:preamble|sieve:postamble" mode="sieve">
<xsl:param name="prefix"/>
<xsl:apply-templates mode="sieve">
<xsl:with-param name="prefix" select="$prefix"/>
</xsl:apply-templates>
</xsl:template> </xsl:template>
<xsl:template match="sieve:test" mode="sieve"> <xsl:template match="sieve:test" mode="sieve">
<xsl:text xml:space="preserve"> </xsl:text> <xsl:text xml:space="preserve"> </xsl:text>
<xsl:value-of select="@name"/> <xsl:value-of select="@name"/>
<xsl:apply-templates select="*[not(self::sieve:test)]" <xsl:apply-templates select="*[not(self::sieve:test)]"
mode="sieve"/> mode="sieve"/>
<xsl:if test="count(descendant::sieve:test) &gt; 0"> <xsl:if test="count(descendant::sieve:test) &gt; 0">
<xsl:text> (</xsl:text> <xsl:text> (</xsl:text>
<xsl:for-each select="sieve:test"> <xsl:for-each select="sieve:test">
skipping to change at page 31, line 36 skipping to change at page 33, line 13
<xsl:text>="</xsl:text> <xsl:text>="</xsl:text>
<xsl:value-of select="."/> <xsl:value-of select="."/>
<xsl:text>"</xsl:text> <xsl:text>"</xsl:text>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
Appendix E. Acknowledgements Appendix E. Acknowledgements
The stylesheet copy mode code is loosely based on a sample code The stylesheet copy mode code is loosely based on a sample code
posted to the xsl-list list by Americo Albuquerque. Robert Burrell posted to the xsl-list list by Americo Albuquerque. Jari Arkko,
Donkin, Andrew McKeon, Alexey Melnikov, and Aaron Stone provided Robert Burrell Donkin, Andrew McKeon, Alexey Melnikov, and Aaron
useful comments on the document. Stone provided useful comments on the document.
Authors' Addresses Authors' Addresses
Ned Freed Ned Freed
Sun Microsystems Sun Microsystems
800 Royal Oaks 800 Royal Oaks
Monrovia, CA 91016-6347 Monrovia, CA 91016-6347
USA USA
Phone: +1 909 457 4293 Phone: +1 909 457 4293
 End of changes. 30 change blocks. 
67 lines changed or deleted 136 lines changed or added

This html diff was produced by rfcdiff 1.37a. The latest version is available from http://tools.ietf.org/tools/rfcdiff/