Sharp SCHEMA technology: rule-based language

zhaozj2021-02-16  48

This article is a Tutorial record at the XML EUROPE 2002 meeting. Detailed explanation of various structures that define XML should be such a Schema language characteristics and use. I translated the article into three parts, this is the first part, telling how rule-based schema specifies XML.

1 Introduction

What is a xml schema language?

What is XML Schema language?

I will insist more on this point during my comparison of XML schema languages ​​on Wednesday morning, but one thing is sure: a XML schema language is probably not what you're expecting, and its main feature is not (or not always) to describe .

I will emphasize more things to compare more XML Schema languages ​​on Wednesday morning, but a thing is sure: an XML Schema language may not be what you expect, but its main characteristics are not (or not Always) describe a class of XML documents but as a filter or firewall to protect the program from a variety of synthetic XML documents.

All Over this Tutorial We Will Use The Following Example:

I will use this whole tutorial:

0836217462 being a dog is a ful-time job </ title> <author-ref id = "Charles-M.-SCHULZ" /> <character-ref id = "peppermint-patty" /> <character-ref id = "snoopy" /> <character-ref id = "schroeder" /> <character-ref ID = "Lucy" /> </ book> <book id = "_ 0805033106> <ISBN> 080503306 </ isbn> <title> peanuts every sunday </ title> <author-ref id =" Charles-M.-SCHULZ "/> <character-ref id =" sal "/> <character-ref id =" snoopy "/> <character-ref id =" linus "/> <character-ref id =" snoopy "/> < / book> <author id = "charles-m.-schulz"> <name> charles m. Schulz </ name> <nickname> Sparky </ nickname> <born> 1992-11-26 <born> <dead> 2000-02-12 </ dead> </ author> <character id = "peppermint-patty"> <name> Peppermint Patty </ name> <Since> 1966-08-22 </ Since> <Qualification> Bold, Brash And tomboyi SH </ Qualification> </ character> <character ID = "snoopy"> <name> snoopy </ name> <snince> 1950-10-04 </ since> <quaLification> Extroverted Beagle </ Qualification> </ character> <character id = "schroeder"></p> <p><Name> Schroeder </ Name> <Since> 1951-05-30 <Since> <Qualification> BROUGHT CLAAGHTCIAL MUSIC TO The peanuts strip </ quarative> </ character> <character> = "lucy"> <name> Lucy </ name> <Since> 1952-03-03 </ Since> <Qualification> Bossy, Crabby and selfish </ quarative> </ character> <character id = "sal"> <name> Sally Brown </ name > <Since> 1960-08-22 </ Since> <Qualification> Always Looks for the Easy Way Out </ Qualification> </ Character> <character id = "linus"> <name> Linus </ name> <snince> 1952-09-19 </ since> <qualification> the intellectual of the gang </ qualification> </ character> </ library> An application managing the library described by this document, or even a XSLT stylesheet designed to display it would probably BE VERY CONFUSED IF THE NAME OR Content of The Elements Are Not What The EXPECT AND A THE Main Feature OF A XML Schema Language IS To Provide a formal way to describe what is expected to protect the applications from these risks of errors.</p> <p>A program that manages the library described in this document, or even an XSLT style sheet is designed to display it. If the name or content of the element is not what it expects, it may be completely trapped. One of the main roles of XML Schema language is to provide a regular way to describe what is expected and protecting the programs from the risk of errors.</p> <p>2. Rules-based language (XSLT & Schematron)</p> <p>............ ..</p> <p>The most basic implementation of this firewall is to give a set of rules that need to come with some example documents.</p> <p>This is the approach followed by rule based XML schema languages ​​which main representative is Schematron. Before presenting Schematron itself, we will have a look on how XSLT may be used as a XML schema language since this is a good exercise to understand the basics of those Schema Languages. This is based on rule-based XML Schema languages, and the representatives are Schematron. Before introducing SCHEMATRON, we will first look at how XSLT is used as XML Schema language, as it is a good exercise for understanding basic knowledge of these Schema languages.</p> <p>XSLT is used as a rule-based XML Schema language schematron</p> <p>2.1. XSLT is used as a rule-based XML Schema language</p> <p>We can use "Classical" Programming Languages ​​to Write a Rule Based XML Schema Either General Purpose Using A XML API OR XML Specific Such As Xslt Or XQuery.</p> <p>We can use the "traditional" programming language to write rule-based XML Schema can also use XML APIs or special XMLs such as XSLT or XQuery.</p> <p>To Illustrate this Point, Let's Take The Following Very Simple Snippet OF Our Example:</p> <p>In order to clarify this point of view, let's take a look at this very simple code snippet in our example:</p> <p><? XML Version = "1.0"?> <library> <book id = _ 0836217462 "/> <book id =" _ 0805033106 "/> </ library></p> <p>Why so simple? Because we will see that even if it is true that we can use XSLT as a rule based XML schema language, this is quite verbose and I do not want spend all the time allocated to this tutorial to develop our schema!</p> <p>Why is so simple? Because even if Xslt can be used as a rule-based XML Schema language, it is also very long, I don't want to use all assigned to this tutorial to develop our schema!</p> <p>To write this schema, we have basically two options which are the same than we have when we configure a firewall: the closed one where all what is not allowed is forbidden and the open one where all what is not forbidden is allowed and we will implement Both Schemas.</p> <p>Write this Schema, I basically have two options to configure firewall: closed, all non-permitted are prohibited; and open, all non-disabled are allowed. We implement both SCHEMA. Open Xslt Schema Closed Xslt Schema</p> <p>THE FIRST Conclusion from this Simple Example Is That XML Applications TEND to Forbid Much More Than ALLOW: Closed Schemas Are Offen Easier To Write Than Open Schemas.</p> <p>The first inference from this simple example is that the XML program tends to ban more things allowed by them: Closed Schema is more easily written than open Schema.</p> <p>ON The Other Hand, It's Easier To Define User Friendly Error Messages In A Open Schema Since The Context In Which Sometting Is Forbidden Is Always Determined.</p> <p>On the other hand, it is easier to define user-friendly error messages in open Schema because the context of the prohibited thing is always determined.</p> <p>2.1.1. Open XSLT Schema</p> <p>TO Implement An Open Schema with xslt, We Well Start Defining a Default Template Which Will Accept Anything:</p> <p>In order to achieve open Schema with XSLT, we will start from the definition of a model that allows all things to do:</p> <p><XSL: Template Match = "* | @ * | text ()> <xsl: Apply-Templates SELECT =" * | @ * | text () "/> </ xsl: template></p> <p>WITH THIS SINGLE TEMPLATE, OUR "Schema" Wouldcept Any Well FORMED XML Document and Never Raise Any Error and We next To Add Templates To Define What's forbidden.</p> <p>With this simple template, our "Schema" will accept any combined XML documentation without throwing any errors and we need to add a template to define what is disabled.</p> <p>Like with the design of any XSLT transformation, we have the choice to implement the tests as conditions in the "match" attribute of templates or within the templates using if or choose statements. When we are using if or choose statements, we have also the CHOICE OF THE LOCATION WHERE WE WILL WILL DO The Test.</p> <p>As with any XSLT conversion, we can choose to implement this test as a "match" property in the template or use the IF or Choose statement in the template. When we use the IF or Choose statement, we can also decide where to make such a test.</p> <p>To Check That The Document Element IS "library", We can for instance: In order to check the document element is "library", I can do this:</p> <p>Tested in the template in the Match expression</p> <p>Now That We've Set Up Up Up The Background, We CAN Generalize It and a Pretty Much Complete "Schema" include the Identifiers Could Be:</p> <p>Now our table is set up, summarizes, a more complete "schema" including test identifier singleness may be:</p> <p>Full XSLT implementation open SCHEMA</p> <p>Note That We Have Left A Degree Of Opening and That Arbitrary Element and text nodes can be added to the book element.</p> <p>Note that we have left a certain degree of expansion opportunities, any element and text can be added to the BOOK element.</p> <p>2.1.1.1 Test in Match expression</p> <p>We can Write a Template To Allow Library As Document ELEMENT:</p> <p>We can write a template to allow librays as a document element:</p> <p><XSL: Template Match = "/ Library"> <XSL: Apply-Templates Select = "* | @ * | text ()" /> </ xsl: Template></p> <p>But We Also Need To ForbiD Other Document Elements:</p> <p>But we also need to ban other document elements:</p> <p><XSL: Template Match = "/ *"> <xsl: Message Terminate = "NO"> The document element should be "library". </ xsl: message> <xsl: Apply-Templates SELECT = "* | @ * | TEXT () "/> </ xsl: template></p> <p>OR, Alternatively, We can Rely on The Default Template and Replace Both Templates BY a Slightly More Complex Match Expression:</p> <p>Alternatively, we can rely on the default template and replace the two templates to a Match expression slightly complex template:</p> <p><XSL: Template Match = "/ * [NOT (Self :: Library)"> <XSL: Message Terminate = "no"> The document element should be "library". </ xsl: message> <xsl: Apply- Templates SELECT = "* | @ * | text ()" /> </ xsl: template></p> <p>2.1.1.2. Test in the template</p> <p>We can Also Perform The Test in A Template for the root of the document: We can also perform the root of the document in the template:</p> <p><XSL: Template Match = "/"> <xsl: if test = "not (library)> <xsl: message terminate =" no "> The document element shouth be" library ". </ xsl: message> </ XSL: IF> <xsl: Apply-Templates Select = "* | @ * | text ()" /> </ xsl: template></p> <p>Or do the Same Test in A Template for Document Element:</p> <p>Or perform the same test on the template element in the template:</p> <p><XSL: Template Match = "/ *"> <xsl: if test = "NOT (Self :: library)> <xsl: message terminate =" no "> The document element shouth be" library ". </ xsl: Message> </ xsl: if> <xsl: Apply-Templates SELECT = "* | @ * | text ()" /> </ xsl: template></p> <p>2.1.1.3. Open SCHEMA for complete XSLT implementation</p> <p><? XML Version = "1.0" encoding = "UTF-8"?> <xsl: stylesheet version = "1.0" xmlns: xsl = "http://www.w3.org/1999/xsl/transform"></p> <p><XSL: Template Match = "* | @ * | text ()> <xsl: Apply-Templates SELECT =" * | @ * | text () "/> </ xsl: template></p> <p><XSL: Template Match = "/ * [NOT (Self :: Library)"> <XSL: Message Terminate = "no"> <xsl: text> The Document Element Should Be "Library", Not "</ XSL: Text> <xsl: value-of select = "name ()" /> <xsl: text> "! </ xsl: text> </ xsl: message> <xsl: Apply-Templates SELECT =" * | @ * | TEXT () "/> </ xsl: template></p> <p><XSL: Template Match = "/ * / * [NOT (Self :: Book)"> <xsl: Message Terminate = "no"> <xsl: text> The children elements of library shop be "book", not " </ xsl: text> <xsl: value-of select = "name ()" /> <xsl: text>! </ xsl: text> </ xsl: message> <xsl: Apply-Templates SELECT = "* | @ * | text () "/> </ xsl: template> <xsl: template match =" library / @ * "> <xsl: message terminate =" no "> <xsl: text> The" library "Element SHOULD Have no attribute, </ xsl: text> <xsl: value-of select = "name ()" /> <xsl: text> Shouldn't Appear! </ xsl: text> </ xsl: message> <XSL: Apply-Templates SELECT = "* | @ * | text ()" /> </ xsl: Template></p> <p><XSL: Template Match = "library / text () [Normalize-space ()"> <xsl: message terminate = "no"> <xsl: text> The "library" element shop has no text, "</ xsl : Text> <xsl: value-of select = "normalize-space ()" /> <xsl: text> "Shouldn't Appear! </ xsl: text> </ xsl: message> <xsl: Apply-Templates SELECT = "* | @ * | text ()" /> </ xsl: Template></p> <p><XSL: Template Match = "BOOK / @ *"> <XSL: Message Terminate = "No"> <XSL: Text> The "Book" Element SHOULD HAVE NO Other Attribute Than "ID", </ xsl: Text> < XSL: value-of select = "name ()" /> <xsl: text> Shouldn't Appear! </ xsl: text> </ xsl: message> <xsl: Apply-Templates SELECT = "* | @ * | TEXT () "/> </ xsl: template></p> <p><XSL: Template Match = "BOOK / @ ID"> <xsl: if test = ". = ../ preceding-sibling :: book / @ id> <xsl: message terminate =" no "> <xsl: text > The "book" ID Should Be Unique, </ xsl: text> <xsl: value-of select = "/> <xsl: text> is duplicated. </ Xsl: text> </ xsl: message> < / xsl: if> <xsl: Apply-Templates Select = "* | @ * | text ()" /> </ xsl: template> </ xsl: stylesheet></p> <p>2.1.2. Closed XSLT Realization SCHEMA</p> <p>A Closed Schema Is The Other Way Round and Will Defaults Templates Which Are Forbidding Everything (Except Eventual "EMPTY" TEXT NODES):</p> <p>Closed Schema is anti-its way, defining a default template for all things (except for the final "empty" text):</p> <p><XSL: Template Match = "*"> <xsl: Message Terminate = "no"> <xsl: text> Forbidden Element: </ xsl: text> <xsl: value-of select = "name ()" /> < / XSL: Message> <xsl: Apply-Templates SELECT = "* | @ * | text ()" /> </ xsl: template></p> <p><XSL: Template Match = "@ *"> <xsl: Message Terminate = "no"> <xsl: text> Forbidden Attribute: </ xsl: text> <xsl: value-of select = "name ()" /> </ xsl: message> </ xsl: template></p> <p><XSL: Template Match = "Text ()" /></p> <p><XSL: Template Match = "Text () [Normalize-Space ()"> <xsl: Message Terminate = "no"> <xsl: text> forbidden text: </ xsl: text> <XSL: Value-of SELECT = "." /> </ xsl: message> </ xsl: template></p> <p>And the Define Everything Which IS Allowed, IE IN Fact Very Few Things:</p> <p>Then define all the allowable things, in fact, something: <xsl: template match = "/ library"> <xsl: Apply-Templates select = "* | @ * | text ()" /> </ xsl: Template></p> <p><XSL: Template Match = "Library / Book"> <XSL: Apply-Templates SELECT = "* | @ * | text ()" /> </ xsl: template></p> <p><XSL: Template Match = "BOOK / @ ID [not (. = .. / preceding-sibling :: book / @ id)]> <xsl: apply-templates select =" * | @ * | text () " /> </ XSL: Template></p> <p>2.2. Schematron</p> <p>Technically speaking, Schematron is a concise formalization of one of the examples which we have seen and generates a XSLT transformation which is an open schema (everything which has not been forbidden is allowed) with tests inside the templates.</p> <p>Technically, Schematron is a precise formulation in the examples we have seen, and generating an XSLT conversion, which is open in the template (all that are not prohibited are allowed) test.</p> <p>That Being said, xslt is totally hidden from the schema User who neseds to know the schematron syntax and xpath Which is buy to express the rules.</p> <p>That is, XSLT is completely hidden on Schematron's users. But they need to know the syntax of Schematron and XPath used to express these rules.</p> <p>A Schematron schema is composed of a set of patterns each pattern including one or more rules and each rule being composed of asserts and reports, however, to present the syntax used by Schematron, we'll take it "bottom / up" and start with Asserts and reports Before seeing how it is associated into rules, patterns and schemas.</p> <p>Schematron Schema consists of a set of Pattern. Each Pattern includes one or more rules, and each rule consists of Assert and Report. However, in order to show the syntax used by Schemarand, we will in turn, start from Assert and Report before how they are related to rules, pattern, and Schema.</p> <p>Assert (s) and Report (s) rule (s) pattern (s) Schema</p> <p>2.2.1. Assert (s) and report (s)</p> <p>The "Assert" and "Report" Elements Are WHERE The Rules Are Defined in A SchemaTron Schema. Both Carry A "TEST" Attribute Which is an XPath Expression The Differ In A Couple of Ways:</p> <p>"Assert" and "report" elements are places where rules are defined in Schematron Schema. Brought a "test" attribute of XPath expressions, they differ in several respects:</p> <p>They are the opposite one of each other: the test must be true to pass in an "assert" element and false to pass in a "report" element.The original purpose of assert is more for "fatal errors" and report more for things That Should Just Be "Reported", BUT this distinction is not Relevant ANY LONGER IN The Latest version (1.5).</p> <p>They are the opposite side of each other: Test must be true in the "Assert" element, and in the "Report" element must be false. The initial purpose of Assert is more for "fatal errors" and Report is more used in things that only need "notification", but this difference does not exist in the latest version (1.5).</p> <p>There Are Some Goodies Which We Will Not Cover In this Tutorial, But The Basic Syntax IS:</p> <p>There are many good things in this tutorial that you can't tell, but the basic syntax is like this:</p> <p><SCH: Assert Test = "Library"> The Document Element SHOULD BE 'LIBRARY'. </ SCH: Assert></p> <p>Which raises an error with the corresponding message if there is no "library" Element Under the context node, or:</p> <p>If there is no "library" element in the context node, it throws an error and corresponding information, or:</p> <p><SCH: Report Test = "@ *"> The Library Element SHOULD NOT Contain Attributes. </ SCH: Report></p> <p>Which raises an error if there is any attribute under the context node.</p> <p>If there is any property in the context node, it throws an error.</p> <p>In Both Cases, The Context Node Is Set by The "Rule" Parent Element of the Report or Assert Node.</p> <p>In both cases, the context node is set by the "rule" parent element of the Report or an ASSERT node. 2.2.2. Rule (s)</p> <p>Schematron Rule Elements Are Roughly Equivalent To Xslt Templates and Are Used To Define The Context Under Which A Set of Assert And Report Elements Will Be Performed.</p> <p>The Schematron Rule element is substantially and the XSLT template and is used to define the context that Assert and Report elements will apply.</p> <p>An Example of Rule (without Bells and whistles) Performing The Tests Done in Our Open Schema On The Book Element Could Be:</p> <p>An example of a rule that performs testing in our open schema (without all fancy things) may be:</p> <p><SCH: Rule Context = "Book"> <SCH: Report Test = "@ * [Name ()! = 'ID'> The Book Element SHOULD NOT INCLUDE ANY Attribute Other Than" ID ". </ SCH: Report > <SCH: Assert Test = "@ * [Namespace-Uri () = '']> The Book Element SHOULD NOT INCLUDE ATRIBUTE Other THAN" ID "(Namespace). </ SCH: Assert> <SCH: Report Test = "@ id = preceding-Sibling :: BOOK / @ ID"> The Book ID Should Be Unique. </ SCH: Report> </ SCH: Rule></p> <p>Some Notes About Rules:</p> <p>Some precautions for rules are:</p> <p>............... ..</p> <p>The context of the rule cannot be set to attribute. The order of the test (Report and Assert elements) is not guaranteed, and a series of tests terminate when the first error occurs. .</p> <p>2.2.3. Pattern (s)</p> <p>Pattern Elements Are Sets of Rules Which Are Evaluated Independntly (Technically Using Different Modes In The xslt styleheet generated out of the schema).</p> <p>The Pattern element is a batch of independent execution rules (technical speaking, which is guaranteed by different modes in the XSLT style sheet).</p> <p>An Example of Pattern Roughly Equivalent To Our Open Xslt Schema Could Be: A quite example with our open XSLT Schema may be like this:</p> <p><SCH: PATTERN> <SCH: Rule Context = "/"> <SCH: Assert Test = "Library"> The Document Element Should Be 'Library'. </ SCH: Assert> </ SCH: Rule> <SCH: Rule Context = "library"> <SCH: Report test = "* [not (self :: book)"> The library element shouth "> The library element sale" "" @ / SCH: report> <SCH: Report test = "@ *" > The library element sale not contact attributes. </ SCH: Report> <SCH: Report test = "text () [Normalize-space ()]> The library element shop not contact attributes. </ SCH: Report> </ SCH: Rule> <SCH: Rule CONTEXT = "BOOK"> <SCH: Report Test = "@ * [Name ()! = 'ID']> The Book Element SHOULD NOT INCLUDE ATTRIBUTE Other THAN" ID ". < / SCH: Report> <SCH: Assert Test = "@ * [Namespace-URI () = '' ']> The Book Element SHOULD NOT INCLUDE ANY Attribute Other Than" ID "(Namespace). </ SCH: Assert> < SCH: Report test = "@ id = preceding-sibling :: book / @ id"> The book id baby "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "</p> <p>One of the differences with what we had implemented is that Schematron will stop the evaluation of a pattern after the first error found (following the order of the source tree) and if we wanted to be potentially able to raise several errors, we would have to Spread Our Rules forin Several DiffERENT PATTERNS.</p> <p>One of the different things we have implemented is that SchemaTron will stop the execution of Pattern when the first error is found (according to the order of the source tree) and if you want to throw several errors, we need to put rules. Dispersed into several different Pattern. 2.2.4. Schema</p> <p>Finally, The Schema Element Is The Document Element of a Schema Title And One or More Patterns. TO IMPLEMENT Our Rules WITHIN SEPARATED PATTERNS, We Could Write:</p> <p>Finally, the Schema element is the documentation element of Schematron Schema and mainly includes a title and one or more pattern. To achieve our rule in several pattern, we can write this:</p> <p><? XML Version = "1.0" encoding = "UTF-8"?> <SCH: Schema Xmlns: SCH = "http://www.ascc.net/xml/schematron"> <SCH: Title> Example Schematron Schema < / SCH: TITLE> <SCH: Pattern> <SCH: Rule Context = "/"> <SCH: Assert Test = "Library"> The document element shouth be 'library'. </ SCH: Assert> </ SCH: Rule > </ SCH: PATTERN> <SCH: Pattern> <SCH: Rule CONTEXT = "library"> <SCH: Report Test = "> The library elements."> The library element shop "> The library element shel </ SCH: Report> <SCH: Report Test = "@ *"> The library element shop not contact attributes. </ SCH: Report> <SCH: Report test = "text () [Normalize-Space ()]"> The library element sale not contact attributes. </ SCH: REPORT> </ SCH: Rule> </ SCH: Pattern> <SCH: Pattern> <SCH: Rule Context = "BOOK"> <SCH: Report Test = "@ * [name ()! = 'ID']> The Book Element Should Not Include Any Attribute Other Than "ID". </ SCH: Report> <SCH: Assert Test = "@ * [Namespace-Uri () = '' ]> The Book Element SHOULD NOT INCLUDE ANY Attribute Other Than "ID" (Namespace). </ SCH: Assert> <SCH: Report Test = "@ id = preceding-Sibling :: Book / @ ID"> The book id kind be unique. </ SCH: Report> < / SCH: Rule> </ SCH: Pattern> </ SCH: Schema> 2.2.5.</p> <p>Solving the same problem with Schematron and XSLT shows the nature of Schematron which is a subset of XSLT tailored to XML validation through open rule based schemas. Solve the same problem with XSLT and Schematron Schematron reveal the nature of that it is tailored for XML Implementation of the XSLT subset of SCHEMA based on open rules.</p> <p>Why do i insist this much on the openness of schematron schema?</p> <p>Why I emphasize the openness of Schematron Schema?</p> <p>Because The Default Behavior of Schematron Is To Be Open, But It Is Still Possible To Write Closed (Or Semi Closed Schemas) with Schematron Even Though It Isn't A CommON Practice.</p> <p>Because Schematron's default behavior is open, it is also possible to write closed (or semi-closed) SCHEMA with SchemaRon, although this is not a common behavior.</p> <p>The main trick when doing so is to note that the rules within a Schematron pattern are evaluated in lexical order instead of following the rules of priorities as defined by XSLT. The default rules which will forbid content not described in any rule need therefore to be located After All The Other Rules, Such As:</p> <p>The main skill to do that is to remember that the rules in schema pattern are determined in the order of words rather than by the priority defined by the XSLT. By default, there is no rules that have not been described in any rules, so it is necessary to put it in all other rules, like this:</p> <p><? XML Version = "1.0" encoding = "UTF-8"?> <SCH: Schema Xmlns: SCH = "http://www.ascc.net/xml/schematron"> <SCH: Title> Example Schematron Schema < / SCH: TITLE> <SCH: Pattern> <SCH: Rule Context = "/ library"> <SCH: Report test = "@ *"> The library element sales not contact attributes. </ SCH: Report> </ SCH: Rule> <SCH: Rule Context = "Library / Book"> <SCH: Report Test = "@ * [Name ()! = 'ID']> The Book Element SHOULD NOT INCLUDE ATTRIBUTE Other THAN" ID ". < / SCH: Report> <SCH: Assert Test = "@ * [Namespace-URI () = '' ']> The Book Element SHOULD NOT INCLUDE ANY Attribute Other Than" ID "(Namespace). </ SCH: Assert> < SCH: Report test = "@ id = preceding-sibling :: book / @ id"> The book id baby "> @ / SCH: Report> </ SCH: Rule> <SCH: Rule CONTEXT =" * "> < SCH: Report test = "1"> "<SCH: Name />" Forbidden Under "<SCH: Name Path =" .. "/>". </ SCH: Report> </ SCH: Rule> <SCH: Rule context = "text () [Normalize-space ()"> <SCH: Report test = "1"> text forbidden in "<SCH: Name PATH = "." /> Element. </ SCH: Report> </ SCH: Rule> </ SCH: Pattern> </ SCH: Schema> Name Also the usage of the "name" Element and the Fact That Rules CAN't Be defined for attributes.</p> <p>Also note the use of "name" elements and cannot define rules to attribute.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-26591.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="26591" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.043</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'Vp7LCzYC8gDvzW26hyZD2VPr0JZLcrxCiQ3_2B33oPJrCneARzJKlysLS0TUf8_2Fxit4_2BPx2WQiHDHiKOEcy_2B6DDQ_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>