Thanks to earlier help, I’m happily parsing the ugly-chunky ‘special’ element that I have to handle in my tests. But it’s requireing ugly-chunky code because it has to deal with all kinds of child elements. So I figured I’d break out the child elements into their own custom extensions. The trouble (I think) is that these child elements do not have an explicit namespace. By XML rules, they do have a namespace (it comes from the outermost element containing the child) but that doesn’t seem to be seen when parsing at that depth. First, the XML in question – the focus is on the elements inside element (not the similar RFC-033 block.1
<address jid="firstname.lastname@example.org" type="to" /> <address jid="email@example.com" type="to" />
<from domain="qa.imprivata.com" name="test dkashtan.2">firstname.lastname@example.org</from>
<address jid="email@example.com" name="dkashtan.1" /> <address jid="firstname.lastname@example.org" name="dkashtan.3" /> <address jid="email@example.com" name="dkashtan.2" />
A default extension is created for the RFC-033 element but not for elements inside it. So I don’t think there is a clash there.
In my current provider for , as I iterate over the elements my element does have the namespace I expect. Because it is contained inside of a element with the namespace http://imprivata.com/protocol/cortex, it has that namespace.
Provider is registered in code via:
ProviderManager pm = ProviderManager.getInstance();
pm.addExtensionProvider(“content”, XMLConstants.AV_CORTEXT_NAMESPACE, new ContentExtension.Provider());
pm.addExtensionProvider(“domain”, XMLConstants.AV_CORTEXT_NAMESPACE, new DomainExtension.Provider());
pm.addExtensionProvider(“domain”, “jabber:client”, new CalvinDomainExtension.Provider());
pm.addExtensionProvider(“address”, XMLConstants.AV_CORTEXT_NAMESPACE, new CortextAddressExtension.Provider());
It is the last one.
Problem continued in next post…