All Projects → pgfearo → xmlspectrum

pgfearo / xmlspectrum

Licence: other
XSLT 2.0 coded syntax highlighter for XSLT 3.0, XPath 3.0...

Programming Languages

HTML
75241 projects
XQuery
69 projects
XSLT
1337 projects
java
68154 projects - #9 most used programming language
CSS
56736 projects
XProc
15 projects

Projects that are alternatives of or similar to xmlspectrum

TheVimIDE
Modern Vim IDE with support for C/C++, Java, Python, Lua, PHP, JavaScript, Ruby and much more ...
Stars: ✭ 33 (-28.26%)
Mutual labels:  syntax-highlighting
KV4Jetbrains
Syntax highlighting and auto-completion for Kivy/KivyMD .kv files in PyCharm/Intellij IDEA
Stars: ✭ 93 (+102.17%)
Mutual labels:  syntax-highlighting
code editor
A code editor (dart, js, html, ...) for Flutter with syntax highlighting and custom theme.
Stars: ✭ 48 (+4.35%)
Mutual labels:  syntax-highlighting
highlightjs-badge
Addon component to highlightjs that lets you copy code snippets to the clipboard and displays the active syntax
Stars: ✭ 44 (-4.35%)
Mutual labels:  syntax-highlighting
sublime-coconut
Coconut syntax highlighting for Sublime Text and VSCode.
Stars: ✭ 18 (-60.87%)
Mutual labels:  syntax-highlighting
robotframework-vim
Some vim scripts for use with the Robot framework.
Stars: ✭ 89 (+93.48%)
Mutual labels:  syntax-highlighting
language-rainmeter
Syntax highlighting for Rainmeter files in Atom.
Stars: ✭ 19 (-58.7%)
Mutual labels:  syntax-highlighting
Assembly-Syntax-Definition
This is the greatest syntax definition of All Time
Stars: ✭ 23 (-50%)
Mutual labels:  syntax-highlighting
elm-syntax-highlighting
Syntax Highlighting for Elm in Sublime Text
Stars: ✭ 27 (-41.3%)
Mutual labels:  syntax-highlighting
sb-dynlex
Configurable lexer for PHP featuring a fluid API.
Stars: ✭ 27 (-41.3%)
Mutual labels:  syntax-highlighting
winprint
winprint 2.0 - Advanced source code and text file printing. The perfect tool for printing source code, web pages, reports generated by legacy systems, documentation, or any text or HTML file. It works interactively or from the command line making it great for single users or whole enterprises. Works great with Powershell.
Stars: ✭ 52 (+13.04%)
Mutual labels:  syntax-highlighting
vim-ember-hbs
Ember Handlebars/HTMLBars plugin for Vim with indentation support
Stars: ✭ 45 (-2.17%)
Mutual labels:  syntax-highlighting
vscode-LaTeX-support
LaTeX language support for Visual Studio Code
Stars: ✭ 17 (-63.04%)
Mutual labels:  syntax-highlighting
vim-syntax-yara
A Vim syntax-highlighting file for YARA rules
Stars: ✭ 26 (-43.48%)
Mutual labels:  syntax-highlighting
vscode-liquid
💧Liquid language support for VS Code
Stars: ✭ 137 (+197.83%)
Mutual labels:  syntax-highlighting
new-moon-chrome-devtools
New Moon Theme for Chrome Devtools.
Stars: ✭ 57 (+23.91%)
Mutual labels:  syntax-highlighting
rehype-highlight
plugin to highlight code blocks
Stars: ✭ 127 (+176.09%)
Mutual labels:  syntax-highlighting
lslforge
LSLForge - Eclipse plugin to assist with LSL scripting for Second Life. This repository is used for development, pull requests and bug reports.
Stars: ✭ 17 (-63.04%)
Mutual labels:  syntax-highlighting
geshi-1.1
Next generation of Generic Syntax Highlighter for PHP
Stars: ✭ 70 (+52.17%)
Mutual labels:  syntax-highlighting
sora-editor
A cool code editor library on Android with syntax-highlighting and auto-completion. (aka CodeEditor)
Stars: ✭ 580 (+1160.87%)
Mutual labels:  syntax-highlighting

XMLSpectrum

Syntax-highlighter for XQuery 3.0 , XSLT 3.0 and XPath 3.0 and XML

Why

  1. Many generic syntax-highlighters can't render XQuery or XPath 2.0/3.0 reliably, whether it is standalone or embedded in XML, such as XSLT, XSD, XProc, Schematron etc.

  2. The 'pretty-print' options of many XML editors can not align XML attributes and their contents properly. This omission is especially critical for the readability of XPath 2.0/3.0.

XMLSpectrum aims to remedy these problems.

What XMLSpectrum comprises a principal XSLT 2.0 stylesheet and supporting stylesheets designed specially to convert XQuery or XPath and any host XML code (such as XSLT) to HTML with syntax highlighting. There's also a simple GUI application XMLSpectrum-FX to provide a convenient front-end for the XSLT (designed for blogging editors).

Main Roles

  • Syntax highlighter
  • Code formatter
  • Code hyper-linker

Built-in language support

  • XQuery 1.0 - 3.0
  • XPath 1.0 - 3.0
  • XSLT 1.0 - 3.0
  • XSD 1.1
  • XProc
  • Schematron

Sample output for XSLT code:

Screenshot

Sample output for XQuery code:

Screenshot

Emphasis on accurate rendering of XQuery and XPath expressions, either within XSLT/XSD or standalone. By default, all formatting is preserved exactly as-is - with trim and formatting options

##Features

Syntax Highlighting:

  • Processes plain-text or XML-text (complete or otherwise)

  • Optionally processes xsl:include and xsl:import referenced XSLT

  • Uses standard XSLT 2.0 - no extensions required (tested on Saxon-HE)

  • Complete with 6 color themes including: Solarized light/dark, Tomorrow Night or Roboticket color themes - or define your own

  • Generates CSS file if required - or embeds CSS styling within content

  • Option to use the new Adobe Source Code Pro font

  • Extensible for any XML format containing embedded XPath

  • XQuery XPath Highlighting:

    • State machine for context-aware processing
    • All whitespace formatting preserved
    • Supports latest XPath/XQuery 3.0 additions
  • XML Highlighting

    • Supports fragments or complete XML - Target namespace prefix can be inferred from 1st element
    • Built-in XML parser (coded in XSLT) keeps all text, as-is
    • CDATA preserved intact and highlighted
    • Language identification (from namespace - if present) - CSS styled element/ancestor highlighting - on mouse hover
  • XSLT Highlighting

    • Scheme colors help separate instructions from expressions - Literal Result Elements have different coloring
    • XPath colored for AVTs or native XPath attributes
    • All formatting preserved
  • Other 'Host Language' Highlighting (built-in)

    • XSD 1.1
    • Schematron
    • XProc 1.0
    • Generic XML

Formatting:

  • Formatting including whitespace between attributes and within attribute contents preserved by default
  • XML content is shown exactly as in the source - including intact entity references and CDATA sections etc.

Formatting options - for use when original formatting requires correction

  • [Option] Indent
    • Indents XML proportional to the nesting level (Same as standard formatters)
    • Smart attribute formatting (advanced feature)
      • Aligned vertically with indentation consistent with the host element
      • Multi-line content vertically aligned with pre-existing indentation preserved
  • [Option] Auto-Trim
    • Smart trim of pre-existing indentation (normally combined with the indent option) - Records and re-establishes indentation for the following:
      • text nodes
      • xpath comments
      • xml comments
      • xpath expressions
  • [Option] Force-Newline
    • Inserts line-feeds to format XML elements - Preserves content of elements found with mixed-content

Cross-referencing:

Recursively processes all XSLT modules from a top-level stylesheet in a multi-file project

  • Creates top-level 'map' to all modules
    • Global members listed for each module
    • Map entries hyperlinked to the code definitions
    • Module entries hyperlinked to syntax-highlighted file
    • Global members sorted alphabetically by name
  • Adds hyperlinks in code for:
    • xsl:include and xsl:import hrefs
    • Global Parameters
    • Global Variables
    • Standard Functions
    • User-defined Functions
    • Named Templates
  • Clark-notation based linking to ensure integrity of links

##XMLSpectrum in use

###Command Line

Sample bash and doc scripts are included as a convenience in the app/shell-cmd directory. These scripts invoke the Saxon XSLT processor with the highlight-file.xsl stylesheet and perform basic file path resolving and checking on the input file (supplied as the first argument when calling the script) for the current directory - not the script or directory.

script description
xmlspec HTML syntax highlighting of XSLT/XML or XQuery
xslprint HTML syntax highlighting and TOC for multi-module XSLT project
xslformat reformatting of source for XSLT/XML - output is formatted XML

Examples:

1. xslformat.sh nolines.xml force-newline=yes
2. xmlspec.sh nolines.xml force-newline=yes color-theme=pg-light indent=2

###GUI

XMLSpectrum-FX - A simple Java app included in this repository (latest build at gui-project/xmlspectrum-fx-dist.zip). This provides a front-end useful for showcasing the XSLT, clipboard and drag and drop functionality make it useful in its own right for highlighting code snippets for blogging etc. Tested by pasting clipboard contents into WordPress and Blogger HTML text editors - (Blogger requires a surround div element with an overflow:auto style attribute.)

Screenshot

###Sample Output from XMLSpectrum transforms

demo output of Docbook XSLT 2.0 Project

demo output of DITA XSLT Project

XMLSpectrum Project - run on itself

Transformed web page with embedded code samples

W3C XQuery 3.0 Specification Samples

Syntax-highlighted XProc file

Included XSLT solutions

The xmlspectrum.xsl and xq-spectrum.xsl stylesheets are intended for use by other stylesheets that import these and exploit the main functions: render, show-xquery and indent:

  • highlight-inline.xsl - transforms XHTML file containing descriptive text and XSLT, XSD or XPath code examples
  • highlight-file.xsl - transforms files containing XSLT,XSD or XPath - can process multi-file XSLT projects

Solarized Dark theme:

Screenshot

Tomorrow-Night theme + Source Code Pro font:

Screenshot

##Usage

For usage instructions, see xmlspectrum/app/xsl/readme

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].