
January 14th, 2012, 12:43 PM
|
|
|
|
Why is libxml reporting error on line 0?
Hi all
Really strange one. I'm transforming XSL via PHP's SimpleXML. For some reason any errors emanating from bad XPath expressions are said to be on line zero - not the actual line they come from.
An example:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select='$someVar' />
</xsl:template>
</xsl:stylesheet>
Clearly the error there is on line 3 (undeclared var). Yet the line mentioned in the libxml error that is generated (and which I am catching) says line zero every time. For parse errors, though, the line number is correct.
What on earth is going on?
Thanks in advance
|