How can I use createChildTag to create a child tag without adding xmlns=""

When I use this code:

PsiElement e = xmlTag.createChildTag("e", "", "blah", x).copy();

The generated code looks something like this:

blah]]>

How can I get rid of the xmlns attribute?

Larry

1 comment

Try using the namespace of parent element just like this:

xmlTag.createChildTag("e", xmlTag.getNamespace(), "blah", true);

But I'm not sure about value of last (boolean) parameter - I set it true for non-leaf elements and false for empty elements (or am I doing it wrong?).

Josef Pavlas

0

Please sign in to leave a comment.