Home › Curriculum › Technical Foundations › XML and XPath
XML, web and API fundamentals · 14 min · XML 1.0 / XPath 1.0XML and XPath
Well-formed XML, Odoo data files and records, and XPath expressions for view inheritance.
In this lesson
- Well-formed XML
- Odoo data files: record, ref, eval, noupdate
- XPath for view inheritance
Key points
- One root, closed tags, quoted attributes, escaped entities
- <record id model> with <field>; ref and eval
- noupdate="1" protects user-editable data from updates
- Target named elements with XPath; avoid positional indexes
Real-world example
A view extension using //group[2] broke after an Odoo update added a group above it; the new field appeared in the wrong tab. Rewriting it as //group[@name='sale_shipping'] made it survive the next three updates untouched.
Questions and answers
How do you write < inside an XML attribute?
<
What does ref('base.group_user') inside eval return?
The database ID of the record with that external ID.