Using XPath with bookmap metadata
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 26
- Joined: Wed Nov 27, 2019 11:03 am
Using XPath with bookmap metadata
Hi!
Please help me to return the value of bookmeta/bookrights/copyrlast/year.
Expression
returns two values, from <copyrfirst> and <copyrlast>.
Sincerely,
Dmitry
Please help me to return the value of bookmeta/bookrights/copyrlast/year.
Expression
Code: Select all
//*[contains(@class, "bookmap/year")]/text()
Sincerely,
Dmitry
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Using XPath with bookmap metadata
Post by alex_jitianu »
Hi Dmitry,
That's because both copyrlast and copyrfirst have a year element in them, and your XPath takes all the year elements from anywhere in the document. Just restrict the expression to the year from withing copyrlast, like this:
Best regards,
Alex
That's because both copyrlast and copyrfirst have a year element in them, and your XPath takes all the year elements from anywhere in the document. Just restrict the expression to the year from withing copyrlast, like this:
Code: Select all
//*[contains(@class, "bookmap/copyrlast")]/*[contains(@class, "bookmap/year")]/text()
Alex
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service