我非常喜欢Cassandra。我发现很难对附加的XML文件建模。从XML和C建模Cassandra#
我的要求是:
- 我得到很多的XML文件,每天都在下面给出。我需要编写一个C#程序来读取XML并存储在Cassandra中。
- 一旦存储,数据将由1000年的客户读取1000次。一旦数据被存储,它不会再被更新。
注意:每个父节点(例如:客户/站点...)可能会出现更多的不可能。的时代。即我可能有顾客2,站点2,另一EquipmentDetails节点等
我的XML:
<?xml version="1.0" standalone="yes"?>
<MyAnalystXMLReport>
<MC-DomainID ID="XYZ123">
<Customer Name="CUSTOMER1" ID="53043">
<Site Name="SITE1" ID="488688">
<EquipmentDetails>
<EquipmentDescription>Test Desc</EquipmentDescription>
<EquipmentRefId>T3567111</EquipmentRefId>
<ComponentDescription>COM Oil</ComponentDescription>
<ComponentRefId>
</ComponentRefId>
<AnanlystNo>1235LKJU</AnanlystNo>
<ComponentType>TestComp</ComponentType>
<Sample SampleNo="976023696">
<SampleCondition>USUAL</SampleCondition>
<AnalysisComments>Test Comments</AnalysisComments>
<DateRecieved>2015-12-10</DateRecieved>
<DateAnalysed>2015-12-18</DateAnalysed>
<EquipmentLife>
</EquipmentLife>
<LubricantLife>
</LubricantLife>
<TopUpVolume>0</TopUpVolume>
<FuelUsed>
</FuelUsed>
<Tests>
<TestGroup Name="Group NAME1" ID="667">
<Test Name="Test Name1" ID="1785">
<Result>171.3</Result>
</Test>
</TestGroup>
<TestGroup Name="Group NAME2" ID="617">
<Test Name="Test NAME2" ID="1763">
<Result>153.40</Result>
</Test>
</TestGroup>
</Tests>
</Sample>
</EquipmentDetails>
</Site>
</Customer>
</MC-DomainID>
</MyAnalystXMLReport>
如何将我这个XML在有效的方式进行建模来实现这一要求? 什么是最简单的方法来存储这个数据数据数据数据&模型在卡桑德拉使用C#。任何例子将不胜感激。
感谢您的帮助。