Search

Is there any way currently to check our transformed XML against an XSD (XML Schema Definition)?

For instance, page outputs transformed XML, is passed through an XSD, error report, or other feedback supplied.

Maybe in the form of a developer extension, maybe a plugin for the debug view in the frontend?

Just putting it out there...

Transformed XML or just the raw generated page XML? "Transformed" to me means after the XSLT process.

It should be possible. You could write a new devkit (like ?debug, ?profile, ?logs etc) so that you could add ?validate and it'd check the XML against an XSD file.

How would you want to define an XSD? It'd need to be pretty vague given the flexibility of output that Symphony affords. The only givens are a root <data> element that contains children <params> and an optional <events> element.

It would be the page after I have transformed it to be in line with the XSD provided by a third party.

It would therefore be like the Result view of the debugger, only highlighting areas of the page that don't conform to an XSD provided in the backend prefs page.

It's not something I could do myself... ;0)

Ah I get you. That's a neat idea, and would definitely aid debugging when you know your XSLT has to produce tightly defined output. You could establish a convention so that you drop .xsd files into, say, /workspace/xsd, the devkit would list these files down the side. You could then click on one to validate the current output against it.

I don't know how verbose the validation is: does the processor return line-by-line validation messages, or a single boolean yes/no? My guess is it's a boolean yes/no, but includes an exception-like response with message, line number and code snippet.

the devkit would list these files down the side

Even better than my idea!

I haven't put much thought into it, but it looks quite easy with PHP. Just searched and found this.

I guess the validator would highlight code that doesn't validate, like the current xPath thingy* does, but red (or something), then have a popup on rollover containing the error message (if there is one). It looks like DOMDocument validation is boolean though.

*technical term

Alistair wrote this ages ago. I wonder if anyone has a long enough stick so we could poke the code out of him.

Or we could just look at the source button at the bottom of the page ;)

have you tried using some xml software like liquid xml editor, you should be able to get the software to validate your xsd, is that what you mean?

Yeah, I know I can validate XML this way, but it would be easier to do it in the Debug views so that it saves copying and pasting all the time.

And here it is: Schema Validation (devkit)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details