How to make some form controls editable while other content
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 1
- Joined: Mon Jun 23, 2014 9:59 pm
How to make some form controls editable while other content
Post by branislav.mikulas »
Hi,
I have the following XML (a short sample extracted from a more complex one):
and an associated CSS stylesheet:
(I used the oxy_xpath function to show the names, because I did not figure out if it is possible to get the @name values using the oxy_label function)
However I would like to have the number and the name of stations to be fixed and also the number and the names of the params to be fixed. I want only the param's "value" attributes to be editable in the Author mode.
Then I tried adding the following to the CSS:
The -oxy-editable:false applied to the "station" as expected but the -oxy-editable:true did not apply to the "param" (so the "param" was not editable at all). Anyway I guess if the -oxy-editable:true worked for the "param", it would make all the "param" element editable (not only the @value) so I think it still would not be exactly what I wanted to achieve.
Could you please give some advice? Thank you.
I have the following XML (a short sample extracted from a more complex one):
Code: Select all
<weather>
<section name="All">
<station name="KhasabPort">
<param name="T_MIN" value="34"/>
<param name="T_MAX" value="40"/>
</station>
<station name="Matrah">
<param name="T_MIN" value="30"/>
<param name="T_MAX" value="35"> </param>
</station>
</section>
</weather>
Code: Select all
* {
display: block;
margin-left: 5px;
}
station:before {
content:
oxy_xpath("@name")
}
param:before {
content:
oxy_xpath("@name")
": "
oxy_editor( type, text,
edit, "@value");
}
However I would like to have the number and the name of stations to be fixed and also the number and the names of the params to be fixed. I want only the param's "value" attributes to be editable in the Author mode.
Then I tried adding the following to the CSS:
Code: Select all
station {
-oxy-editable:false;
}
param {
-oxy-editable:true;
}
Could you please give some advice? Thank you.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to make some form controls editable while other cont
Hi,
Once you set -oxy-editable:false; to an element, the property will be propagated down to all its descendents, so you cannot specify that an ancestor is not editable but a certain descendant XML element is editable.
What you want can right now only be done by using our Author SDK Java API:
http://www.oxygenxml.com/oxygen_sdk.htm ... horing_SDK
We have a Java API called ro.sync.ecss.extensions.api.AuthorDocumentFilter which can be set and would allow you to intercept insertion and deletion events and reject them if they are done in certain places from the XML. If you want to try this approach, I could try to give you more details about this.
As a side observation, please try to use oxy_xpath as little as possible in the CSS as it might induce performance problems in very large documents, for example instead of constructs like this:
you can use directly:
which is the regular way to get the value of an attribute in CSS.
Regards,
Radu
Once you set -oxy-editable:false; to an element, the property will be propagated down to all its descendents, so you cannot specify that an ancestor is not editable but a certain descendant XML element is editable.
What you want can right now only be done by using our Author SDK Java API:
http://www.oxygenxml.com/oxygen_sdk.htm ... horing_SDK
We have a Java API called ro.sync.ecss.extensions.api.AuthorDocumentFilter which can be set and would allow you to intercept insertion and deletion events and reject them if they are done in certain places from the XML. If you want to try this approach, I could try to give you more details about this.
As a side observation, please try to use oxy_xpath as little as possible in the CSS as it might induce performance problems in very large documents, for example instead of constructs like this:
Code: Select all
oxy_xpath("@name")
Code: Select all
attr("name")
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to make some form controls editable while other cont
One more thing,
We are discussing internally about implementing a special "-oxy-editable" extension value called something like:
This would allow users to edit in those places only by using form control functionality, without allowing users to insert/remove content in any other way.
So if we implement this in a future version, it will also probably be a good fix for your issue. I'll update this forum thread if we do.
Regards,
Radu
We are discussing internally about implementing a special "-oxy-editable" extension value called something like:
Code: Select all
-oxy-editable:form-controls-only;
So if we implement this in a future version, it will also probably be a good fix for your issue. I'll update this forum thread if we do.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
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