I am trying to convert a number of SQL Server FOR XML queries and XSL Templates, from a legacy ASP application to PHP.
Basically the app assembles an XML document from several queries then uses the XSL template to output HTML.
I have being reading this blog post:
I am using sqlsrv_query() followed by sqlsrv_fetch() and sqlsrv_get_field() to get the data. The result set is returned by default as an XML stream.
I can't figure out how to read the stream into a DOMDocument object. I guess I can convert the output to a string, then parse the string into the object, but how do you read the XML stream directly?