find out the nodes
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 68
- Joined: Mon Jul 04, 2022 8:42 am
find out the nodes
Hi Team,
I want to find out the nodes which are online with text as Image Online
I am using the code "//embedded.figure.reference[@rendition-type='online']" with this am getting both the online and Inline nodes..
But i need to find out the nodes which are Image Online.
Please help on this.
<embedded.figure.reference image-key="RPT.CC.0.00030" rendition-type="online">Image Online</embedded.figure.reference>
<embedded.figure.reference image-key="RPT.CC.0.00030" rendition-type="online">Image Inline</embedded.figure.reference>
Thanks & Regards
Shilpa.P
I want to find out the nodes which are online with text as Image Online
I am using the code "//embedded.figure.reference[@rendition-type='online']" with this am getting both the online and Inline nodes..
But i need to find out the nodes which are Image Online.
Please help on this.
<embedded.figure.reference image-key="RPT.CC.0.00030" rendition-type="online">Image Online</embedded.figure.reference>
<embedded.figure.reference image-key="RPT.CC.0.00030" rendition-type="online">Image Inline</embedded.figure.reference>
Thanks & Regards
Shilpa.P
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: find out the nodes
Post by Bogdan Dumitru »
Hello,
To match the elements that have the "rendition-type" attribute with the "online" value and that contains the "Image Outline" text, use this XPath selector:
To match the elements that have the "rendition-type" attribute with the "online" value and that contains the "Image Outline" text, use this XPath selector:
Code: Select all
//embedded.figure.reference[@rendition-type='online'][text()='Image Online']
Bogdan Dumitru
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: find out the nodes
Post by Bogdan Dumitru »
Hello Shilpa,
The given XPath worked for me, here's what I've done to test it:

The given XPath worked for me, here's what I've done to test it:
- opened Oxygen XML Editor (I've figured it out that you're using the stand-alone application because this topic was written into the Oxygen XML Editor forum's section)
- created a new XML file based on your fragment:
- opened XPath/XQuery Builder view
- pressed the "Execute XPath" button
- how do you invoke the XPath?
- do you use Oxygen XML Editor or Oxygen XML Web Author?
- do I understand correctly your needs: match the elements that have the "rendition-type" attribute with the "online" value and that contain the "Image Outline" text?

Bogdan Dumitru
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 68
- Joined: Mon Jul 04, 2022 8:42 am
Re: find out the nodes
Hi Bogdan Dumitru,
Below are the answers for your questions
how do you invoke the XPath? Using DocumentControllerl.findNodesByXPath();
do you use Oxygen XML Editor or Oxygen XML Web Author? Oxygen XML Web Author
do I understand correctly your needs: match the elements that have the "rendition-type" attribute with the "online" value and that contain the "Image Outline" text? Yes "rendition-type" attribute with the "online" value is correct where as "Image Online" is not text its placeholder.
I would like to know how to fetch for placeholder?
I have one more question say , figure node is there in both para and paratext but i want to fetch only from para not from paratext.
How to write a xpath to fetch embedded.figure.reference nodes from otherplaces not in paratext.
<para>
<figure> <embedded.figure.reference image-key="RPT.CC.0.00030" rendition-type="online">Image Online</embedded.figure.reference></figure>
<paratext>
<figure><embedded.figure.reference image-key="RPT.CC.0.00030" rendition-type="online">Image Online</embedded.figure.reference></figure>
</paratext>
</para>
Thanks & Regards
Shilap.p
Below are the answers for your questions
how do you invoke the XPath? Using DocumentControllerl.findNodesByXPath();
do you use Oxygen XML Editor or Oxygen XML Web Author? Oxygen XML Web Author
do I understand correctly your needs: match the elements that have the "rendition-type" attribute with the "online" value and that contain the "Image Outline" text? Yes "rendition-type" attribute with the "online" value is correct where as "Image Online" is not text its placeholder.
I would like to know how to fetch for placeholder?
I have one more question say , figure node is there in both para and paratext but i want to fetch only from para not from paratext.
How to write a xpath to fetch embedded.figure.reference nodes from otherplaces not in paratext.
<para>
<figure> <embedded.figure.reference image-key="RPT.CC.0.00030" rendition-type="online">Image Online</embedded.figure.reference></figure>
<paratext>
<figure><embedded.figure.reference image-key="RPT.CC.0.00030" rendition-type="online">Image Online</embedded.figure.reference></figure>
</paratext>
</para>
Thanks & Regards
Shilap.p
-
- Site Admin
- Posts: 172
- Joined: Tue Mar 20, 2018 5:28 pm
Re: find out the nodes
Post by Bogdan Dumitru »
Hi Shilpa,
Regarding "I would like to know how to fetch for placeholder", I'm not sure what you mean by "placeholder". Usually a placeholder it's a text that it's present when the element is empty, in Oxygen it can be configured via the "-oxy-placeholder-content" CSS property [0], it's only a hint for the author, it's not part of the XML source as you can see from "Edit as XML" action from the "More..." menu.
Do you refer to the "-oxy-placeholder-content" placeholder or at the text node within the element?
Regarding "How to write a xpath to fetch embedded.figure.reference nodes from otherplaces not in paratext", this can be done by using the "ancestor::" XPath Axis, for example "//c[not(ancestor::a)]" would select all "c" elements that doesn't have "a" as an ancestor.
[0] https://www.oxygenxml.com/doc/versions/ ... nsion.html
Regarding "I would like to know how to fetch for placeholder", I'm not sure what you mean by "placeholder". Usually a placeholder it's a text that it's present when the element is empty, in Oxygen it can be configured via the "-oxy-placeholder-content" CSS property [0], it's only a hint for the author, it's not part of the XML source as you can see from "Edit as XML" action from the "More..." menu.
Do you refer to the "-oxy-placeholder-content" placeholder or at the text node within the element?
Regarding "How to write a xpath to fetch embedded.figure.reference nodes from otherplaces not in paratext", this can be done by using the "ancestor::" XPath Axis, for example "//c[not(ancestor::a)]" would select all "c" elements that doesn't have "a" as an ancestor.
[0] https://www.oxygenxml.com/doc/versions/ ... nsion.html
Bogdan Dumitru
http://www.oxygenxml.com
http://www.oxygenxml.com
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