-
Neustradamus
Merry Christmas to all!
-
Ellenor Malik
Christmas is fraud (:
-
moparisthebest
Ellenor Malik: merry fraud to you then
-
kurisu
What does xml:lang affect in practice? Do client even set it to anything other than "en"?
-
kurisu
Does xmpp use ns prefixes anywhere aside from that?
-
lovetox
yes in stream initiation
-
lovetox
otherwise no
-
mjk
> Does xmpp use ns prefixes anywhere aside from that? you mean, does it _not_ use namespaces somewhere? :)
-
singpolyma
kurisu: yes, anywhere anyone chooses to use prefixes
-
lovetox
singpolyma, nobody uses anywhere prefixes
-
kurisu
Sorry I meant ns prefixes with attributes
-
singpolyma
Prefixes vs not are a syntax choice by the producer
-
mjk
everything is qualified by some namespace, and <message xmlns="jabber:client" ...> can be encoded as <jabber:client:message ...>
-
singpolyma
Oh, specifically namespaced attributes are more rarely useful. Honestly attributes at all are less useful in general
-
mjk
probably
-
lovetox
you can theoretically, but practically nobody does it
-
kurisu
><jabber:client:message ...> I don't think that's valid xml...
-
lovetox
and nobody tried if that would be compatible with clients
-
lovetox
or even servers
-
kurisu
singpolyma, but does any XEP in practice require namespaced attributes?
-
lovetox
not that i know off
-
kurisu
I'm just thinking how to parse XMPP correctly and it seems kinda tricky to me b/c of that. Like, if I have expat handle namespaces, I don't know what prefix the producer set, thus I don't see xml:lang="en" but more like http://www.w3.org/XML/1998/namespace:lang="en", and to represent that in DOM internally I still need a prefix... which I don't know... yikes.
-
kurisu
Also, will <features xmlns="http://etherx.jabber.org/streams"/> instead of <stream:features/> break stuff?
-
mjk
> ><jabber:client:message ...> > I don't think that's valid xml... yeah, you're probably right, only one colon seems to be allowed by https://www.w3.org/TR/xml-names/#ns-qualnames
-
mjk
`<fwoop:message xmlns:fwoop="jabber:client" ...>` then would be something legal in xml and, afaik, in xmpp
- qy shudders
-
singpolyma
kurisu: when you parse XML the prefixes disappear
-
mjk
^this. they're an artifact of encoding, so to speak
-
singpolyma
The prefix "xml:" is special because it's build in to XML and not user declared namespace prefix
-
kurisu
Turns out you can't inline xmlns in xpath generally. You have to make a local prefix somewhere, maintaining a list of your local made up prefixes... just bruh
-
mjk
there was some relevant discussion on this channel about prefixes on December 03
-
mjk
s/some/extensive/
-
kurisu
singpolyma, > when you parse XML the prefixes disappear I thought I read somewhere up the chat xmpp servers and clients are likely to break if non standard prefixes are supplied. In my client I want to build a DOM. I thought the way I'd go would be take an existing xml library and build its dom in parts with expat. But xml libraries it seems won't let you set a namespaced attr without giving it a prefix. And I was just cautious about this because of the above paragraph. But if namespaced attrs aren't used in practice, I suppose I can just set the prefix to auto generated foo1 foo2 I guess haha
-
mjk
> I suppose I can just set the prefix to auto generated foo1 foo2 I guess haha that would change semantics then, no? in absence of prefix, the parent namespace is assumed, iirc
-
lovetox
what code language do you use?
-
mjk
and yeah, xpath seems to actually depend on particular prefixes to exist in the document, i.e., it doesn't abstract them o_O✎ -
mjk
and yeah, xpath seems to actually depend on particular prefixes to exist in the document, i.e., it doesn't abstract them away o_O ✏
-
mjk
that would make xpath pretty weird
-
jonas’
xpath is terrible in that way, though xpath implementations often allow you to pass a prefix<->uri map into them
-
mjk
ah, that's nicee✎ -
mjk
ah, that's nicer ✏
-
singpolyma
mjk: you make up your own prefixes for xpath. It doesn't use ones that may be in document
-
singpolyma
It just makes the syntax a bit nicer
-
mjk
oh
-
mjk
wikipedia might be wrong there, then: > In the case of an XML document in which the namespace prefix gs has been defined, `//gs:enquiry` will find all the `enquiry` elements in that namespace https://en.wikipedia.org/wiki/Xpath#Node_tests I need to parse the actual spec then
-
jonas’
kurisu: you never need to know the prefix in xmpp
-
jonas’
kurisu: you need to be able to produce specific prefixes (`stream`) for backward compatibility though
-
jonas’
(and as others said, generally avoid using any prefixes except on the stream header and the stream prefix on nonzas)✎ -
jonas’
(and as others said, generally avoid generating any prefixes except on the stream header and the stream prefix on nonzas) ✏
-
jonas’
so you can safely use expat in a mode which resolves namespaces for you
-
Zash
Is there a mode where Expat doesn't?
-
singpolyma
Zash: if there is it's called "broken mode please run screaming"
-
kurisu
Will <features xmlns="http://etherx.jabber.org/streams"/> instead of <stream:features/> break stuff?
-
singpolyma
kurisu: only if the implementation is brokee✎ -
singpolyma
kurisu: only if the implementation is broken ✏
-
singpolyma
Then you file a bug
-
kurisu
Well, in practice are most implementation broken that way or not?
-
Zash
Try it and find out?
-
singpolyma
Only way to be sure :)
-
singpolyma
Anything else is a rumour
-
kurisu
So does xml:lang factually affect anything in practice in existing implementations
-
singpolyma
kurisu: Conversations and forks will select an element with a lang matching what language the app is using if one is present
-
singpolyma
For body at least
-
kurisu
Ok so if I plan on resending stanzas should I make sure it's xml:lang="en" not xmlns:fizz="http://www.w3.org/XML/1998/namespace" fizz:lang="en"?
-
jonas’
kurisu: that is not legal xml
-
singpolyma
AFAIK xml: is a special reserved prefix you don't declare it
-
jonas’
xml forbids rebinding the xml prefiy✎ -
jonas’
xml forbids rebinding the xml namespace ✏
-
jonas’
see https://www.w3.org/TR/REC-xml-names/#xmlReserved for details
-
jonas’
but yes, you do not need to declare it, and if you do, the prefix must be xml