It would be really helpful to be able to read the vocabulary of a parsed file, as a Fast Infoset file could be exchanged to share an external vocabulary. Unfortunately, there isn't an API to read the vocabulary. Additionally, the vocabulary object returned needs to be an instance of org.jvnet.fastinfoset.Vocabulary so that the returned vocabulary can be later used to initialize an ExternalVocabulary object.
There are probably a few different techniques that could be taken here. For example, we could just subclass SAXDocumentParser and add a new method that analyses the _v ParserVocabulary member variable and returns an instance of org.jvnet.fastinfoset.Vocabulary. Another approach was to just add a getVocabulary method to the Decoder class, which ensures that all classes that inherit off of Decoder have the getVocabulary() method. That's the approach we took. I'll post a patch shortly.
Also, sorry for copy & pasting code inline, as attachments aren't allowed. If you'd prefer me to send something directly, or post a dropbox link, just let me know.
It would be really helpful to be able to read the vocabulary of a parsed file, as a Fast Infoset file could be exchanged to share an external vocabulary. Unfortunately, there isn't an API to read the vocabulary. Additionally, the vocabulary object returned needs to be an instance of org.jvnet.fastinfoset.Vocabulary so that the returned vocabulary can be later used to initialize an ExternalVocabulary object.
There are probably a few different techniques that could be taken here. For example, we could just subclass SAXDocumentParser and add a new method that analyses the _v ParserVocabulary member variable and returns an instance of org.jvnet.fastinfoset.Vocabulary. Another approach was to just add a getVocabulary method to the Decoder class, which ensures that all classes that inherit off of Decoder have the getVocabulary() method. That's the approach we took. I'll post a patch shortly.
Also, sorry for copy & pasting code inline, as attachments aren't allowed. If you'd prefer me to send something directly, or post a dropbox link, just let me know.