How can I filter extra content from this XML? When I open it in web browser I get HTML page with text
Was there an error when you load the XML?
LastMitch
Industrious Poster
4,146 posts since Mar 2012
Reputation Points: 132
Solved Threads: 334
Skill Endorsements: 45
I think need to adjusted your $xml_url. The reason why because it's not letting you read the XML.
LastMitch
Industrious Poster
4,146 posts since Mar 2012
Reputation Points: 132
Solved Threads: 334
Skill Endorsements: 45
LastMitch
Industrious Poster
4,146 posts since Mar 2012
Reputation Points: 132
Solved Threads: 334
Skill Endorsements: 45
It is generated with that code in the end of the file and because of that I cannot read it like XML, so I need to strip that par somehow to read it like XML if it is possible.
If you mention you can't read the XML but now you can?
How to exclude HTML from XML?
You just don't want the HTML tags appear?
I don't get.
XML file is separate file.
HTML file read the XML.
You don't put XML with HTML in 1 file.
LastMitch
Industrious Poster
4,146 posts since Mar 2012
Reputation Points: 132
Solved Threads: 334
Skill Endorsements: 45
The problem is that that is the "XML" which is given to me but it has html tags in it, so I cannot read it like XML, I need to find a way to exclude that tags when reading this so called XML
This:
$xml_url= 'http://b2b.domain.com/GetProductsXML.aspx?username=USERNAME&password=PASSWORD';
$xml = simplexml_load_file(utf8_encode($xml_url), 'SimpleXMLElement', LIBXML_NOCDATA);
Take everything except:
$xml = simplexml_load_file('GetProductsXML.xml');
I want to know can you load the GetProductsXML.xml without any issue?
If you can then there's no issue with reading the file.
Then the issue is has something to do with this:
$xml_url= 'http://b2b.domain.com/GetProductsXML.aspx?username=USERNAME&password=PASSWORD';
If there's an issue reading the GetProductsXML.xml that will tell you that you have a issue reading the GetProductsXML.xml file.
LastMitch
Industrious Poster
4,146 posts since Mar 2012
Reputation Points: 132
Solved Threads: 334
Skill Endorsements: 45
LastMitch
Industrious Poster
4,146 posts since Mar 2012
Reputation Points: 132
Solved Threads: 334
Skill Endorsements: 45
Why is there html in your xml?
diafol
Keep Smiling
10,644 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,509
Skill Endorsements: 57
XML files should only contain XML.
diafol
Keep Smiling
10,644 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,509
Skill Endorsements: 57
That I know, but I cannot do anything in this case, just remove it if possible?
I would, but, you could however read the file into a string and then remove the html part, and use the remainder in simplexml_load_string().
diafol
Keep Smiling
10,644 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,509
Skill Endorsements: 57
What have you tried? show us the code you used. perhaps we can tweak it.
diafol
Keep Smiling
10,644 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,509
Skill Endorsements: 57