Hi,

I was tryng to use JARV to do validation after the XNI include and parse. If
valid then write, else send error, etc... 
AddContentMetadataHandler (constructed below) in a XNI handler and in it I
have:

public void endElement(QName element, Augmentations augs) throws
XNIException 
{
  // How to insert element w/attrs, bytes, chars string, etc???
// It would be nice to be able to do:
//if (target) {
// super.startElement(name, attrs, augs);
// super.endElement(name, augs);
//}
  super.endElement(element, augs);
}

Thanks, Rob
---------------------------------

VerifierFactory factory = new com.sun.msv.verifier.jarv.TheFactoryImpl();

Schema schema =
factory.compileSchema(Lsb.getXsdContentConfigPath().openRead());

Verifier verifier = schema.newVerifier();
      
verifier.setErrorHandler(
com.sun.msv.verifier.util.ErrorHandlerImpl.theInstance );
      
VerifierFilter filter = verifier.getVerifierFilter();
      
XMLReader reader = XMLReaderFactory.createXMLReader();
filter.setParent( reader );
filter.setContentHandler(new AddContentMetadataHandler());
      
filter.parse(new
InputSource(project.getContentConfigPath().openRead().getReader()));



> -----Original Message-----
> From: Elena Litani [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 20, 2003 6:48 AM
> To: [EMAIL PROTECTED]
> 
> Robert,
> 
> You don't need to use DOMParser - I was just giving it as an example.
> You can invoke parser on configuration, however you do need to register
> some document handler. In the case of DOM the document handler is
> DOMParser, in the case of SAX the document handler is SAXParser. So what
> do you register as documentHandler for XNI parse?
> 
> Thank you,
> --
> Elena Litani / IBM Toronto
> 
> Robert Koberg wrote:
> >
> > Hi and thanks,
> >
> > I have a filter setup. But, I was not specific, but I was hoping to do
> this
> > without using the DOM. I was hoping to run a XNI parse and then at some
> > point insert something in the source.
> >
> > Is there anyway to do this? Or can you add only with the DOM?
> >
> > Thanks,
> > -Rob
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to