<?xml version="1.0"?>
<TextType IsKey="false" Name="XMLReport"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Providers
xmlns="Reporting"/>
<Sales
xmlns="Reporting"/>
<Value
xmlns="Reporting">
<?xml version="1.0" encoding="utf-8"?>
<TestReport>
<StudyUid>
<![CDATA[123]]>
</StudyUid>
<Modality>
<![CDATA[XYZ]]>
</Modality>
<StudyDate format="DICOM">123456</StudyDate>
<StudyTime format="DICOM">6789</StudyTime>
<AccessionNumber>
<![CDATA[123]]>
</AccessionNumber>
<StudyDescription>
<![CDATA[abc def]]>
</StudyDescription>
<OperatorName format="xyz">
<![CDATA[abc]]>
</OperatorName>
<PhysicianReadingStudy format="xyz">
<![CDATA[^^^^]]>
</PhysicianReadingStudy>
<InstitutionName>
<![CDATA[xyz]]>
</InstitutionName>
<HospitalName>
<![CDATA[Hospital Name]]>
</HospitalName>
<ReportSet>
<MyReport ID="1">
<ReportStatus>
<![CDATA[Done]]>
</ReportStatus>
</MyReport>
<MyReport ID="2">
<ReportStatus>
<![CDATA[Done]]>
</ReportStatus>
</MyReport>
<MyReport ID="3">
<ReportStatus>
<![CDATA[Initial]]>
</ReportStatus>
</MyReport>
</ReportSet>
<ReportImageSet />
<FetusSet />
</TestReport>
</Value>
<WhoSetMe xmlns="Reporting">NotSpecified
</WhoSetMe>
</TextType>
上記のxmlをC#で解析し、MyReport/ReportSetのすべてのReportStatusに対して "ReportStatus"が "Done"であるかどうかを確認します。ここでもう一つの紆余曲折は、上記の例のようにxmlが "Value"タグで始まるxmlがもう1つ含まれていることです。ReportSetタグの下にある多くのReportStatusタグにcontainする可能性があります。誰か助けてくれますか?私はxmlの内部にxmlを持っていて、内側のxmlの内部で条件が満たされているかテストしたいと思っています。 C#ソリューションが必要です
あなたがこれまでに試してみましたか?いくつかのコードを投稿できますか? – abagshaw
こんにちは、私はbelow.Butような何かをしようとしています運ない – Mithun
/*********************************** *******/ var value = xelement.Elements( "Value"); var reportStatus = xelement.Elements( "ReportSet")。要素( "MyReport")。選択(s => s); VAR doneReortCount = reportStatus.Where(X => x.Element( "ReportStatus")の値== "完了"。)ToListメソッド()カウント。。。 IF(reportStatus.ToList()== doneReortCount数) {// DO Somehing }/************************を****************/ – Mithun