simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found












0















So, I am stumped. I know the XML is valid, as it validates everywhere I've tried it, but this XML:



<?xml version="1.0" encoding="utf-8"?>
<DataSet xmlns="http://webservices.theshootingwarehouse.com/smart/Images.asmx">
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="MFGNO" type="xs:int" minOccurs="0" />
<xs:element name="Logo" type="xs:base64Binary" minOccurs="0" />
<xs:element name="LogoDate" type="xs:dateTime" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<Table diffgr:id="Table1" msdata:rowOrder="0">
<MFGNO>1</MFGNO>
<Logo>...truncated...</Logo>
<LogoDate>2012-07-30T00:00:00+00:00</LogoDate>
</Table>
</NewDataSet>
</diffgr:diffgram>
</DataSet>


doesn't work when called like so:



$data = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_COMPACT | LIBXML_PARSEHUGE);


with the error:



simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found


I am about to go insane here! There seems to be no rhyme or reason to this...



-Sam










share|improve this question


















  • 4





    3v4l.org/Yvt5g works just fine. probably an invisible character somewhere in the beginning of the XML. Try bin2hex($data); and show the result. It should start with 3c as can be seen here: 3v4l.org/oL3nD

    – Xatenev
    Nov 14 '18 at 13:28













  • Either what @Xatenev said, or your variable doesn’t contain what you think any more at this point. (Since you are overwriting your variable that used to contain the XML string here, $data = simplexml_load_string($data, …, maybe you have also done that before at some point already …?)

    – misorude
    Nov 14 '18 at 13:30






  • 1





    Whenever you provide a simplified example you should make sure that your example produces the claimed error. Additionally, become best friends with var_dump() for your own sanity's sake.

    – MonkeyZeus
    Nov 14 '18 at 13:31













  • @Xatenev I used bin2hex on the straight XML input and it does start with 3c, and the error came immediately again. I use var_dump extensively, and in regards to overriding $data, I am aware. I am checking the variable before I override it, straight before it gets into the Cache, and after. They are compared for differences (none, by the way), and then I just print the XML to see if it changes. That's where I added bin2hex.

    – user00265
    Nov 14 '18 at 14:49













  • @user00265 What is your PHP version? Have you compared the bin2hex to the bin2hex in my 3v4l? e.g. $string = '//bin2hex of you'; $string2 = '//bin2hex of working 3v4l'; strcmp($string,$string2); it should be identical. note: strcmp returns 0 if they are identical.

    – Xatenev
    Nov 14 '18 at 15:06


















0















So, I am stumped. I know the XML is valid, as it validates everywhere I've tried it, but this XML:



<?xml version="1.0" encoding="utf-8"?>
<DataSet xmlns="http://webservices.theshootingwarehouse.com/smart/Images.asmx">
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="MFGNO" type="xs:int" minOccurs="0" />
<xs:element name="Logo" type="xs:base64Binary" minOccurs="0" />
<xs:element name="LogoDate" type="xs:dateTime" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<Table diffgr:id="Table1" msdata:rowOrder="0">
<MFGNO>1</MFGNO>
<Logo>...truncated...</Logo>
<LogoDate>2012-07-30T00:00:00+00:00</LogoDate>
</Table>
</NewDataSet>
</diffgr:diffgram>
</DataSet>


doesn't work when called like so:



$data = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_COMPACT | LIBXML_PARSEHUGE);


with the error:



simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found


I am about to go insane here! There seems to be no rhyme or reason to this...



-Sam










share|improve this question


















  • 4





    3v4l.org/Yvt5g works just fine. probably an invisible character somewhere in the beginning of the XML. Try bin2hex($data); and show the result. It should start with 3c as can be seen here: 3v4l.org/oL3nD

    – Xatenev
    Nov 14 '18 at 13:28













  • Either what @Xatenev said, or your variable doesn’t contain what you think any more at this point. (Since you are overwriting your variable that used to contain the XML string here, $data = simplexml_load_string($data, …, maybe you have also done that before at some point already …?)

    – misorude
    Nov 14 '18 at 13:30






  • 1





    Whenever you provide a simplified example you should make sure that your example produces the claimed error. Additionally, become best friends with var_dump() for your own sanity's sake.

    – MonkeyZeus
    Nov 14 '18 at 13:31













  • @Xatenev I used bin2hex on the straight XML input and it does start with 3c, and the error came immediately again. I use var_dump extensively, and in regards to overriding $data, I am aware. I am checking the variable before I override it, straight before it gets into the Cache, and after. They are compared for differences (none, by the way), and then I just print the XML to see if it changes. That's where I added bin2hex.

    – user00265
    Nov 14 '18 at 14:49













  • @user00265 What is your PHP version? Have you compared the bin2hex to the bin2hex in my 3v4l? e.g. $string = '//bin2hex of you'; $string2 = '//bin2hex of working 3v4l'; strcmp($string,$string2); it should be identical. note: strcmp returns 0 if they are identical.

    – Xatenev
    Nov 14 '18 at 15:06
















0












0








0








So, I am stumped. I know the XML is valid, as it validates everywhere I've tried it, but this XML:



<?xml version="1.0" encoding="utf-8"?>
<DataSet xmlns="http://webservices.theshootingwarehouse.com/smart/Images.asmx">
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="MFGNO" type="xs:int" minOccurs="0" />
<xs:element name="Logo" type="xs:base64Binary" minOccurs="0" />
<xs:element name="LogoDate" type="xs:dateTime" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<Table diffgr:id="Table1" msdata:rowOrder="0">
<MFGNO>1</MFGNO>
<Logo>...truncated...</Logo>
<LogoDate>2012-07-30T00:00:00+00:00</LogoDate>
</Table>
</NewDataSet>
</diffgr:diffgram>
</DataSet>


doesn't work when called like so:



$data = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_COMPACT | LIBXML_PARSEHUGE);


with the error:



simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found


I am about to go insane here! There seems to be no rhyme or reason to this...



-Sam










share|improve this question














So, I am stumped. I know the XML is valid, as it validates everywhere I've tried it, but this XML:



<?xml version="1.0" encoding="utf-8"?>
<DataSet xmlns="http://webservices.theshootingwarehouse.com/smart/Images.asmx">
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="MFGNO" type="xs:int" minOccurs="0" />
<xs:element name="Logo" type="xs:base64Binary" minOccurs="0" />
<xs:element name="LogoDate" type="xs:dateTime" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<Table diffgr:id="Table1" msdata:rowOrder="0">
<MFGNO>1</MFGNO>
<Logo>...truncated...</Logo>
<LogoDate>2012-07-30T00:00:00+00:00</LogoDate>
</Table>
</NewDataSet>
</diffgr:diffgram>
</DataSet>


doesn't work when called like so:



$data = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_COMPACT | LIBXML_PARSEHUGE);


with the error:



simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found


I am about to go insane here! There seems to be no rhyme or reason to this...



-Sam







php xml dataset simplexml






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 13:25









user00265user00265

85210




85210








  • 4





    3v4l.org/Yvt5g works just fine. probably an invisible character somewhere in the beginning of the XML. Try bin2hex($data); and show the result. It should start with 3c as can be seen here: 3v4l.org/oL3nD

    – Xatenev
    Nov 14 '18 at 13:28













  • Either what @Xatenev said, or your variable doesn’t contain what you think any more at this point. (Since you are overwriting your variable that used to contain the XML string here, $data = simplexml_load_string($data, …, maybe you have also done that before at some point already …?)

    – misorude
    Nov 14 '18 at 13:30






  • 1





    Whenever you provide a simplified example you should make sure that your example produces the claimed error. Additionally, become best friends with var_dump() for your own sanity's sake.

    – MonkeyZeus
    Nov 14 '18 at 13:31













  • @Xatenev I used bin2hex on the straight XML input and it does start with 3c, and the error came immediately again. I use var_dump extensively, and in regards to overriding $data, I am aware. I am checking the variable before I override it, straight before it gets into the Cache, and after. They are compared for differences (none, by the way), and then I just print the XML to see if it changes. That's where I added bin2hex.

    – user00265
    Nov 14 '18 at 14:49













  • @user00265 What is your PHP version? Have you compared the bin2hex to the bin2hex in my 3v4l? e.g. $string = '//bin2hex of you'; $string2 = '//bin2hex of working 3v4l'; strcmp($string,$string2); it should be identical. note: strcmp returns 0 if they are identical.

    – Xatenev
    Nov 14 '18 at 15:06
















  • 4





    3v4l.org/Yvt5g works just fine. probably an invisible character somewhere in the beginning of the XML. Try bin2hex($data); and show the result. It should start with 3c as can be seen here: 3v4l.org/oL3nD

    – Xatenev
    Nov 14 '18 at 13:28













  • Either what @Xatenev said, or your variable doesn’t contain what you think any more at this point. (Since you are overwriting your variable that used to contain the XML string here, $data = simplexml_load_string($data, …, maybe you have also done that before at some point already …?)

    – misorude
    Nov 14 '18 at 13:30






  • 1





    Whenever you provide a simplified example you should make sure that your example produces the claimed error. Additionally, become best friends with var_dump() for your own sanity's sake.

    – MonkeyZeus
    Nov 14 '18 at 13:31













  • @Xatenev I used bin2hex on the straight XML input and it does start with 3c, and the error came immediately again. I use var_dump extensively, and in regards to overriding $data, I am aware. I am checking the variable before I override it, straight before it gets into the Cache, and after. They are compared for differences (none, by the way), and then I just print the XML to see if it changes. That's where I added bin2hex.

    – user00265
    Nov 14 '18 at 14:49













  • @user00265 What is your PHP version? Have you compared the bin2hex to the bin2hex in my 3v4l? e.g. $string = '//bin2hex of you'; $string2 = '//bin2hex of working 3v4l'; strcmp($string,$string2); it should be identical. note: strcmp returns 0 if they are identical.

    – Xatenev
    Nov 14 '18 at 15:06










4




4





3v4l.org/Yvt5g works just fine. probably an invisible character somewhere in the beginning of the XML. Try bin2hex($data); and show the result. It should start with 3c as can be seen here: 3v4l.org/oL3nD

– Xatenev
Nov 14 '18 at 13:28







3v4l.org/Yvt5g works just fine. probably an invisible character somewhere in the beginning of the XML. Try bin2hex($data); and show the result. It should start with 3c as can be seen here: 3v4l.org/oL3nD

– Xatenev
Nov 14 '18 at 13:28















Either what @Xatenev said, or your variable doesn’t contain what you think any more at this point. (Since you are overwriting your variable that used to contain the XML string here, $data = simplexml_load_string($data, …, maybe you have also done that before at some point already …?)

– misorude
Nov 14 '18 at 13:30





Either what @Xatenev said, or your variable doesn’t contain what you think any more at this point. (Since you are overwriting your variable that used to contain the XML string here, $data = simplexml_load_string($data, …, maybe you have also done that before at some point already …?)

– misorude
Nov 14 '18 at 13:30




1




1





Whenever you provide a simplified example you should make sure that your example produces the claimed error. Additionally, become best friends with var_dump() for your own sanity's sake.

– MonkeyZeus
Nov 14 '18 at 13:31







Whenever you provide a simplified example you should make sure that your example produces the claimed error. Additionally, become best friends with var_dump() for your own sanity's sake.

– MonkeyZeus
Nov 14 '18 at 13:31















@Xatenev I used bin2hex on the straight XML input and it does start with 3c, and the error came immediately again. I use var_dump extensively, and in regards to overriding $data, I am aware. I am checking the variable before I override it, straight before it gets into the Cache, and after. They are compared for differences (none, by the way), and then I just print the XML to see if it changes. That's where I added bin2hex.

– user00265
Nov 14 '18 at 14:49







@Xatenev I used bin2hex on the straight XML input and it does start with 3c, and the error came immediately again. I use var_dump extensively, and in regards to overriding $data, I am aware. I am checking the variable before I override it, straight before it gets into the Cache, and after. They are compared for differences (none, by the way), and then I just print the XML to see if it changes. That's where I added bin2hex.

– user00265
Nov 14 '18 at 14:49















@user00265 What is your PHP version? Have you compared the bin2hex to the bin2hex in my 3v4l? e.g. $string = '//bin2hex of you'; $string2 = '//bin2hex of working 3v4l'; strcmp($string,$string2); it should be identical. note: strcmp returns 0 if they are identical.

– Xatenev
Nov 14 '18 at 15:06







@user00265 What is your PHP version? Have you compared the bin2hex to the bin2hex in my 3v4l? e.g. $string = '//bin2hex of you'; $string2 = '//bin2hex of working 3v4l'; strcmp($string,$string2); it should be identical. note: strcmp returns 0 if they are identical.

– Xatenev
Nov 14 '18 at 15:06














0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53301304%2fsimplexml-load-string-entity-line-1-parser-error-start-tag-expected%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53301304%2fsimplexml-load-string-entity-line-1-parser-error-start-tag-expected%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine