-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reader::parse() and Service::parse() return different values #181
Comments
where did you found this code? |
@staabm Line 56 in 03a31ca
Service::parse(): Line 112 in 03a31ca
|
are you willing to provide a fix in https://github.com/sabre-io/sabre.io/blob/master/source/xml/reading.md ? |
The reader and service having slightly different signatures is definitely a bit strange in hindsight, but definitely by design. I expect most people to use the service, and the service is meant to be most user-friendly frontend for all of this. |
Using sabre with XSD validation I'm getting unexpected result when using the XSD snippet from documentation.
There's actually 2 problems with suggested solution:
$service = new Sabre\Xml\Service(); $reader = $service->getReader(); $validXml = $reader->setSchema('myschema.xsd') if ($validXml) { $reader->xml($xml); print_r($reader->parse()); }
will not work as the Schema needs to be set after
xml()
method call.Additionally the
parse()
method is returning root element array withname
,value
, andattributes
keys.Looking at code this happens because
Service::parse()
is returning$result['value']
whileReader::parse()
is returning$result
.Can you please either correct the code, to always have same result, or at least update the documentation to make it clear what to expect?
The text was updated successfully, but these errors were encountered: