Hello Jakub, XML Schema depends on namespaces. The schema-aware nodes in the PSVI DOM are all namespace-aware. Document.createElement() creates a non-namespace-aware node. You should never use the DOM Level 1 non-namespace factory methods with a DOM containing namespace-aware nodes. New element nodes should be created by calling Document.createElementNS() [1].
Hope that helps. [1] http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS Jakub Kahovec <[EMAIL PROTECTED]> wrote on 11/30/2004 09:43:14 AM: > Hi, > I am trying to add new node to a PSVI generated document but the > problem is that the node I am adding doesn't > have any schema information attached. > I'd tried to set the document 'psvi' and 'validate' fetures and then > normalized document by calling method > normalizeDocument but despite this the new node still doesn't > contain any schema information. > > This si the piece of my code : > > Node node = (Node) tree.getSelectionPath(). > getLastPathComponent(); > > Node newNode = node.getOwnerDocument().createElement("NEW_NODE"); > newNode.appendChild( node.getOwnerDocument(). > createTextNode("NODE_TEXT")); > > node.getParentNode().appendChild(newNode); > > node.getOwnerDocuemnt.getDomConfig().setParameter( > "validate", Boolean.TRUE ); > node.getOwnerDocuemnt.getDomConfig().setParameter( "psvi", > Boolean.TRUE ); > > node.getOwnerDocument().normalizeDocument(); > > //!!!! node is without any schema schema information > node = node.getParentNode().getLastChild(); > > > > Thank you very much for any ideas. > > Jakub > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]