Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

XPATH get node based of value of another node

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I don´t get any output from this query.

Thanks in advance

>Solution :

You want this:

/MIME_INFO/MIME[MIME_TYPE='image/jpeg']/MIME_SOURCE
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading