1

Original Title: How to derived a class from base class DOMDocument of XercesC? From what I understand is that during parsing, below function will be called.

DOMProcessingInstruction* DOMDocument::createProcessingInstruction  (XMLCh* target, XMLCh* data)

If my target is my desired value, I can process the content of data.

But below code has error about abstract class.

class derived : public DOMDocument

From what I understand, all pure virtual function should be overridden. But that is a lot(about 20 functions), what I wanted is only the above function (createProcessingInstruction()).

I might be wrong about using the DOMDocument. Do you have codes that implements it as base class and overrides only some functions? What I want is during parsing I need to catch each line so I can perform some specific processing. I used DOMLSParser class, but the parsed data has no way to get the version indicated on file (different from XML version). For below sample, I should get 1.9 and not 1.0.

sample file:

<?xml version="1.0" encoding="shift-jis"?>
<!DOCTYPE bml PUBLIC "XXX" "employee.dtd">
<?emp emp-version="1.9"?>

(edited) Background: I assumed that createProcessingInstruction() function will be called during parsing based on C# functionality. But I think the trigger was the text reader of C#. So it means that function will not be called in xerces. My question will now be, is there a text reader in xerces that can be link during parsing. So they work side by side to read each line and to process parsing.

steiryx
  • 71
  • 10

0 Answers0