jquery script in footer
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 4
- Joined: Thu Dec 08, 2011 2:39 am
jquery script in footer
Hi,
Using Oxygen 12 or 13, I'm trying to have my DITA > XHTML transform include some JQuery javascript code. I thought the simplest way would be to use the args.ftr (or hdr) to inject the code. It has to be well-formed, so I've tried various permutations of CDATA tags. Surprisingly, the CDATA tags are written as-is to the XHTML, which obviously isn't what I want, and seems very odd.
I've tried things like:
I thought the contents of the CDATA tags would be written to the output, which it is, but includes the CDATA tags themselves! Preceding the CDATA tags with // seems to make no difference.
Any ideas? I suspect the problem is staring me in the face...
Thanks!
Pete
Using Oxygen 12 or 13, I'm trying to have my DITA > XHTML transform include some JQuery javascript code. I thought the simplest way would be to use the args.ftr (or hdr) to inject the code. It has to be well-formed, so I've tried various permutations of CDATA tags. Surprisingly, the CDATA tags are written as-is to the XHTML, which obviously isn't what I want, and seems very odd.
I've tried things like:
Code: Select all
<script language="JavaScript">
<![CDATA[
$(document).ready(function(){
... some jquery code ...
});
]]>
</script>
Any ideas? I suspect the problem is staring me in the face...
Thanks!
Pete
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: jquery script in footer
Hi Pete,
Oxygen uses the DITA Open Toolkit to publish DITA content to various output sources.
I do not quite understand the problem.
So from what I've tested if I set the parameter args.hdr to a small file containing your sample code (with CDATA tags) and transform, the final HTML output will contain the <script> but without the CDATA markers. I tested this with both an Oxygen 13.1 and 12.2.
From your post I understand exactly the opposite.
Did you add any customizations to the DITA OT or are you using a custom DITA OT installation?
The XSLT code which is responsible for adding the header and footer files to the XHTML output is in this file:
OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/xsl/xslhtml/dita2htmlImpl.xsl
Regards,
Radu
Oxygen uses the DITA Open Toolkit to publish DITA content to various output sources.
I do not quite understand the problem.
So from what I've tested if I set the parameter args.hdr to a small file containing your sample code (with CDATA tags) and transform, the final HTML output will contain the <script> but without the CDATA markers. I tested this with both an Oxygen 13.1 and 12.2.
From your post I understand exactly the opposite.
Did you add any customizations to the DITA OT or are you using a custom DITA OT installation?
The XSLT code which is responsible for adding the header and footer files to the XHTML output is in this file:
OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/xsl/xslhtml/dita2htmlImpl.xsl
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 4
- Joined: Thu Dec 08, 2011 2:39 am
Re: jquery script in footer
Thanks Radu,
My problem turned out to be due to some peculiar needs we have in our footer code. I ended up using a combination of several CDATA chunks, plus a DIV to wrap multiple script tags. Works fine now.
Cheers!
Pete
My problem turned out to be due to some peculiar needs we have in our footer code. I ended up using a combination of several CDATA chunks, plus a DIV to wrap multiple script tags. Works fine now.
Cheers!
Pete
Return to “DITA (Editing and Publishing DITA Content)”
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