You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Marius Gleeson <xe...@subscribe.audumla.net> on 2003/12/02 00:16:59 UTC
Addind nodes to a PSVI generated document
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: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org