CAM provides various ways to look for explicit values - restrictValues, lookup, setStringMask and printMessage.
The setStringMask will trim content. The printMessage however does explicit content comparison using XPath expression.
Here is an example XML instance:
<Root xmlns:xs="[url]http://www.w3.org/2001/XMLSchema[/url]" xmlns:camed="[url]http://jcam.org.uk/editor[/url]" xmlns:as="[url]http://www.oasis-open.org/committees/cam[/url]"> <Node> <Value1> ABC</Value1> <Value2>1</Value2> </Node> <Node> <Value1> ABC</Value1> <Value2>1</Value2> </Node> <Node> <Value1> ABC</Value1> <Value2>1</Value2> </Node> </Root>
and then here is the template that will check this content:
<?xml version="1.0"?> <as:CAM CAMlevel="1" version="1.1" xmlns:as="[url]http://www.oasis-open.org/committees/cam[/url]" > <as:Header> <as:Description>No Description</as:Description> <as:Owner>Not Set</as:Owner> <as:Version>0.1</as:Version> <as:DateTime>2011-01-14T17:40:23</as:DateTime> </as:Header> <as:AssemblyStructure> <as:Structure ID="NewFile" taxonomy="XML" reference=""> <Root> <Node> <Value1>% ABC%</Value1> <Value2>%1%</Value2> </Node> </Root> </as:Structure> </as:AssemblyStructure> <as:BusinessUseContext> <as:Rules> <as:default> <as:context> <as:constraint condition=" . = ' ABC' " action="printMessage(//Node/Value1,Invalid content)"/> <as:constraint action="makeRepeatable(/Root/Node)"/> </as:context> </as:default> </as:Rules> </as:BusinessUseContext></as:CAM>
Log in to post a comment.
CAM provides various ways to look for explicit values - restrictValues,
lookup, setStringMask and printMessage.
The setStringMask will trim content. The printMessage however does explicit
content comparison using XPath expression.
Here is an example XML instance:
and then here is the template that will check this content: