My favorites | Sign in
Project Home Downloads Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 8: Cannot access an element whose name is 'text'
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----

Sign in to add a comment
Reported by, May 1, 2012
What steps will reproduce the problem?
1. Find or create an XML file containing an element named 'text'.
2. Try to access that element's content via XPath via the findvalue() function
For example, I'm loading lexicon data from a LIFT file within the context of an 'entry' element. This line fails:
lexeme = context.findvalue('lexical-unit/form/text/descendant-or-self::text()', entry)

xpath.exceptions.XPathParseError: Syntax error:

What is the expected output? What do you see instead?
I was hoping it could handle this kind of input file, since I think it's valid XML. But apparently text (even without parentheses) is some kind of reserved word, either in XPath or py-dom-xpath, I'm not sure.

What version of the product are you using? On what operating system?
Version 0.1, fron 2/22/2009, on WinXP SP3 under Python 2.7. 

Please provide any additional information below.
Is there an alternate syntax for this kind of thing? Or is there an easier workaround than what I've come up with? (I.e. making a copy of the source file, renaming all of its text elements to textt, and writing my XPaths to match that. Tedious.)

Sign in to add a comment

Powered by Google Project Hosting