• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 536
  • Last Modified:

Extract Element content from XML

Hi all
I have below an  xml file
I am looking for a small script that will help me extract the content "Content".
and store it in a string.  i.e Given the mimeType "application/pdf". once the scanner sees that a given Attachment node has application/pdf, then store the value of Content to string

string varString = " JVBERi0xLjQgolJUVPRgo=";

Thanks in Advance

   <Attachments>
      <Content>JVBERi0xLjQgolJUVPRgo=</Content>
      <mimeType>application/pdf</mimeType>


<?xml version="1.0" encoding="iso-8859-1"?>
<XMLEnvelope>
  <Header>
    <SenderID>950001</SenderID>
    <ReceiverID>001</ReceiverID>
    <DocumentID>MacDonals</DocumentID>
    <DocumentStandard>UNEDIFACT</DocumentStandard>
    <DocumentType>Invoice</DocumentType>
  </Header>
  <Data>
    <Content><![CDATA[UNA:+68']]></Content>
    <Attachments>
      <Content>JVBERi0xLjQgolJUVPRgo=</Content>
      <mimeType>application/pdf</mimeType>
      <Filename>Invoice.pdf</Filename>
      <Size>47180</Size>
      <Description></Description>
    </Attachments>
    <Attachments>
      <Content>PD94bWwgdmVycRvY29sPg==</Content>
      <mimeType>x-application/log</mimeType>
      <Filename>log.xml</Filename>
      <Size>3610</Size>
      <Description>Validation Result</Description>
    </Attachments>
  </Data>
</XMLEnvelope>

Open in new window

0
ZURINET
Asked:
ZURINET
1 Solution
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now