[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
ANN: The Simple, Powerful Schema Language (SPSL)
- From: "Costello, Roger L." <costello@mitre.org>
- To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
- Date: Wed, 19 Dec 2012 12:52:15 +0000
Hi Folks,
I am pleased to announce a new schema language called:
The Simple, Powerful Schema Language (SPSL)
SPSL is very easy to learn. It takes less than one minute to learn the entire language.
SPSL is very powerful. With it you can express any business rule that you could possibly imagine.
An SPSL Validator is used to validate XML instance documents against an SPSL schema.
SPSL Validators are free and customizable.
Below I give you the code for the SPSL Validator -- the code is just a handful of lines long.
The SPSL Validator builds on top of existing standard technologies so it has a strong foundation. As the foundation evolves to more power, so does the SPSL Validator.
By using the SPSL language and the SPSL Validator you can save a lot of time and money.
Here is the SPSL language and the SPSL Validator:
---------------------------------------------------------
The Simple, Powerful Schema Language (SPSL)
---------------------------------------------------------
The root element is <Schema>
The content of <Schema> is one or more <Assert> elements.
The content of each <Assert> element is a boolean XPath expression.
<Schema>
<Assert>... XPath ...</Assert>
<Assert>... XPath ...</Assert>
<Assert>... XPath ...</Assert>
...
</Schema>
An XML instance document is valid if each XPath expression evaluates to true.
--------------------------------------------------------------------
The Simple, Powerful Schema Language (SPSL) Validator
--------------------------------------------------------------------
The SPSL Validator is implemented in XSLT/XPath -- it leverages existing technologies.
XML instance documents are validated against an SPSL schema using the <xsl:evaluate> element in XSLT 3.0
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="3.0">
<xsl:variable name="schema" select="doc('schema.xml')" />
<xsl:template match="Schema">
<xsl:evaluate xpath="string-join($schema//Assert,',')" as="xs:boolean*"/>
</xsl:template>
</xsl:stylesheet>
/Roger
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]