Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access an element whose name is 'text' #8

Open
GoogleCodeExporter opened this issue Mar 12, 2015 · 0 comments
Open

Cannot access an element whose name is 'text' #8

GoogleCodeExporter opened this issue Mar 12, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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:
lexical-unit/form/text/descendant-or-self::text()
----------------------^

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.)

Original issue reported on code.google.com by jvcoo...@gmail.com on 1 May 2012 at 2:01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant