Skip to content


Inconsistency with prefixed elements #15

frane opened this Issue · 3 comments

2 participants


The getChild, getChildren and getChildText methods behave inconsistently on prefixed elements.


el = ltx.parse('<root><x:foo>bar</x:foo></root>');

// result: 'bar'

// result: null

// result: null -> can't try getText :-)

// result: 'bar'

getChildText uses to find the child while getChildren, and thus getChild, uses this.getName(). However, this behavior should be consistent to avoid confusion and bugs.

node-XMPP member

Agreed. Thanks for reporting.

I'm removing the ability to specify the prefix at all. Pass a full namespace instead. I hope you don't see this as a limitation, prefixes depend on specific implementations and you shouldn't hard code any.

node-XMPP member

Released in 0.2.2

@astro astro closed this

Your solution works for me. The methods are consistent now and your argument hardcoded prefixes is absolutely valid.
Thanks for fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.