createElementNS and attributes with default values

  • Thread starter Nicolas VanOrton
  • Start date
N

Nicolas VanOrton

Hi all,

When XercesDOMParser parses an XML document in a file, if a Schema is
attached, it automatically adds all attributes with default values to
the corresponding nodes...
I'm trying to obtain the above behavior when adding nodes with
createElementNS but I cannot do so. No default attributes are
automatically added. Shouldn't it be doing so?... Here's my code for
that:

DOMNode* AddChildElement(wchar_t* nodeTitle, DOMNode* toNode)
{
if (!toNode)
return NULL;
if (toNode->getNodeType()!=DOMNode::ELEMENT_NODE)
return NULL;

if (!nodeTitle)
nodeTitle = FindNewName(toNode, DOMNode::ELEMENT_NODE);

// XMLDocument is a DOMDocument*
DOMNode* newNode =
XMLDocument->createElementNS(toNode->getNamespaceURI(), nodeTitle);
// newNode does not have any attribute nodes, although it should
// according to the XML Schema
toNode->appendChild(newNode);
return newNode;
}

Any help would be deeply appreciated...

Nicolas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top