Did you call parseASXXX to parse the schema(s), and call setASModel to set
them back onto the ASBuilder? You need to do that to reuse the preparsed
schema(s).

Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]



                                                                                
                              
                    Shengyou Zeng                                               
                              
                    <[EMAIL PROTECTED]       To:     [EMAIL PROTECTED]          
                       
                    om>                  cc:                                    
                              
                                         Subject:     xerces-j 2 sample 
ASBuilder - AS performance            
                    06/07/2002                                                  
                              
                    07:15 PM                                                    
                              
                    Please respond                                              
                              
                    to                                                          
                              
                    xerces-j-user                                               
                              
                                                                                
                              
                                                                                
                              




The sample program dom.ASBuilder shipped with Xerces-j 2.0.1
"illustrates how to preparse xml schema documents and how to
  validate instance documents against preparsed schema grammars."
(quotes from DOM Sample page for xerces-j 2).  I was hoping that,
because of schema preparsing, the performance of ASBuilder
should improve compared to straight DOM 2.  However, that is not
the case.  As a matter of fact, the DOM 3 implementation with
schema preparsing fares worse than DOM 2 xerces-j
(org.apache.xerces.parsers.DOMParser).
For example, in my case, using the same schema and the same xml
instance (parsing and validating 100x), ASBuilder costs 10000 ms while
DOMParser costs 8000 ms.  (In case you are wondering, I did set
schema validation and namespace features to true for the DOMParser).

My understanding is that Abstract Schema preparses schema and validation
of repeat xml documents uses the preparsed schema.  This is what sample
ASBuilder is supposed to demonstrate.  Thus using Abstract Schema should
save schema (loading and) parsing time.  But why don't see the performance
gain one would expect?   What am I missing?

Thanks.

-Shengyou


---------------------------------------------------------------------
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