Unable to extract info from XML with deserialize -> problem with tag

Hi there!

Imagine I have the following XML file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<DOSSIER TYPE="110">
<my:address><div xmlns="http://www.w3.org/1999/xhtml">
<div><font size="2" face="Arial">Testing </font></div></div></my:address>
</DOSSIER>

If I deserialize this xml and use the following writeline:
"Text: "+xmlDoc.Element(“DOSSIER”).Element(“my:address”).Value

then I will get the error:

Message: ‘my’ is an undeclared prefix. Line 3, position 2.

The problem is due to the tag “my:address”. If I remove the “:”, the error disappears. Do you know how to solve the issue with the “:”?

Thank you.

1 Like

@jcab

Hi Jcab

the code you have returned is valid, But I think the xml string is invalid. Please a look in the below screenshot.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.