Thanks a lot. This certainly gets me going in the right direction, but I
noticed that I could not randomly generate a ID and have it successfully
work when doing subscriptions and registrations. I will look more into the
issue, but I was having no luck. However if I used a ID generated by the
sever from the original stream then it did work.

On Thu, Jun 25, 2009 at 3:52 AM, Leonid Evdokimov <[email protected]> wrote:

> Brandon A Dixon wrote:
> >>> Is there a way to generate IDs when sending subscription or presence
> >>> packets?
> >> IIRC, <presence /> stanzas do not strictly require IDs, only <iq />
> >> stanzas MUST have ID. See section 9.1.3 from RFC3290[1]
> >>
> >> [1] http://xmpp.org/rfcs/rfc3920.html#stanzas
> > Subscriptions require it though. So what if it's an iq?
>
> Well, you can get XML schema from RFC3921 Appendix B and see, that "id"
> has type='xs:NMTOKEN'.
>
> You can find BNF-like grammar for NMTOKEN at XML spec[2].
>
> NameStartChar ::=       ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] |
> [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] |
> [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] |
> [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
>
> NameChar      ::=       NameStartChar | "-" | "." | [0-9] | #xB7 |
> [#x0300-#x036F] | [#x203F-#x2040]
>
> Nmtoken       ::=       (NameChar)+
>
> [2] http://www.w3.org/TR/REC-xml/#NT-Nmtoken
>
> Moreover, `It is OPTIONAL for the value of the 'id' attribute to be
> unique` (RFC 3920). Common practice is to have unique IDs for each
> stanza within same stream.
>
> Hope, this is enough to generate some IDs :-)
>
> --
> WBRBW, Leonid Evdokimov
>
>


-- 
Brandon Dixon - CCNA, OSCP, WebSphere DataPower Solution Developer
Information Systems Security Engineer
www.dueyesterday.net - Documentation for the masses

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"py-transports" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/py-transports?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to