After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 64044 - Whitespaces in XPath-expressions
Whitespaces in XPath-expressions
Status: VERIFIED INCOMPLETE
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2001-11-08 09:22 UTC by Gero Meißner
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gero Meißner 2001-11-08 09:22:07 UTC
When using the xsl:template element there are problems with whitespaces in 
XPath-expressions in the attribute 'match'. Designing the source code I 
tried to insert whitespaces (newlines) in an XPath-expression.

Example (newline after every predicate):

<xsl:template match="abbildung[@groesse = 100] |
                     abbildung[@groesse > 50]
                              [legende or beschreibung]
                              [@ausrichtung != 'rechts']
                              [@ausrichtung != 'kompakt']">

Running xsltproc doesn't work correctly. There are also no error messages. 
The only way to successfully transform the document was to remove all 
whitespaces (newlines).

There were no problems when using the same stylesheets with xalan or IE 
5.x.

Can you tell me whether it is possible to use whitespaces in XPath-
expressions?
Comment 1 Daniel Veillard 2001-11-08 14:05:49 UTC
Don't understand where the problem might be coming from !
I checked the XPath parser code and it does skip blanks between
consecutive predicates.
I can't reproduce the problem, provide input (XML + XSLT) as 
well as making sure your are using a recent version, if you 
want me to investigate further.

Daniel
Comment 2 Daniel Veillard 2001-11-26 10:27:27 UTC
Okay, I found the bug and fixed it in CVS. The problem was not
at the XPath compilation level but in template matches compilation,
I forgot to add an instruction to skip blanks between consecutive
predicates at that level !

http://cvs.gnome.org/bonsai/cvsquery.cgi?module=libxslt&branch=HEAD&branchtype=match&dir=libxslt&file=&filetype=match&who=veillard&whotype=match&sortby=Date&hours=&date=explicit&mindate=11%2F26%2F01+05%3A22&maxdate=11%2F26%2F01+05%3A24&cvsroot=%2Fcvs%2Fgnome

Very small patch but seems to fix the bug,

  thanks a lot for the report,

Daniel