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

    Join Date
    Oct 2003
    Posts
    239
    Rep Power
    44

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

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,238
    Rep Power
    9400
    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