Thanks Michael for your prompt response. But I want to do this in the runtime not using JAXP. The typical scenario I want to do is to add a new node at the runtime and use its type definition as well.
The problem is that the PSVI gets created at the document loading time and I can't create a new ElementPSVI and set the type definition. On Sun, Nov 15, 2009 at 5:36 PM, Michael Glavassevich <mrgla...@ca.ibm.com>wrote: > Hi Omar, > > You need to validate the document in order to get PSVI. The > jaxp.SourceValidator sample [1] included with Xerces shows how you can > validate a DOM using the JAXP Validation API. > > Thanks. > > [1] http://xerces.apache.org/xerces2-j/samples-jaxp.html#SourceValidator > > Michael Glavassevich > XML Parser Development > IBM Toronto Lab > E-mail: mrgla...@ca.ibm.com > E-mail: mrgla...@apache.org > > Omar Hamed <omhm...@gmail.com> wrote on 11/15/2009 09:10:15 AM: > > > Hi, > > I'm working on a UI application that lets the user edit the > > xml document based on the grammar specified in its schema. At first > > I don't know how to add a new node using XERCES. Second when I add > > new node using the normal DOM APIs, I can't get the schema > > information (PSVI) so I wanna ask how to add new node to the > > document and attach it with its correct PSVI. > > > > I don't know it there are APIs to re-validate the document so that I > > can attach new nodes with its PSVI. > > > > Best regards, > > Omar Mostafa > > -- 0µªΓ