Fragment Insertion - is this a bug?
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 11
- Joined: Fri Nov 11, 2011 3:39 pm
Fragment Insertion - is this a bug?
Hi,
I am having some issues debugging the placement of a fragment insertion using Author actions: can someone confirm if this is a bug in the software, or the user
?
I have a structure like this:
My action uses the built-in InsertOrReplaceFragmentOperation with the following options:
Activation XPath: ancestor-or-self::div[@class="activity-item"][not(child::something)]
fragment: <something/>
InsertLocation: ancestor-or-self::div[@class="activity-item"]
InsertPosition: Inside as last child
Can anyone give me a pointer as to why the content ends up in the wrong place and/or confirm I'm doing the right thing? Oxygen version is <oXygen/> XML Editor 26.1, build 2024091606
I am having some issues debugging the placement of a fragment insertion using Author actions: can someone confirm if this is a bug in the software, or the user

I have a structure like this:
Code: Select all
<document>
<div class="activity-item">
<p/>
<!-- I want to insert <something/> here -->
</div>
<xi:include><!-- The content ends up appearing here --></xi:include>
</document>
Activation XPath: ancestor-or-self::div[@class="activity-item"][not(child::something)]
fragment: <something/>
InsertLocation: ancestor-or-self::div[@class="activity-item"]
InsertPosition: Inside as last child
Can anyone give me a pointer as to why the content ends up in the wrong place and/or confirm I'm doing the right thing? Oxygen version is <oXygen/> XML Editor 26.1, build 2024091606
-
- Posts: 159
- Joined: Mon Nov 24, 2014 1:49 pm
- Location: Greven/Germany
Re: Fragment Insertion - is this a bug?
Your XPath ancestor-or-self gives Oxygen a lot of flexibility to insert the content. Have you tried making it more specific, like self::div[@class="activity-item"]? Maybe this changes the behavior.
stefan-jung.org – Your DITA/DITA-OT XML consultant
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Fragment Insertion - is this a bug?
Post by alex_jitianu »
Hi,
The InsertOrReplaceFragmentOperation has a schemaAware parameter that kicks in when the fragment to insert is not valid at the insert location. When that happens it will search for a valid location and insert it there. To see if that is to blame, set schemaAware to false on the operation.
If we find that this parameter is to blame, ca you please double check if the <somenting/> fragment is really valid in the <div/> ? You could paste it in the text page and see what error you receive.
Best regards,
Alex
The InsertOrReplaceFragmentOperation has a schemaAware parameter that kicks in when the fragment to insert is not valid at the insert location. When that happens it will search for a valid location and insert it there. To see if that is to blame, set schemaAware to false on the operation.
If we find that this parameter is to blame, ca you please double check if the <somenting/> fragment is really valid in the <div/> ? You could paste it in the text page and see what error you receive.
Best regards,
Alex
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Fragment Insertion - is this a bug?
Hi,
Sometimes when evaluating xpath expressions we treat xi:includes as transparent in the Author visual editing mode.
Where is the caret placed in the XML document when invoking the action?
Regards,
Radu
Sometimes when evaluating xpath expressions we treat xi:includes as transparent in the Author visual editing mode.
Where is the caret placed in the XML document when invoking the action?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
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