-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Formally define XML elements with RELAX NG; validate XML samples (#52)
- Loading branch information
Showing
9 changed files
with
191 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<multistatus xmlns="DAV:" xmlns:P="DAV:Push"> | ||
<response> | ||
<href>/webdav/collection/</href> | ||
<prop> | ||
<P:transports> | ||
<P:web-push> | ||
<P:server-public-key type="p256dh">BA1Hxzyi1RUM1b5wjxsn7nGxAszw2u61m164i3MrAIxHF6YK5h4SDYic-dRuU_RCPCfA5aq9ojSwk5Y2EmClBPs</P:server-public-key> | ||
</P:web-push> | ||
</P:transports> | ||
<P:topic>O7M1nQ7cKkKTKsoS_j6Z3w</P:topic> | ||
</prop> | ||
</response> | ||
</multistatus> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<multistatus xmlns="DAV:" xmlns:P="DAV:Push"> | ||
<response> | ||
<href>/webdav/collection/</href> | ||
<prop> | ||
<P:transports> | ||
<P:web-push /> | ||
|
||
<!-- Not covered by this document: | ||
<P:some-other-transport> | ||
<P:some-parameter>...</P:some-parameter> | ||
</P:some-other-transport> | ||
--> | ||
</P:transports> | ||
<P:topic xmlns="DAV:Push">O7M1nQ7cKkKTKsoS_j6Z3w</P:topic> | ||
</prop> | ||
</response> | ||
</multistatus> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<push-register xmlns="DAV:Push"> | ||
<subscription> | ||
<web-push-subscription> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<web-push-subscription xmlns="DAV:Push"> | ||
<push-resource>https://push.example.net/push/JzLQ3raZJfFBR0aqvOMsLrt54w4rJUsV</push-resource> | ||
</web-push-subscription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<grammar xmlns="http://relaxng.org/ns/structure/1.0"> | ||
|
||
<!-- root elements of examples in document --> | ||
<start> | ||
<choice> | ||
<ref name="multistatus"/> | ||
<ref name="subscription-registration"/> | ||
<ref name="push-message"/> | ||
<ref name="web-push-subscription"/> | ||
</choice> | ||
</start> | ||
|
||
<define name="multistatus" ns="DAV:"> | ||
<element name="multistatus"> | ||
<element name="response"> | ||
<element name="href"> | ||
<text/> | ||
</element> | ||
<element name="prop"> | ||
<zeroOrMore> | ||
<ref name="prop-transports"/> | ||
<ref name="prop-topic"/> | ||
</zeroOrMore> | ||
</element> | ||
</element> | ||
</element> | ||
</define> | ||
|
||
<include href="webdav-push.rng"/> | ||
|
||
</grammar> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#!/bin/sh | ||
xmllint --schema webdav-push.xsd --noout *.xml | ||
|
||
xmlstarlet val -e -r validate-samples.rng *.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="DAV:Push"> | ||
|
||
<!-- New WebDAV collection properties --> | ||
|
||
<define name="prop-transports"> | ||
<!-- available push transports --> | ||
<element name="transports"> | ||
<choice> | ||
<ref name="web-push-transport"/> | ||
<!-- or other transport, not covered by this schema --> | ||
</choice> | ||
</element> | ||
</define> | ||
|
||
<define name="prop-topic"> | ||
<!-- push topic --> | ||
<element name="topic"> | ||
<text/> | ||
</element> | ||
</define> | ||
|
||
|
||
<!-- Subscription registration --> | ||
|
||
<define name="subscription-registration"> | ||
<element name="push-register"> | ||
<!-- subscription to register --> | ||
<element name="subscription"> | ||
<choice> | ||
<ref name="web-push-subscription"/> | ||
<!-- or other subscription, not covered by this schema --> | ||
</choice> | ||
</element> | ||
|
||
<!-- expiration --> | ||
<optional> | ||
<element name="expires"> | ||
<text/> <!-- date-time in IMF-fixdate format --> | ||
</element> | ||
</optional> | ||
</element> | ||
</define> | ||
|
||
|
||
<!-- Push Message --> | ||
|
||
<define name="push-message"> | ||
<element name="push-message"> | ||
<element ns="DAV:" name="propstat"> <!-- defined in WebDAV (RFC 4918) --> | ||
<optional> | ||
<element ns="DAV:" name="status"> <!-- defined in WebDAV (RFC 4918) --> | ||
<text/> | ||
</element> | ||
</optional> | ||
|
||
<element ns="DAV:" name="prop"> <!-- defined in WebDAV (RFC 4918) --> | ||
<ref name="prop-topic"/> | ||
|
||
<optional> | ||
<element ns="DAV:" name="sync-token"> <!-- defined in Collection Synchronization for WebDAV (RFC 6578) --> | ||
<text/> | ||
</element> | ||
</optional> | ||
</element> | ||
</element> | ||
</element> | ||
</define> | ||
|
||
|
||
<!-- Web Push --> | ||
|
||
<define name="web-push-transport"> | ||
<element name="web-push"> | ||
<!-- VAPID key --> | ||
<optional> | ||
<element name="server-public-key"> | ||
<attribute name="type"> | ||
<choice> | ||
<value>p256dh</value> | ||
<!-- or other type / not covered by this schema --> | ||
</choice> | ||
</attribute> | ||
<text/> | ||
</element> | ||
</optional> | ||
</element> | ||
</define> | ||
|
||
<define name="web-push-subscription"> | ||
<element name="web-push-subscription"> | ||
<element name="push-resource"> | ||
<text/> <!-- push resource (URL) --> | ||
</element> | ||
|
||
<!-- message encryption --> | ||
<optional> | ||
<element name="client-public-key"> | ||
<attribute name="type"> | ||
<choice> | ||
<value>p256dh</value> | ||
<!-- or other type / not covered by this schema --> | ||
</choice> | ||
</attribute> | ||
<text/> | ||
</element> | ||
|
||
<element name="auth-secret"> | ||
<text/> | ||
</element> | ||
</optional> | ||
</element> | ||
</define> | ||
|
||
</grammar> |
This file was deleted.
Oops, something went wrong.