aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs87
1 files changed, 81 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index ea86e07..580652e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -5,12 +5,87 @@ use peanuts::xml::Document;
#[tokio::main]
async fn main() {
let (rest, document) = Document::parse(
- "<?xml version=\"1.0\"?>
-<TEST>
- <block1>Background Mark 1</block1>
- <block2>Background Mark 2</block2>
- <block3>Background Mark 3</block3>
-</TEST>ahsdkjlfhasdlkjfhkljh
+ "<?xml version='1.0' encoding='UTF-8'?>
+
+ <xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='http://etherx.jabber.org/streams'
+ xmlns='http://etherx.jabber.org/streams'
+ elementFormDefault='unqualified'>
+
+ <xs:import namespace='jabber:client'/>
+ <xs:import namespace='jabber:server'/>
+ <xs:import namespace='urn:ietf:params:xml:ns:xmpp-sasl'/>
+ <xs:import namespace='urn:ietf:params:xml:ns:xmpp-streams'/>
+ <xs:import namespace='urn:ietf:params:xml:ns:xmpp-tls'/>
+
+ <xs:element name='stream'>
+ <xs:complexType>
+ <xs:sequence xmlns:client='jabber:client'
+ xmlns:server='jabber:server'>
+ <xs:element ref='features'
+ minOccurs='0'
+ maxOccurs='1'/>
+ <xs:any namespace='urn:ietf:params:xml:ns:xmpp-tls'
+ minOccurs='0'
+ maxOccurs='1'/>
+ <xs:any namespace='urn:ietf:params:xml:ns:xmpp-sasl'
+ minOccurs='0'
+ maxOccurs='1'/>
+ <xs:any namespace='##other'
+ minOccurs='0'
+ maxOccurs='unbounded'
+ processContents='lax'/>
+ <xs:choice minOccurs='0' maxOccurs='1'>
+ <xs:choice minOccurs='0' maxOccurs='unbounded'>
+ <xs:element ref='client:message'/>
+ <xs:element ref='client:presence'/>
+ <xs:element ref='client:iq'/>
+ </xs:choice>
+ <xs:choice minOccurs='0' maxOccurs='unbounded'>
+ <xs:element ref='server:message'/>
+ <xs:element ref='server:presence'/>
+ <xs:element ref='server:iq'/>
+ </xs:choice>
+ </xs:choice>
+ <xs:element ref='error' minOccurs='0' maxOccurs='1'/>
+ </xs:sequence>
+ <xs:attribute name='from' type='xs:string' use='optional'/>
+ <xs:attribute name='id' type='xs:string' use='optional'/>
+ <xs:attribute name='to' type='xs:string' use='optional'/>
+ <xs:attribute name='version' type='xs:decimal' use='optional'/>
+ <xs:attribute ref='xml:lang' use='optional'/>
+ <xs:anyAttribute namespace='##other' processContents='lax'/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name='features'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any namespace='##other'
+ minOccurs='0'
+ maxOccurs='unbounded'
+ processContents='lax'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name='error'>
+ <xs:complexType>
+ <xs:sequence xmlns:err='urn:ietf:params:xml:ns:xmpp-streams'>
+ <xs:group ref='err:streamErrorGroup'/>
+ <xs:element ref='err:text'
+ minOccurs='0'
+ maxOccurs='1'/>
+ <xs:any namespace='##other'
+ minOccurs='0'
+ maxOccurs='1'
+ processContents='lax'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </xs:schema>asdf
",
)
.unwrap();