othermeta/name/content completion framework extension
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 3
- Joined: Tue Apr 09, 2024 10:17 pm
othermeta/name/content completion framework extension
Post by stephanie-m »
I would like to specify values for the @content attribute of the <othermeta> element in a map based on the @name attribute value.
For example:
Where content = User Guide, Installation Guide, or other defined values
and
Where content = Active or Discontinued
I have already extended a custom dita map framework with resources/cc_config_ext.xml with proposed values for the <permissions> element @view attribute using the following instructions:
https://www.oxygenxml.com/doc/versions/ ... osals.html
As expected, this method will not work for othermeta @content due to the dependency on the @name attribute. If I try it anyway as a test, the first value set for content in my config file is used for all @content instances in my map.
To do this correctly based on the context, I have tried the steps in the following articles:
https://blog.oxygenxml.com/topics/contr ... lues2.html
https://www.oxygenxml.com/doc/versions/ ... in_context
When testing these two methods one at a time, I placed either the getvalues.xsl or meta.xsl files in the resources folder and have also tried within resources/xsl to no avail.
For meta.xsl, I used the code from the article and customized the xsl:choose as follows:
For getvalues, I tried the following:
I have confirmed that the resources folder of my custom framework is listed above the base framework resources folder on the Classpath tab, as the permissions customization is working.
I'm missing something somewhere and am attaching the files in case anyone can see what I've done wrong.
Note: I am using Oxygen 23.1 right now but will be upgrading to the latest version in the next month or so.
For example:
Code: Select all
<othermeta name="doctype" content="User Guide"/>
and
Code: Select all
<othermeta name="product-status" content="Active"/>
I have already extended a custom dita map framework with resources/cc_config_ext.xml with proposed values for the <permissions> element @view attribute using the following instructions:
https://www.oxygenxml.com/doc/versions/ ... osals.html
As expected, this method will not work for othermeta @content due to the dependency on the @name attribute. If I try it anyway as a test, the first value set for content in my config file is used for all @content instances in my map.
To do this correctly based on the context, I have tried the steps in the following articles:
https://blog.oxygenxml.com/topics/contr ... lues2.html
https://www.oxygenxml.com/doc/versions/ ... in_context
When testing these two methods one at a time, I placed either the getvalues.xsl or meta.xsl files in the resources folder and have also tried within resources/xsl to no avail.
For meta.xsl, I used the code from the article and customized the xsl:choose as follows:
Code: Select all
<items>
<xsl:choose>
<xsl:when test="$name = 'doctype'">
<item value="Installation Guide">
<item value="User Guide">
</xsl:when>
<xsl:when test="$name = 'product-status'">
<item value="Active"/>
<item value="Discontinued"/>
</xsl:when>
</xsl:choose>
</items>
Code: Select all
<items>
<xsl:if test="$propertyElement/@name = 'doctype'">
<item value='Installation Guide'>
<item value='User Guide'>
</xsl:if>
<xsl:if test="$propertyElement/@name = 'product-status'">
<item value='Active'/>
<item value='Discontinued'/>
</xsl:if>
</items>
I'm missing something somewhere and am attaching the files in case anyone can see what I've done wrong.
- resources.zip
- (4.16 KiB) Downloaded 62 times
Re: othermeta/name/content completion framework extension
Hi,
I'm attaching a DITA Map framework extension which works for me with Oxygen 26.1.
Using Oxygen 26.1 the simplest approach is to have a "cc_config_ext.xml" file with the content something like this:
https://www.oxygenxml.com/doc/versions/ ... osals.html
but this way of specifying the "path="othermeta[@name='product']/@content"" probably does not work with Oxygen 23.1.
Some observations based on what you tried:
The "cc_value_config.xml" is deprecated as the name of a configuration file, it might still work but it's best to move its content to the "cc_config_ext.xml".
I do not know how you actually used the in your DITA Map extension framework configuration, I assume it's in a folder "resources" and that the DITA Map framework extension's "Classpath" list refers to something like ${framework}/resources. Ideally you should have attached the entire zipped framework extension.
If you open both your XSLT stylesheets in Oxygen, it reports them as not wellformed, you probably forgot to close the <item> tags in both of them. So something like:
<item value='Wiring Diagram'> =><item value='Wiring Diagram'/>
Regards,
Radu
I'm attaching a DITA Map framework extension which works for me with Oxygen 26.1.
- frameworks.zip
- (10.56 KiB) Downloaded 64 times
https://www.oxygenxml.com/doc/versions/ ... osals.html
Code: Select all
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.oxygenxml.com/ns/ccfilter/config http://www.oxygenxml.com/ns/ccfilter/config/ccConfigSchemaFilter.xsd"
xmlns="http://www.oxygenxml.com/ns/ccfilter/config">
<valueProposals path="othermeta[@name='color']/@content">
<items>
<item value="red"/>
<item value="blue"/>
</items>
</valueProposals>
<valueProposals path="othermeta[@name='product']/@content">
<items>
<item value="p1"/>
<item value="p2"/>
</items>
</valueProposals>
</config>
Some observations based on what you tried:
The "cc_value_config.xml" is deprecated as the name of a configuration file, it might still work but it's best to move its content to the "cc_config_ext.xml".
I do not know how you actually used the in your DITA Map extension framework configuration, I assume it's in a folder "resources" and that the DITA Map framework extension's "Classpath" list refers to something like ${framework}/resources. Ideally you should have attached the entire zipped framework extension.
If you open both your XSLT stylesheets in Oxygen, it reports them as not wellformed, you probably forgot to close the <item> tags in both of them. So something like:
<item value='Wiring Diagram'> =><item value='Wiring Diagram'/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Tue Apr 09, 2024 10:17 pm
Re: othermeta/name/content completion framework extension
Post by stephanie-m »
Thanks, Radu! I have confirmed that specifying the "path="othermeta[@name='product']/@content"" in the cc_config_ext.xml file does not work with Oxygen 23.1. I will test again once I've upgraded.
I fixed the end tags for the items but they still do not work with either the getvalues or meta method. I have a resources folder in my framework folder and it is listed at the top of the classpath list. I've attached the full framework folder.
I think the answer is to upgrade to 26.1 and then retest with the code you shared for the cc_config_ext.xml file.
I fixed the end tags for the items but they still do not work with either the getvalues or meta method. I have a resources folder in my framework folder and it is listed at the top of the classpath list. I've attached the full framework folder.
- custom_frameworks.zip
- (48.06 KiB) Downloaded 66 times
Re: othermeta/name/content completion framework extension
Hi,
The meta.xsl stylesheet you attached is still invalid, if you open and validate it, Oxygen reports a validation error.
Anyway, I made it valid, and made some more changes on my side, attaching the modifications I made on my side for the "resources" folder in the DITA Map framework extension folder. I think these changes should work also with version 23.1 but I did not test with it.
Regards,
Radu
The meta.xsl stylesheet you attached is still invalid, if you open and validate it, Oxygen reports a validation error.
Anyway, I made it valid, and made some more changes on my side, attaching the modifications I made on my side for the "resources" folder in the DITA Map framework extension folder. I think these changes should work also with version 23.1 but I did not test with it.
- resources.zip
- (6.07 KiB) Downloaded 67 times
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Tue Apr 09, 2024 10:17 pm
Re: othermeta/name/content completion framework extension
Post by stephanie-m »
Thanks, Radu! That worked!
I completely missed the extra / in the code. Thanks for catching that.
I completely missed the extra / in the code. Thanks for catching that.
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