1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Rep Power

    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:

    <?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' />
    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
  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Washington, USA
    Rep Power
    It may not be recognizing the line endings properly, thus believing that everything is on one line.

IMN logo majestic logo threadwatch logo seochat tools logo