Avatar of satmisha
satmisha
Flag for India asked on

Parsing Nested XML File Better Approach

Hi Expert,

I am having big XML File, Need to do followings:

1. Reading Entire XML.
2. Validate followings in XML:
    # WellFormed XML
    # CorrectDate Format.
    # Field Values Etc.
3. Need to change the Value of few Tags.
4. Insert the Data inside DataBase

Since there various Ways to do this, What would be the best approach. Looking forward to hearing from you.
XMLVisual Basic.NET.NET Programming

Avatar of undefined
Last Comment
satmisha

8/22/2022 - Mon
Rose Babu

can you post the XML file and the tags details to be updated?
satmisha

ASKER
Thanks for  your reply..Here is the file....

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2008 rel. 2 sp2 (http://www.altova.com)-->
<Envelope envelopeId="EMI" majorVersion="1" minorVersion="4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Z:\FRAUDD~2\260412\MAINTA~2.XSD">
  <Header>
    <TransactionBlk actor="Next" mustUnderstand="1" name="StdTransBlk" majorVersion="1" minorVersion="2">

      <MsgNm>MaintainGNAFraudDetailRequest</MsgNm>
      <MsgFormatCd>XML</MsgFormatCd>
      <MsgMajVersionNbr>2</MsgMajVersionNbr>

    </TransactionBlk>
    <SecurityBlk name="StdSecurityBlk" majorVersion="1" minorVersion="1" actor="Next" mustUnderstand="1">
      <SAMLBlk>
        <Assertion MajorVersion="1" MinorVersion="0" AssertionID="" Issuer="urn:aexp.com:applName" IssueInstant="2008-02-22T09:30:47.0Z">
          <AttributeStatement>
            <Subject>
              <NameIdentifier NameQualifier="urn:aexp.com:security" Format="urn:aexp.com:security:racf"/>
            </Subject>
            <Attribute AttributeName="" AttributeNamespace="">
              <AttributeValue/>
            </Attribute>
          </AttributeStatement>
        </Assertion>
      </SAMLBlk>
    </SecurityBlk>
  </Header>
  <Body>
    <Request>
      <RequestorId>IDN</RequestorId>
      <OpCd>A</OpCd>
      <MktCd>APA</MktCd>
      <FRDCaseGrp>
        <CaseNbr>A1234567890</CaseNbr>
        <CaseRelCnt>2</CaseRelCnt>
        <LstAssgnRelNbr>1234</LstAssgnRelNbr>
        <DelAllRel>N</DelAllRel>
        <RelGrp>
          <RelNbr>1234</RelNbr>
          <FRDRelGrp>
            <PositiveMatchCnt>01</PositiveMatchCnt>

            <CBORskInd1>X</CBORskInd1>

          </FRDRelGrp>
          <FRDRelGrp>
            <PositiveMatchCnt>02</PositiveMatchCnt>

            <CBORskInd1>X</CBORskInd1>

          </FRDRelGrp>
          <NoteGrp>
            <NoteSeqNbr>01</NoteSeqNbr>

          </NoteGrp>
          <NoteGrp>
            <NoteSeqNbr>02</NoteSeqNbr>

          </NoteGrp>
          <AddrGrp>

            <AddrRskFlagInd>Y</AddrRskFlagInd>

          </AddrGrp>
          <AddrGrp>

            <AddrRskFlagInd>Y</AddrRskFlagInd>

          </AddrGrp>
          <PhoneGrp>

            <PhoneRskFlagInd>Y</PhoneRskFlagInd>
          </PhoneGrp>
          <PhoneGrp>

            <PhoneRskFlagInd>Y</PhoneRskFlagInd>
          </PhoneGrp>
          <VarGrp>

            <RelVarRskFlag>X</RelVarRskFlag>

          </VarGrp>
        </RelGrp>
        <RelGrp>
          <RelNbr>1234</RelNbr>
          <FRDRelGrp>

            <LstUpdtDt>02/04/2012</LstUpdtDt>

          </FRDRelGrp>
          <FRDRelGrp>
            <PositiveMatchCnt>02</PositiveMatchCnt>

            <SENbr>1234567890</SENbr>
          </FRDRelGrp>
          <NoteGrp>
            <NoteSeqNbr>01</NoteSeqNbr>
            <NoteDesc>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</NoteDesc>
          </NoteGrp>
          <NoteGrp>
            <NoteSeqNbr>02</NoteSeqNbr>
            <NoteDesc>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</NoteDesc>
          </NoteGrp>
          <AddrGrp>
            <AddrTypeCd>S </AddrTypeCd>

            <AddrLocatorCd>XXXXXXXXXXXXXXXXXXXXXXX</AddrLocatorCd>
          </AddrGrp>
          <AddrGrp>
            <AddrTypeCd>S </AddrTypeCd>
          </AddrGrp>
          <PhoneGrp>

            <PhoneRskFlagInd>Y</PhoneRskFlagInd>
          </PhoneGrp>
          <PhoneGrp>

            <PhoneRskFlagInd>Y</PhoneRskFlagInd>
          </PhoneGrp>
          <VarGrp>

            <VarVal>XXXX</VarVal>
          </VarGrp>
        </RelGrp>
      </FRDCaseGrp>
    </Request>
  </Body>
</Envelope>
satmisha

ASKER
Want to update following Tags with new Values:

  <MsgNm>MaintainGNAFraudDetailRequest</MsgNm>
      <MsgFormatCd>XML</MsgFormatCd>
      <MsgMajVersionNbr>2</MsgMajVersionNbr>


Pls Suggest.

Looking forward to hearing from you.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
satmisha

ASKER
Increasing the Points to 500.. Pls Help....
ASKER CERTIFIED SOLUTION
darjimaulik

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
satmisha

ASKER
Thnanx Expert, Apologies for late response..