|
-
March 18th, 2007, 07:32 PM
#2
Re: Xerces - Serializing DTD Grammar
The serialize grammars thing doesn't make any sense to me. I tried it
Code:
DOMImplementationLS * impl = (DOMImplementationLS *)
DOMImplementationRegistry::getDOMImplementation(XS("[removed]"));
DOMWriter * writer = impl->createDOMWriter();
if (writer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true))
writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
if (writer->canSetFeature(XMLUni::fgDOMWRTBOM, true))
writer->setFeature(XMLUni::fgDOMWRTBOM, true);
std::auto_ptr<MemoryManager> mem_mgr = new MemoryManagerImpl();
std::auto_ptr<XMLGrammarPool> gp = new XMLGrammarPoolImpl(mem_mgr.get());
gp->cacheGrammar(m_grammar);
std::auto_ptr<XMLFormatTarget> ft = new LocalFileFormatTarget(m_file.c_str());
std::auto_ptr<BinOutputStream> bp = new BinFileOutputStream((m_file + "grammar").c_str());
gp->serializeGrammars(bp.get());
writer->writeNode(ft.get(), *m_doc);
writer->release();
And the grammar file looks like this http://zxcvbn.t35.com/test.xmlgrammar
Other ideas appreciated
Windows XP, Visual Studio 2008, SVN
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|