I am trying to create an XML schema that is following the XML file like
& lt; Let's blame & gt; & Lt; Attribute name = "article_artextref" & gt; 123213213 & lt; / Attribute & gt; & Lt; Attribute name = "provider id" & gt; ABC & lt; / Attribute & gt; & Lt; / Attributes & gt; What I am trying to achieve is checking that there is a feature called "article_artextref" and make sure its value is greater than 1. I do not want to validate the length of property name "provider id" and provider id length may be 0. Please help.
I am adding the XML schema which so far checks the length of the two elements.
& lt; Xs: schema xmlns: xs = "http://www.w3.org/2001/XMLSchema" & gt; & Lt; X: simple type name = "ST_attribute" & gt; & Lt; Xs: restriction base = "xs: string" & gt; & Lt; Xs: minlong value = "1" /> & Lt; / XS: Ban & gt; & Lt; / XS: simpleType & gt; & Lt; Xs: element name = "attributes" & gt; & Lt; XS: complexType & gt; & Lt; XS: Sequence & gt; & Lt; Xs: element riff = "attribute" maxOccurs = "unbounded" /> & Lt; / XS: sequence & gt; & Lt; / XS: complexType & gt; & Lt; / XS: element & gt; & Lt; Xs: element name = "attribute" & gt; & Lt; XS: complexType & gt; & Lt; XS: simpleContent & gt; & Lt; Xs: extension base = "ST_attribute" & gt; & Lt; Xs: attribute name = "name" = "required" & gt; & Lt; XS: simpleType & gt; & Lt; Xs: restriction base = "xs: string" & gt; & Lt; Xs: calculation value = "provider id" /> & Lt; Xs: calculation value = "article_arthief" /> & Lt; / XS: Ban & gt; & Lt; / XS: simpleType & gt; & Lt; / XS: Attributes & gt; & Lt; / XS: Expansion & gt; & Lt; / XS: simpleContent & gt; & Lt; / XS: complexType & gt; & Lt; / XS: element & gt; & Lt; / XS: Schema & gt; Sorry, but XML Schema can not handle anything like this.
Comments
Post a Comment