GNOME Bugzilla – Bug 442275
Processing Instruction Tokenizer throws errors when processing DocBook
Last modified: 2007-05-31 05:09:32 UTC
One of our reporters encountered a strange behavior in XSLT processor when trying to compile Lessons for Lizards. I reduced the files to minimal size and created simple testcase (attached). File lessons4lizards.xml contains: <bookinfo> <pubdate><?dbtimestamp?></pubdate> </bookinfo> When I run `xsltproc -o /dev/null docbook.xsl lessons4lizards.xml` following error appears: runtime error: file file:///usr/share/xml/docbook/stylesheet/nwalsh/1.72.0/lib/lib.xsl line 212 element value-of Internal error in xsltValueOf(): failed to cast an XPath object to string. Everything is OK when <?dbtimestamp?> is changed into <?dbtimestamp ?> (space before second question mark). Bug are reproducible libxml2-2.6.28 and libxslt-1.1.20. (libxml2-2.6.26 and libxslt-1.1.17 are OK).
Created attachment 89045 [details] testcase
Fixed problem with xpath's string-value for a PI node with no content. Fixed code (libxml2/xpath.c) is in SVN. Thanks for the report.