createElementNS and attributes with default values

Discussion in 'XML' started by Nicolas VanOrton, Mar 8, 2005.

  1. 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
     
    Nicolas VanOrton, Mar 8, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Max
    Replies:
    1
    Views:
    482
    Joe Kesselman
    Sep 22, 2006
  2. P4trykx
    Replies:
    2
    Views:
    1,821
    bruce barker
    Jan 31, 2007
  3. Tom Anderson

    createElementNS

    Tom Anderson, Jun 23, 2008, in forum: XML
    Replies:
    6
    Views:
    1,414
    Tom Anderson
    Jun 24, 2008
  4. James Black
    Replies:
    10
    Views:
    282
    Thomas 'PointedEars' Lahn
    May 25, 2006
  5. Prasanna

    document.createElementNS on IE...

    Prasanna, Aug 8, 2007, in forum: Javascript
    Replies:
    3
    Views:
    326
    David Mark
    Aug 9, 2007
Loading...

Share This Page