Splunk Dev

How to setup XML schema validation for UI assets using Komodo Edit?

Lowell
Super Champion

Splunk 4.1 ships with RelaxNG schemas for validating various UI assets which are XML. And Komodo Edit advertises support for multiple XML formats including the ability to setup add your own formats that are defined using RelaxNG. Since Komodo Edit is Splunk's recommended text editor, I think it's appropriate to ask this question here: Does anyone know how you go about getting Splunk XML formats to be better supported by Komodo?

I have a few views working differently in Splunk 4.1 than in 4.0, so I've been attempt to see if the included validate_all.py script tells me anything, but I'm struggling to understand what the messages it's returning. I don't know if I have mistakes in my custom xml files, or if the messages are due to an incomplete schema (since this is the first release to include the schema info, I suppose it possible they are not yet widely tested), or if there is some other change between 4.0 and 4.1 that I've overlooked.

In any case, I'm hoping that a smart text editor, like Komodo can help me out with editing XML views and nav files. I'm not sure if it will do validation automatically, but even getting better auto-completion will be a welcomed improvement.

Tags (3)
1 Solution

rroberts
Splunk Employee
Splunk Employee

I was able to validate my view xml against view.rng using xmllint. I saved this command in Komodo edit.

xmllint %F --noout --relaxng /Users/rroberts/splunk41/splunk/share/splunk/search_mrsparkle/exposed/schema/view.rng

I was missing an "m" on a module element and got...

/Users/rroberts/Desktop/flashtimeline.xml:7: element odule: Relax-NG validity error : Element view has extra content: odule /Users/rroberts/Desktop/flashtimeline.xml fails to validate

View solution in original post

rroberts
Splunk Employee
Splunk Employee

I was able to validate my view xml against view.rng using xmllint. I saved this command in Komodo edit.

xmllint %F --noout --relaxng /Users/rroberts/splunk41/splunk/share/splunk/search_mrsparkle/exposed/schema/view.rng

I was missing an "m" on a module element and got...

/Users/rroberts/Desktop/flashtimeline.xml:7: element odule: Relax-NG validity error : Element view has extra content: odule /Users/rroberts/Desktop/flashtimeline.xml fails to validate

Lowell
Super Champion

I was hoping for something more integrated than this. But this is fine starting point. Thanks.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...