Hi there,

I am trying to add nodes that I have generated from xsl parsing to a
source document that was generated using PSVIDocumentImpl.

The problem is that the nodes I am adding do not have any schema
information attached ( They are however schematically correct ), and the
importNode or addChild methods do not attach this information either.
Basically I need something to revalidate these new nodes and attach there
respective Schema type.                                

public void commit(Node parent, Node child,
org.apache.xerces.xs.XSTypeDefinition type ) throws Exception {

  PSVIElementNSImpl nsEntity =
  (PSVIElementNSImpl)parent.getOwnerDocument().importNode(child,true);

  if (nsEntity.getTypeDefinition() == null) {
    nsEntity.setPSVI( /* Have no PSVIElement to pass in */ );
    /* I can set the type using the following but I cannot get this value
    back when I need it, because
       nsEntity.getTypeDefinition() method returns a different variable.
       Maybe the variable used in ElementNSImpl
       should also be used by PSVIElementNSImpl */
    nsEntity.setType( type ); 
  }
  /* what do I do about all the child nodes schema information ? */
  parent.appendChild(nsEntity);
}

Thanks,
Marius.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to