# Issue with xml validation

**URL:** <https://community.postman.com/t/issue-with-xml-validation/24447>\
**Category:** Help Hub\
**Tags:** validation, xml\
**Created:** [June 3, 2021, 6:21am UTC](https://community.postman.com/t/issue-with-xml-validation/24447 "2021-06-03T06:21:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mariamobica](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@Mariamobica](https://community.postman.com/u/Mariamobica)\
**Post date:** [June 3, 2021, 6:21am UTC](https://community.postman.com/t/issue-with-xml-validation/24447/1 "2021-06-03T06:21:28Z")

</div>

Hi, I would like to validate the values of XML parameters but I faced some issues.

```
            <VHBTV_CD:MediaAttributes>
                <VHBTV_CD:MediaTrack>
                    <VHBTV_CD:SubTitle impairedHearing="true">FRE</VHBTV_CD:SubTitle>
                </VHBTV_CD:MediaTrack>
            </VHBTV_CD:MediaAttributes>

```

I can only validate the value of an attribute impairedHearing:  
pm.expect(jsonObject[‘VHBTV\_GRID’][‘ContentLocationTable’][‘TVContentLocation’][‘VHBTV\_TV:AVAttributes’] [‘VHBTV\_CD:MediaAttributes’][‘VHBTV\_CD:MediaTrack’][‘VHBTV\_CD:SubTitle’].$[‘impairedHearing’]).to.eql(‘true’);

I try to find out how to validate ‘SubTitle’ itself, so I print it to the console:  
console.log(jsonObject[‘VHBTV\_GRID’][‘ContentLocationTable’][‘TVContentLocation’][‘VHBTV\_TV:AVAttributes’][‘VHBTV\_CD:MediaAttributes’][‘VHBTV\_CD:MediaTrack’][‘VHBTV\_CD:SubTitle’])

- ▶{\_: “FRE”, $: {…}}

1. \_: “FRE”

2. ▶$: {…}

3. impairedHearing: “true”

The issue is related with {_: “FRE”, $: {…}} - I have no idea how to deal with '_:’

To sum up. I know how to validate the attribute but really don’t know how to validate the language of the subtitle.

Similar situation with genre:  
\<VHBTV\_CD:GenreList\>  
\<VHBTV\_CD:Genre genreLabel=“Enfant - série”\>BFT-003-005\</VHBTV\_CD:Genre\>  
\</VHBTV\_CD:GenreList\>

I am able to validate the genreLabel:  
pm.expect(jsonObject[‘VHBTV\_GRID’][‘ContentTable’][‘VHBTV\_CD:Content’][‘VHBTV\_CD:GenreList’] [‘VHBTV\_CD:Genre’].$[‘genreLabel’]).to.eql(‘Enfant - série’);

but no idea how to check the value of VHBTV\_CD:Genre.

console.log(jsonObject[‘VHBTV\_GRID’][‘ContentTable’][‘VHBTV\_CD:Content’][‘VHBTV\_CD:GenreList’] [‘VHBTV\_CD:Genre’])

![image](https://us1.discourse-cdn.com/getpostman/original/3X/0/7/0739b15cb80e8e3b82408c0832d3b3333fd1a0f7.png)

Thank you in advance for any tips 🙂

---

<div class="post-metadata">

**Author:** ![bpricilla](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/bpricilla/32/6511_2.png) [@bpricilla](https://community.postman.com/u/bpricilla)\
**Post date:** [June 3, 2021, 7:44am UTC](https://community.postman.com/t/issue-with-xml-validation/24447/2 "2021-06-03T07:44:58Z")

</div>

Hello @Mariamobica , Welcome to the community 🥳

```auto
var cheerio = require('cheerio');
const $ = cheerio.load(responseBody);
console.log($('VHBTV_CD\\:SubTitle').text());

```

Please try if this works, you can try to scrape using text() method along with Cheerio.

Also I have added few assertions for [Public SOAP API’s](https://www.postman.com/bpricilla/workspace/pricilla-s-api-space/request/12539800-6e10cf9a-a5fa-4bd7-9b72-8211b0363c57), kindly check if you need to 😊

---

<div class="post-metadata">

**Author:** ![Mariamobica](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@Mariamobica](https://community.postman.com/u/Mariamobica)\
**Post date:** [June 4, 2021, 7:06am UTC](https://community.postman.com/t/issue-with-xml-validation/24447/3 "2021-06-04T07:06:49Z")

</div>

Hello

Thank you for your answer 🙂  
It seems to work but still not perfect.

For Subtile the console output looks like that:  
“content.subtitleFRE” instead ‘FRE’

and for Genre it looks like that:  
"BFT-003-005BFT-003-000 " instead ‘BFT-003-005’

I will try it figure it out.
