Ask a Question related to PHP Development, Design and Development.
-
Robert Fitzpatrick #1
XML error: junk after document element
I am trying to parse and xml document:
<?xml version="1.0"?>
<!DOCTYPE PrequalResponse PUBLIC "-//New Edge Networks//DTD Pilot
Prequalification Response 2.3//EN"
"http://api.newedgenetworks.com/dtd/prequalresponse.dtd">
<PrequalResponse>
<TransactionCode><Code>1005</Code><Message>Authentication failed: Invalid
user name or password</Message></TransactionCode>
</PrequalResponse>
I received 'XML error: junk after document element at line 5'. I found some
mention searching the web that the xml_parse() function does not know the
end of the stream:
The problem is that, in the general case, there's no way to
determine if a stream is *supposed* to contain multiple documents.
What is needed is some external way to determine the end of the input;
you can then feed the parser data buffers until the end-of-buffer
function returns true. You can do this by embedding the chunks of XML
into another protocol; this should not be difficult if you can
determine the size of each XML document in bytes before sending it, so
that each document can be preceeded by the byte-count. Otherwise,
you'll need a stream encoding that contains explicit end-of-file
markers.
I can set my passing xml document with just '<trythis>1</trythis>' and I get
the same error, except of course it says line 1 instead of line 5.
Any help on how I can be sure the function knows the end of ?
--
Robert
Robert Fitzpatrick Guest
-
MX7 Error: No such classpath element
Hi, I got the same error. every time I restart cf service, i always get that. Did you figured out? if yes, please let me know .thanks. -
web services - Document root element is missing error
Hello, I'm building a super simple web service and am getting the following error: "Could not perform web service invocation "getRandomFact"... -
Web Service - Document root element is missing.
Hello, I'm building a super simple web service and am getting the following error: "Could not perform web service invocation "getRandomFact"... -
3.01 Printing Error - Pages of junk text
I have been randomly experiencing problems printing certain files to our in-house Xerox DocuColor 12 from Indesign CS 3.01. Some files are fine, and... -
[HTML::Element] how to read element by element
Hello I read the doc about HTML::Element, but I don't find how to read the tree create by parse() element by element. The doc says the tree looks...



Reply With Quote

