public static void MarvellExtract() { string HtmlCode = ReadFile.ReadFileAsString("test.html"); HTMLInterface TestInterface = new HTMLInterface(HtmlCode); TestInterface.GetFirstObject(); ExtractTablesCallback CallbackClass = new ExtractTablesCallback(); CallbackStore lCallbackStore = new CallbackStore(); lCallbackStore.AddCallback(new CallbackEntry("NewTable", CallbackClass.NewTable)); lCallbackStore.AddCallback(new CallbackEntry("Preheader1", CallbackClass.Preheader1)); lCallbackStore.AddCallback(new CallbackEntry("Preheader1Element", CallbackClass.Preheader1Element)); lCallbackStore.AddCallback(new CallbackEntry("Preheader2", CallbackClass.Preheader2)); lCallbackStore.AddCallback(new CallbackEntry("Preheader2Element", CallbackClass.Preheader2Element)); lCallbackStore.AddCallback(new CallbackEntry("NewBitfield", CallbackClass.NewBitfield)); lCallbackStore.AddCallback(new CallbackEntry("NewBlankBitfield", CallbackClass.NewBlankBitfield)); lCallbackStore.AddCallback(new CallbackEntry("NewBitfields", CallbackClass.NewBitfields)); lCallbackStore.AddCallback(new CallbackEntry("Postheader1", CallbackClass.Postheader1)); lCallbackStore.AddCallback(new CallbackEntry("Postheader1Element", CallbackClass.Postheader1Element)); lCallbackStore.AddCallback(new CallbackEntry("Postheader2", CallbackClass.Postheader2)); lCallbackStore.AddCallback(new CallbackEntry("Postheader2Bits", CallbackClass.Postheader2Bits)); lCallbackStore.AddCallback(new CallbackEntry("Postheader2Access", CallbackClass.Postheader2Access)); lCallbackStore.AddCallback(new CallbackEntry("Postheader2Name", CallbackClass.Postheader2Name)); lCallbackStore.AddCallback(new CallbackEntry("Postheader2Description", CallbackClass.Postheader2Description)); lCallbackStore.AddCallback(new CallbackEntry("NewBitfieldDescription", CallbackClass.NewBitfieldDescription)); lCallbackStore.AddCallback(new CallbackEntry("NewBitfieldDescriptionField", CallbackClass.NewBitfieldDescriptionField)); Xml XmlParse = new Xml(lCallbackStore); ParserPrimitives lPrimitive = XmlParse.ParseXMLFromFile("Test3.xml"); ObjectInterfacePrototipe tInterface = (ObjectInterfacePrototipe)TestInterface; lPrimitive.CheckRelations(ref tInterface, null, true); CallbackClass.WriteTablesAsHtml("tables.html"); }
public static void Test4() { string HtmlCode = "<html><head></head><body><div><div>a</div><div><a><p>Test</p><p>Test2</p></a><p>1a</p></div><p>m</p><div><div><a><bold><p>Test</p><p>Test2</p></bold></a><p>1a</p></div><p>a</p></div><p>b</p><p>c</p><a>test</a></div></body></html>"; HTMLInterface TestInterface = new HTMLInterface(HtmlCode); TestInterface.GetFirstObject(); TestCallback CallbackClass = new TestCallback(); CallbackStore lCallbackStore = new CallbackStore(); lCallbackStore.AddCallback(new CallbackEntry("moredivs", CallbackClass.moredivs)); lCallbackStore.AddCallback(new CallbackEntry("moreps", CallbackClass.moreps)); lCallbackStore.AddCallback(new CallbackEntry("moremors", CallbackClass.moremors)); Xml XmlParse = new Xml(lCallbackStore); ParserPrimitives lPrimitive = XmlParse.ParseXMLFromFile("Test2.xml"); ObjectInterfacePrototipe tInterface = (ObjectInterfacePrototipe)TestInterface; lPrimitive.CheckRelations(ref tInterface, null, true); }