Home > front end >  XPATH get node based of value of another node
XPATH get node based of value of another node

Time:01-08

Im trying to filter an XML File based on the value of the node

    <MIME_INFO>
                <MIME>
                    <MIME_TYPE>image/jpeg</MIME_TYPE>
                    <MIME_SOURCE>image1.jpg</MIME_SOURCE>
                    </MIME>
                <MIME>
                    <MIME_TYPE>image/jpeg</MIME_TYPE>
                    <MIME_SOURCE>image2.jpg</MIME_SOURCE>

                </MIME>
                <MIME>
                    <MIME_TYPE>application/pdf</MIME_TYPE>
                    <MIME_SOURCE>document.pdf</MIME_SOURCE>
                </MIME>
    </MIME_INFO>

im using the following XPATH Function

{MIME_INFO/MIME/MIME_SOURCE[./MIME_TYPE='image/jpeg']}

i want to get the value of MIME_SOURCE based on the value of the MIME_TYPE node.

I don´t get any output from this query.

Thanks in advance

CodePudding user response:

You want this:

/MIME_INFO/MIME[MIME_TYPE='image/jpeg']/MIME_SOURCE
  • Related