Hello, I was looking into XMLGrammarPool and GrammarResolver and noticed that both have a way of caching an existing Grammar object. My main goal is to keep the Grammar objects themselves and load those into the parser objects, directly or through the resolver or some other way... I want to achieve this because even though I want to cache the schemas I don't want every parser object I create to use the same XMLGrammarPool, so every time I create a parser I'll see what schemas it needs, then get the matching Grammar objects and build my XMLGrammarPool. Well I tried doing what I just described but it didn't work. At first I created a dummy parser object and used loadGrammar to load my schemas. loadGrammar returns Grammar*, I kept those aside and added them to a different XMLGrammarPool (I also tried adding them to a GrammarResolver). After I finished loading all my schemas to both pools, I parsed a valid XML file using the parser object that I used loadGrammar on and the file passed validation. Then I tried using a parser object initialized with the other XMLGrammarPool and it failed due to some type missing.
Something else I was wondering about the XMLGrammarPool is what does it do with the referenced schemas? If I use loadGrammar on schema A that includes B, will the parser object add schema B to the pool aswell? If so I'm guessing I don't get 2 Grammar* objects from loadGrammar but maybe schema B is somehow saved inside schema A's Grammar*? I hope you understand what I mean, it's getting abit complicated :) Thanks! Boris Kolpackov-2 wrote: > > Hi Daniel, > > Daniel Jackson <[EMAIL PROTECTED]> writes: > >> That looks perfect. One question though, can I use XMLGrammarPool with a >> SAX >> parser too? > > Yes, the second argument to XMLReaderFactory::createXMLReader is > XMLGrammarPool. > > Boris > > -- > Boris Kolpackov, Code Synthesis Tools > Open source XML data binding for C++: > http://codesynthesis.com/products/xsd > Mobile/embedded validating XML parsing: > http://codesynthesis.com/products/xsde > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/setExternalSchemaLocation-and-xs%3Aimport-tp15532404p15855610.html Sent from the Xerces - C - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
