私はxqueryを初めて使用し、この問題の迅速な解決策を探しています。
xmlドキュメントがあり、ドキュメント内の最初のいとこのすべてのペアと2番目のいとこのすべてのペアを検索したいと思います。
以下のxmlをご覧になり、続行する方法、または高度に適用されるコードスニペットを提供できるかどうかをガイドしてください。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE GEDCOM SYSTEM "file:/Users/indiwarafernando/Downloads/family.dtd">
<GEDCOM>
<HeaderRec>
<FileCreation Date=""></FileCreation>
<Submitter>
<Link Target="" Ref="FM001"/>
</Submitter>
</HeaderRec>
<FamilyRec Id="FM001">
<HusbFath>
<Link Target="IndividualRec" Ref="IN001"/>
</HusbFath>
<WifeMoth>
<Link Target="IndividualRec" Ref="IN002"/>
</WifeMoth>
<Child>
<Link Target="IndividualRec" Ref="IN004"/>
</Child>
<Child>
<Link Target="IndividualRec" Ref="IN007"/>
</Child>
</FamilyRec>
<FamilyRec Id="FM002">
<HusbFath>
<Link Target="IndividualRec" Ref="IN004"/>
</HusbFath>
<WifeMoth>
<Link Target="IndividualRec" Ref="IN005"/>
</WifeMoth>
<Child>
<Link Target="IndividualRec" Ref="IN006"/>
</Child>
</FamilyRec>
<FamilyRec Id="FM003">
<HusbFath>
<Link Target="IndividualRec" Ref="IN007"/>
</HusbFath>
<WifeMoth>
<Link Target="IndividualRec" Ref="IN008"/>
</WifeMoth>
<Child>
<Link Target="IndividualRec" Ref="IN009"/>
</Child>
</FamilyRec>
<IndividualRec Id="IN001">
<IndivName>Fathers name</IndivName> <!-- This tag used for father of c1 or husband of w1 -->
<Gender>Male</Gender>
<AssocIndiv>
<Link Target="" Ref="IN002"/>
<Association>Wife</Association>
</AssocIndiv>
</IndividualRec>
<IndividualRec Id="IN002"> <!-- This tag used for mother of c1 or wife of h1 -->
<IndivName>Mother s name</IndivName>
<Gender>Male</Gender>
<AssocIndiv>
<Link Target="IndividualRec" Ref="IN001"/>
<Association>Husband</Association>
</AssocIndiv>
</IndividualRec>
<IndividualRec Id="IN003"> <!-- This tag used for a child to h1 or w1 or grand son to gm1 or gf1 -->
<IndivName>Child 1 name</IndivName>
<Gender>Male</Gender>
<AssocIndiv>
<Link Target="IndividualRec" Ref="IN001"/>
<Association>Father</Association>
</AssocIndiv>
<AssocIndiv>
<Link Target="IndividualRec" Ref="IN002"/>
<Association>Mother</Association>
</AssocIndiv>
</IndividualRec>
<IndividualRec Id="IN005"> <!-- This tag used for grand mother -->
<IndivName>Grand mother's name</IndivName>
<Gender>Male</Gender>
<AssocIndiv>
<Link Target="IndividualRec" Ref="IN004"/>
<Association>Husband</Association>
</AssocIndiv>
</IndividualRec>
<IndividualRec Id="IN004"> <!-- This tag used for grand father -->
<IndivName>Grand father's name</IndivName>
<Gender>Male</Gender>
<AssocIndiv>
<Link Target="IndividualRec" Ref="IN005"/>
<Association>Grand Father's Wife</Association>
</AssocIndiv>
</IndividualRec>
<IndividualRec Id="IN006"> <!-- This tag used for a child to h1 or w1 or grand son to gm1 or gf1 -->
<IndivName>Child 1 name</IndivName>
<Gender>Male</Gender>
<AssocIndiv>
<Link Target="IndividualRec" Ref="IN004"/>
<Association>Father</Association>
</AssocIndiv>
<AssocIndiv>
<Link Target="IndividualRec" Ref="IN005"/>
<Association>Mother</Association>
</AssocIndiv>
</IndividualRec>
<IndividualRec Id="IN007"> <!-- This tag used for grand mother -->
<IndivName>Grand mother's name</IndivName>
<Gender>Female</Gender>
<AssocIndiv>
<Link Target="IndividualRec" Ref="IN008"/>
<Association>Husband</Association>
</AssocIndiv>
</IndividualRec>
<IndividualRec Id="IN008"> <!-- This tag used for grand father -->
<IndivName>Grand father's name</IndivName>
<Gender>Male</Gender>
<AssocIndiv>
<Link Target="IndividualRec" Ref="IN007"/>
<Association>Grand Father's Wife</Association>
</AssocIndiv>
</IndividualRec>
<IndividualRec Id="IN009"> <!-- This tag used for a child to h1 or w1 or grand son to gm1 or gf1 -->
<IndivName>Child 1 name</IndivName>
<Gender>Male</Gender>
<AssocIndiv>
<Link Target="IndividualRec" Ref="IN007"/>
<Association>Father</Association>
</AssocIndiv>
<AssocIndiv>
<Link Target="IndividualRec" Ref="IN008"/>
<Association>Mother</Association>
</AssocIndiv>
</IndividualRec>
</GEDCOM>
*出力例:* 最初のいとこのペアの出力例はIN006とIN009です。
よろしく運賃