Use oxy_xpath with oxy_add?
Oxygen general issues.
-
- Posts: 16
- Joined: Thu Nov 03, 2011 3:16 pm
Use oxy_xpath with oxy_add?
I am attempting to use oxy_add in a custom CSS for the Author mode, which works fine. But the catch is I want to use oxy_xpath to return a number for one or two of the input parameters.
I have constructed the following:
oxy_add(oxy_xpath("./path/to/node/number()"),1, number)
This works in that the number is calculated correctly, but I am getting errors in the console as follows:
Any suggestions? Even though the oxy_add is working, I do not want to deploy it to end users with the console spitting out errors.
Thanks.
I have constructed the following:
oxy_add(oxy_xpath("./path/to/node/number()"),1, number)
This works in that the number is calculated correctly, but I am getting errors in the console as follows:
I suspect it is pointing to the dita.css because that is where my custom CSS is imported at.System ID: /Applications/author/modified_frameworks/dita/css_classed/dita.css
Severity: error
Description: [CSS]:Invalid "oxy_add" function signature. Must be "oxy_add"(param1, param2, ..., 'returnType')
Allowed values for the return type: ('integer', 'number', 'px', 'pt', etc).
Example:
width: oxy_add(attr(size), 10, 'px')
Could not convert the 1 argument to a float value.
Any suggestions? Even though the oxy_add is working, I do not want to deploy it to end users with the console spitting out errors.
Thanks.
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Use oxy_xpath with oxy_add?
Hi James,
Basically Oxygen evaluates the XPath expression in two different stages, one when the document is just being built and the expression might not match (because the target nodes might not exist) and one final stage when the document is fully built.
We'll try to make some improvements to avoid reporting such problems in the initial stage.
In the meantime, Oxygen fully supports XPath 2.0 expressions so you can have if conditional processing in it like:
This will help you give a fallback value from the XPath expression and avoid the warning.
We'll update this forum post when we find a fix for the original problem.
Regards,
Radu
Basically Oxygen evaluates the XPath expression in two different stages, one when the document is just being built and the expression might not match (because the target nodes might not exist) and one final stage when the document is fully built.
We'll try to make some improvements to avoid reporting such problems in the initial stage.
In the meantime, Oxygen fully supports XPath 2.0 expressions so you can have if conditional processing in it like:
Code: Select all
*[audience]:before{
content:oxy_add(oxy_xpath("if(count(@audience) > 0) then @audience else '0'"),1, number);
}
We'll update this forum post when we find a fix for the original problem.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 16
- Joined: Thu Nov 03, 2011 3:16 pm
Re: Use oxy_xpath with oxy_add?
Adding the if statements did the trick, I no longer get the error messages.
It is odd though, because the nodes that I am using must be present, as they are mandated by the DTD.
Thank you for the help!
It is odd though, because the nodes that I am using must be present, as they are mandated by the DTD.
Thank you for the help!
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Use oxy_xpath with oxy_add?
Hi,
The first time that the XPath expression gets executed by our internal code, not all the XML document has loaded and the XML is in an inconsistent state.
We fixed this and in Oxygen 13.2 (in January 2012) your first proposed selector will work as well.
Regards,
Radu
The first time that the XPath expression gets executed by our internal code, not all the XML document has loaded and the XML is in an inconsistent state.
We fixed this and in Oxygen 13.2 (in January 2012) your first proposed selector will work as well.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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