编程语言
首页 > 编程语言> > C#中的XML解析问题

C#中的XML解析问题

作者:互联网

我正在尝试使用C#中的XDocument进行非常简单的XML解析.我有一个自定义对象,序列化到一个XML文件,现在我想读出它.这样做的代码如下所示:

public void InsertOldWallFromDisk()
{
    if(File.Exists("1.xml"))
    {
        Wall wallToDraw = OldProgramAdapter.ReadLegacyWallFile("1.xml");
    }
}

public static Wall ReadLegacyWallFile(string fileName)
{
    XDocument xmlToReadFrom = XDocument.Parse(fileName);
    //Do stuff to read the XML to a Wall object
    return readWall
}

但是,当我运行此代码时,我在XDocument.Parse上收到一个非常模糊的错误

enter image description here

但是我的XML有效(我认为)!这是我要读取的XML

<Wall>
 <Actual>
  <Specifications>
     <Insertion> 375.6858 916.8871 0.0000 </Insertion>
     <Angle> 3.14159 </Angle>
     <WallDesc> E4-1, H: 8' 1 1/8, Sh: Yes, S: 2~4~2~9-0-0~SPF~~, Spc: Single @ 16 in OC, BP: 2~4~2~12-0-0~SYP~~, CP: 2~4~2~12-0-0~SYP~~, TP: 2~4~2~12-0-0~SYP~~,\P LI: Single @ 38.75000000, CB: No, VB: No, NCT: 2~4~2~9-0-0~SPF~~, CT: 2~4~2~9-0-0~SPF~~, Pac: 2~4~2~9-0-0~SPF~~, Mir: Yes </WallDesc>
     <WallNum> 1 </WallNum>
     <VaporBarrier></VaporBarrier>
  </Specifications>
  <Members>
    <Member>
     <MemberID> 2 </MemberID>
     <Insertion> 0.0000 0.0000 0.0000 </Insertion>
     <XScale> 52.2500 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 1.5000 </ZScale>
     <Type> PB </Type>
     <Material> 2~4~2~12-0-0~SYP~~ </Material>
    </Member>
    <Member>
     <MemberID> 3 </MemberID>
     <Insertion> 0.0000 0.0000 94.1250 </Insertion>
     <XScale> 52.2500 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 1.5000 </ZScale>
     <Type> PT </Type>
     <Material> 2~4~2~12-0-0~SYP~~ </Material>
    </Member>
    <Member>
     <MemberID> 4 </MemberID>
     <Insertion> -3.5000 0.0000 95.6250 </Insertion>
     <XScale> 31.7500 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 1.5000 </ZScale>
     <Type> PC </Type>
     <Material> 2~4~2~12-0-0~SYP~~ </Material>
    </Member>
    <Member>
     <MemberID> 5 </MemberID>
     <Insertion> 30.0000 0.0000 1.5000 </Insertion>
     <XScale> 0.0000 </XScale>
     <YScale> 0.0000 </YScale>
     <ZScale> 0.0000 </ZScale>
     <Type> Door-1-1 </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
    </Member>
    <Member>
     <MemberID> 6 </MemberID>
     <Insertion> 0.0000 3.5000 0.0000 </Insertion>
     <XScale> 10.7500 </XScale>
     <YScale> 0.4375 </YScale>
     <ZScale> 96.0000 </ZScale>
     <Type> sheathing-b-10.7500x96.0000-OSB7~16-4x8 </Type>
     <Material> OSB7/16-4x8 </Material>
    </Member>
    <Member>
     <MemberID> 7 </MemberID>
     <Insertion> 10.7500 3.5000 82.2500 </Insertion>
     <XScale> 38.5000 </XScale>
     <YScale> 0.4375 </YScale>
     <ZScale> 14.8750 </ZScale>
     <Type> sheathing-b-38.5000x14.8750-OSB7~16-4x8 </Type>
     <Material> OSB7/16-4x8 </Material>
    </Member>
    <Member>
     <MemberID> 8 </MemberID>
     <Insertion> 49.2500 3.5000 0.0000 </Insertion>
     <XScale> 3.0000 </XScale>
     <YScale> 0.4375 </YScale>
     <ZScale> 96.0000 </ZScale>
     <Type> sheathing-b-3.0000x96.0000-OSB7~16-4x8 </Type>
     <Material> OSB7/16-4x8 </Material>
    </Member>
    <Member>
     <MemberID> 9 </MemberID>
     <Insertion> 0.0000 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
    </Member>
    <Member>
     <MemberID> 10 </MemberID>
     <Insertion> 15.2500 0.0000 93.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 0.6250 </ZScale>
     <Type> Crip </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
    </Member>
    <Member>
     <MemberID> 11 </MemberID>
     <Insertion> 31.2500 0.0000 93.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 0.6250 </ZScale>
     <Type> Crip </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
    </Member>
    <Member>
     <MemberID> 12 </MemberID>
     <Insertion> 47.2500 0.0000 93.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 0.6250 </ZScale>
     <Type> Crip </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
    </Member>
    <Member>
     <MemberID> 13 </MemberID>
     <Insertion> 0.0000 0.0000 38.7500 </Insertion>
     <XScale> 52.2500 </XScale>
     <YScale> 0.7500 </YScale>
     <ZScale> 3.5000 </ZScale>
     <Type> LetIn </Type>
     <Material> 1~4~3~12-0-0~SYP~~ </Material>
    </Member>
  </Members>
  <Subcomponents>
    <Subcomponent>
      <Doors>
        <Door DoorName="1-1">
          <DoorMember>
            <MemberID> 1 </MemberID>
            <Insertion> -22.2500 0.0000 1.5000 </Insertion>
            <XScale> 1.5000 </XScale>
            <YScale> 3.5000 </YScale>
            <ZScale> 92.6250 </ZScale>
            <Type> LeftTrim </Type>
            <Material> 2~4~2~9-0-0~SPF~~ </Material>
          </DoorMember>
          <DoorMember>
            <MemberID> 2 </MemberID>
            <Insertion> 20.7500 0.0000 1.5000 </Insertion>
            <XScale> 1.5000 </XScale>
            <YScale> 3.5000 </YScale>
            <ZScale> 92.6250 </ZScale>
            <Type> RightTrim </Type>
            <Material> 2~4~2~9-0-0~SPF~~ </Material>
          </DoorMember>
          <DoorMember>
            <MemberID> 3 </MemberID>
            <Insertion> -20.7500 0.0000 1.5000 </Insertion>
            <XScale> 1.5000 </XScale>
            <YScale> 3.5000 </YScale>
            <ZScale> 80.7500 </ZScale>
            <Type> Packer </Type>
            <Material> 2~4~2~9-0-0~SPF~~ </Material>
          </DoorMember>
          <DoorMember>
            <MemberID> 4 </MemberID>
            <Insertion> -20.7500 0.0000 93.5000 </Insertion>
            <XScale> 1.5000 </XScale>
            <YScale> 3.5000 </YScale>
            <ZScale> 0.6250 </ZScale>
            <Type> Packer </Type>
            <Material> 2~4~2~9-0-0~SPF~~ </Material>
          </DoorMember>
          <DoorMember>
            <MemberID> 5 </MemberID>
            <Insertion> 19.2500 0.0000 1.5000 </Insertion>
            <XScale> 1.5000 </XScale>
            <YScale> 3.5000 </YScale>
            <ZScale> 80.7500 </ZScale>
            <Type> Packer </Type>
            <Material> 2~4~2~9-0-0~SPF~~ </Material>
          </DoorMember>
          <DoorMember>
            <MemberID> 6 </MemberID>
            <Insertion> 19.2500 0.0000 93.5000 </Insertion>
            <XScale> 1.5000 </XScale>
            <YScale> 3.5000 </YScale>
            <ZScale> 0.6250 </ZScale>
            <Type> Packer </Type>
            <Material> 2~4~2~9-0-0~SPF~~ </Material>
          </DoorMember>
          <DoorMember>
            <MemberID> 7 </MemberID>
            <Insertion> -20.7500 0.0000 82.2500 </Insertion>
            <XScale> 41.5000 </XScale>
            <YScale> 1.5000 </YScale>
            <ZScale> 11.2500 </ZScale>
            <Type> Header </Type>
            <Material> 2~12~2~8-0-0~syp~~ </Material>
          </DoorMember>
          <DoorMember>
            <MemberID> 8 </MemberID>
            <Insertion> -20.7500 1.5000 82.2500 </Insertion>
            <XScale> 41.5000 </XScale>
            <YScale> 0.5000 </YScale>
            <ZScale> 11.2500 </ZScale>
            <Type> Header </Type>
            <Material> 2~12~2~8-0-0~syp~~ </Material>
          </DoorMember>
          <DoorMember>
            <MemberID> 9 </MemberID>
            <Insertion> -20.7500 2.0000 82.2500 </Insertion>
            <XScale> 41.5000 </XScale>
            <YScale> 1.5000 </YScale>
            <ZScale> 11.2500 </ZScale>
            <Type> Header </Type>
            <Material> 2~12~2~8-0-0~syp~~ </Material>
          </DoorMember>
        </Door>
      </Doors>
    </Subcomponent>
  </Subcomponents>
  <ProgramOptions>
    <Project>11125</Project>
    <Estimate>4/3/2013 9:46:23 AM</Estimate>
    <OpeningSettings>
      <MinHeaderNLB>4</MinHeaderNLB>
      <MinHeaderLB>4</MinHeaderLB>
      <MinHeaderExt>12</MinHeaderExt>
      <TrimStudCountNLB>1</TrimStudCountNLB>
      <TrimStudCountLB>1</TrimStudCountLB>
      <TrimStudCountExt>1</TrimStudCountExt>
      <SolidHeadersLB>False</SolidHeadersLB>
      <SillCountNLB>1</SillCountNLB>
      <SillCountLB>1</SillCountLB>
      <SillCountExt>1</SillCountExt>
    </OpeningSettings>
    <BuildingSettings>
      <MaxWallLength>145.5000</MaxWallLength>
      <TopFloor>1</TopFloor>
      <CurrentFloor>1</CurrentFloor>
      <SplicePlateLength>48.0000</SplicePlateLength>
    </BuildingSettings>
    <TeeSettings>
      <ExtCornerTeeStyle>Regular</ExtCornerTeeStyle>
      <ExtNonCornerTeeStyle>Regular</ExtNonCornerTeeStyle>
      <LBCornerTeeStyle>Regular</LBCornerTeeStyle>
      <LBNonCornerTeeStyle>Regular</LBNonCornerTeeStyle>
      <NLBCornerTeeStyle>Regular</NLBCornerTeeStyle>
      <NLBNonCornerTeeStyle>Regular</NLBNonCornerTeeStyle>
    </TeeSettings>
    <SheathingSettings>
      <Overlap>0.0000</Overlap>
    </SheathingSettings>
    <ProgramSettings>
      <StudDropDist>4.0000</StudDropDist>
    </ProgramSettings>
  </ProgramOptions>
 </Actual>
 <Requested>
  <Specifications>
     <Insertion> 375.6858 916.8871 0.0000 </Insertion>
     <Angle> 3.14159 </Angle>
     <WallDesc> E4-1, H: 8' 1 1/8, Sh: Yes, S: 2~4~2~9-0-0~SPF~~, Spc: Single @ 16 in OC, BP: 2~4~2~12-0-0~SYP~~, CP: 2~4~2~12-0-0~SYP~~, TP: 2~4~2~12-0-0~SYP~~,\P LI: Single @ 38.75000000, CB: No, VB: No, NCT: 2~4~2~9-0-0~SPF~~, CT: 2~4~2~9-0-0~SPF~~, Pac: 2~4~2~9-0-0~SPF~~, Mir: Yes </WallDesc>
     <WallNum> 1 </WallNum>
     <VaporBarrier></VaporBarrier>
  </Specifications>
  <Members>
    <Member>
     <MemberID> 2 </MemberID>
     <Insertion> 0.0000 0.0000 0.0000 </Insertion>
     <XScale> 52.2500 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 1.5000 </ZScale>
     <Type> PB </Type>
     <Material> 2~4~2~12-0-0~SYP~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 3 </MemberID>
     <Insertion> 0.0000 0.0000 94.1250 </Insertion>
     <XScale> 52.2500 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 1.5000 </ZScale>
     <Type> PT </Type>
     <Material> 2~4~2~12-0-0~SYP~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 4 </MemberID>
     <Insertion> -3.5000 0.0000 95.6250 </Insertion>
     <XScale> 31.7500 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 1.5000 </ZScale>
     <Type> PC </Type>
     <Material> 2~4~2~12-0-0~SYP~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 5 </MemberID>
     <Insertion> 0.0000 3.5000 0.0000 </Insertion>
     <XScale> 10.7500 </XScale>
     <YScale> 0.4375 </YScale>
     <ZScale> 96.0000 </ZScale>
     <Type> sheathing-b-10.7500x96.0000-OSB7~16-4x8 </Type>
     <Material> OSB7/16-4x8 </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 6 </MemberID>
     <Insertion> 10.7500 3.5000 82.2500 </Insertion>
     <XScale> 38.5000 </XScale>
     <YScale> 0.4375 </YScale>
     <ZScale> 14.8750 </ZScale>
     <Type> sheathing-b-38.5000x14.8750-OSB7~16-4x8 </Type>
     <Material> OSB7/16-4x8 </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 7 </MemberID>
     <Insertion> 49.2500 3.5000 0.0000 </Insertion>
     <XScale> 3.0000 </XScale>
     <YScale> 0.4375 </YScale>
     <ZScale> 96.0000 </ZScale>
     <Type> sheathing-b-3.0000x96.0000-OSB7~16-4x8 </Type>
     <Material> OSB7/16-4x8 </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 8 </MemberID>
     <Insertion> 0.0000 0.0000 0.0000 </Insertion>
     <XScale> 0.0000 </XScale>
     <YScale> 0.0000 </YScale>
     <ZScale> 0.0000 </ZScale>
     <Type> TPoints-1-1000 </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 9 </MemberID>
     <Insertion> 0.0000 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 10 </MemberID>
     <Insertion> 0.0000 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 11 </MemberID>
     <Insertion> 50.7500 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 12 </MemberID>
     <Insertion> 15.2500 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 13 </MemberID>
     <Insertion> 15.2500 0.0000 93.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 0.6250 </ZScale>
     <Type> Crip </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 14 </MemberID>
     <Insertion> 31.2500 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 15 </MemberID>
     <Insertion> 31.2500 0.0000 93.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 0.6250 </ZScale>
     <Type> Crip </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 16 </MemberID>
     <Insertion> 47.2500 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 17 </MemberID>
     <Insertion> 47.2500 0.0000 93.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 0.6250 </ZScale>
     <Type> Crip </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 18 </MemberID>
     <Insertion> 50.7500 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 19 </MemberID>
     <Insertion> 50.6875 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 20 </MemberID>
     <Insertion> 50.6250 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 21 </MemberID>
     <Insertion> 50.5625 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 22 </MemberID>
     <Insertion> 50.5000 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 23 </MemberID>
     <Insertion> 50.4375 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 24 </MemberID>
     <Insertion> 50.3750 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 25 </MemberID>
     <Insertion> 50.3125 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 26 </MemberID>
     <Insertion> 50.2500 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 27 </MemberID>
     <Insertion> 50.1875 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 28 </MemberID>
     <Insertion> 50.1250 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 29 </MemberID>
     <Insertion> 50.0625 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 30 </MemberID>
     <Insertion> 50.7500 0.0000 1.5000 </Insertion>
     <XScale> 1.5000 </XScale>
     <YScale> 3.5000 </YScale>
     <ZScale> 92.6250 </ZScale>
     <Type> S </Type>
     <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
    <Member>
     <MemberID> 31 </MemberID>
     <Insertion> 0.0000 0.0000 38.7500 </Insertion>
     <XScale> 52.2500 </XScale>
     <YScale> 0.7500 </YScale>
     <ZScale> 3.5000 </ZScale>
     <Type> LetIn </Type>
     <Material> 1~4~3~12-0-0~SYP~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
    </Member>
  </Members>
  <Subcomponents>
    <Subcomponent>
      <Tees>
        <Tee TeeName="1-1000">
          <TeeMember>
            <MemberID> 1 </MemberID>
            <Insertion> 0.0000 0.0000 1.5000 </Insertion>
            <XScale> 1.5000 </XScale>
            <YScale> 3.5000 </YScale>
            <ZScale> 92.6250 </ZScale>
            <Type> S </Type>
            <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
          </TeeMember>
          <TeeMember>
            <MemberID> 2 </MemberID>
            <Insertion> 52.2500 0.0000 1.5000 </Insertion>
            <XScale> 1.5000 </XScale>
            <YScale> 3.5000 </YScale>
            <ZScale> 92.6250 </ZScale>
            <Type> S </Type>
            <Material> 2~4~2~9-0-0~SPF~~ </Material>
            <MarkBP> No </MarkBP>
            <MarkTP> No </MarkTP>
            <MarkCP> No </MarkCP>
            <Added> No </Added>
          </TeeMember>
        </Tee>
      </Tees>
    </Subcomponent>
  </Subcomponents>
  <ProgramOptions>
    <Project>11125</Project>
    <Estimate>4/3/2013 9:46:23 AM</Estimate>
    <OpeningSettings>
      <MinHeaderNLB>4</MinHeaderNLB>
      <MinHeaderLB>4</MinHeaderLB>
      <MinHeaderExt>12</MinHeaderExt>
      <TrimStudCountNLB>1</TrimStudCountNLB>
      <TrimStudCountLB>1</TrimStudCountLB>
      <TrimStudCountExt>1</TrimStudCountExt>
      <SolidHeadersLB>False</SolidHeadersLB>
      <SillCountNLB>1</SillCountNLB>
      <SillCountLB>1</SillCountLB>
      <SillCountExt>1</SillCountExt>
    </OpeningSettings>
    <BuildingSettings>
      <MaxWallLength>145.5000</MaxWallLength>
      <TopFloor>1</TopFloor>
      <CurrentFloor>1</CurrentFloor>
      <SplicePlateLength>48.0000</SplicePlateLength>
    </BuildingSettings>
    <TeeSettings>
      <ExtCornerTeeStyle>Regular</ExtCornerTeeStyle>
      <ExtNonCornerTeeStyle>Regular</ExtNonCornerTeeStyle>
      <LBCornerTeeStyle>Regular</LBCornerTeeStyle>
      <LBNonCornerTeeStyle>Regular</LBNonCornerTeeStyle>
      <NLBCornerTeeStyle>Regular</NLBCornerTeeStyle>
      <NLBNonCornerTeeStyle>Regular</NLBNonCornerTeeStyle>
    </TeeSettings>
    <SheathingSettings>
      <Overlap>0.0000</Overlap>
    </SheathingSettings>
    <ProgramSettings>
      <StudDropDist>4.0000</StudDropDist>
    </ProgramSettings>
  </ProgramOptions>
 </Requested>
</Wall>

我知道XML很长,但是错误是说第一行引起了问题,我也不知道为什么.

解决方法:

XDocument.Parse的参数应该是XML字符串,而不是XML文件的路径.请改用XDocument.Load.

标签:serialization,linq-to-xml,xml,c
来源: https://codeday.me/bug/20191027/1947618.html