xml file balance and control

Welcome Forums General PowerShell Q&A xml file balance and control

Viewing 2 reply threads
  • Author
    Posts
    • #231541
      Participant
      Topics: 1
      Replies: 0
      Points: 14
      Rank: Member

      I have to validate an xml file by counting number of segments in the file between ST and SE segments and balancing it against the count provided in the SE segment field. These ST and SE segments can repeat multiple times through out the file so I have to do this validation multiple times. Please let me know what is the best way to do this. TIA.

      • This topic was modified 1 month, 1 week ago by Sam3568.
    • #231598
      Participant
      Topics: 5
      Replies: 2373
      Points: 6,011
      Helping Hand
      Rank: Community MVP

      Sam, welcome to Powershell.org. Please take a moment and read the very first post on top of the list of this forum: Read Me Before Posting! You’ll be Glad You Did!.

      This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

      What have you tried so far? We expect you to make an own attempt to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.

    • #231607
      Participant
      Topics: 12
      Replies: 1643
      Points: 2,665
      Helping Hand
      Rank: Community Hero

      Have you tried anything? There are a tons of example of XML parsing is you simply searched. If the number of segments is static, for instance there should always be 5 child elements under each, you can use a XSD. If the number is dynamic and you need to confirm the count, use dot notation to get a count.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.