javascript wrapping after value-of on format
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 1
- Joined: Mon Nov 02, 2020 7:36 pm
javascript wrapping after value-of on format
When formatting this code in XML Editor 22.1:
<script>
var serverName = '<xsl:value-of select="/data/serverName"/>';
</script>
the single quote and semicolon wrap resulting in broken javascript:
<script>
var serverName = '<xsl:value-of select="/data/serverName"/>
';
</script>
How can the wrapping after the value-of be prevented?
<script>
var serverName = '<xsl:value-of select="/data/serverName"/>';
</script>
the single quote and semicolon wrap resulting in broken javascript:
<script>
var serverName = '<xsl:value-of select="/data/serverName"/>
';
</script>
How can the wrapping after the value-of be prevented?
-
- Posts: 390
- Joined: Thu Jul 01, 2004 12:29 pm
Re: javascript wrapping after value-of on format
Hello,
Thanks for your feedback.
I think your document is an XHTML (has the namespace "http://www.w3.org/1999/xhtml" set on root ), or it is an HTML document opened in the XHTML editor.
You can verify the content type of the opened document in the Properties view (Help menu->Show View->Properties). If the content type value is "application/xhtml+xml", it means that is an XHTML document, if is "text/html" it means that is an HTML document.
In case you have an XHTML document ( the namespace "http://www.w3.org/1999/xhtml" is set on root), you need to add the script content in a CDATA. Something like this:
If you document does not have the XHTML namespace set on root, probably you opened the file with the XHTML editor. You can close the file and use the Open With->Internal Editor action from the Project view contextual menu. Then select HTML editor from the list in order to be opened as an HTML.
Best Regards,
Octavian
Thanks for your feedback.
I think your document is an XHTML (has the namespace "http://www.w3.org/1999/xhtml" set on root ), or it is an HTML document opened in the XHTML editor.
You can verify the content type of the opened document in the Properties view (Help menu->Show View->Properties). If the content type value is "application/xhtml+xml", it means that is an XHTML document, if is "text/html" it means that is an HTML document.
In case you have an XHTML document ( the namespace "http://www.w3.org/1999/xhtml" is set on root), you need to add the script content in a CDATA. Something like this:
Code: Select all
<script>
//<![CDATA[
var serverName = '<xsl:value-of select="/data/serverName"/>';
//]]>
</script>
Best Regards,
Octavian
Octavian Nadolu
<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