relaxng

Define an element as non-empty in RelaxNG

瘦欲@ 提交于 2019-12-05 05:23:11
问题 I've started using RelaxNG to specify XML message schemas, and using PHP DOMDocument to validate and parse incoming messages, but can't figure out how to define a text node so that it cannot be empty. Example schema: <?xml version="1.0"?> <element name="amhAPI" xmlns="http://relaxng.org/ns/structure/1.0"> <element name="auth"> <element name="validateUser"> <element name="username"> <text/> </element> <element name="password"> <text/> </element> </element> </element> </element> However, the

XML Schema Validation with RelaxNG

爷,独闯天下 提交于 2019-12-04 09:05:00
问题 Which XML validation tools can you recommend for both performance and accuracy, each of which is a critical issue on our system? We have the following requirements: It is not xmllint (see below) Supports RelaxNG Can easily integrate with Perl (this is optional, but it would be nice) Why not xmllint? (This is background and you can skip it if you like) We have a large Perl system which uses RelaxNG to validate our XML. We use the compact RelaxNG format and trang to convert it to the standard

Validating xml against relax ng in ANSI C

可紊 提交于 2019-12-04 07:03:32
Is it possible to validate an xml file against a Relax NG schema in ANSI C? I have come across this library called libxml2 but all help I could get from it is with respect to how to parse an xml file. Please help. And if it can be done, what are the steps? Utterly ignorant about this w.r.t. the C environment. Here is a minimalistic example (you should of course add your own error checking): #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <libxml/xmlmemory.h> #include <libxml/parser.h> #include <libxml/relaxng.h> int main(int argc, char *argv[]) { int status; xmlDoc *doc;

Schema-sensitive editing in emacs, based on W3C XML Schema? (not RNG)

心不动则不痛 提交于 2019-12-03 12:49:43
问题 I just learned, here, about nxml-mode, which, according to the README, is a major mode for GNU Emacs for editing XML documents. It supports editing well-formed XML documents and also provides schema-sensitive editing of XML documents using RELAX NG Compact Syntax. Is there a mode that does the same for W3C XML Schema? If I cannot find such a thing, then is nxml-mode useful to me anyway, assuming I deal strictly with W3C XML Schema and not with Relax-NG? Related: Schema-aware editing in VIM

Schema-sensitive editing in emacs, based on W3C XML Schema? (not RNG)

你。 提交于 2019-12-03 03:08:47
I just learned, here , about nxml-mode , which, according to the README, is a major mode for GNU Emacs for editing XML documents. It supports editing well-formed XML documents and also provides schema-sensitive editing of XML documents using RELAX NG Compact Syntax. Is there a mode that does the same for W3C XML Schema? If I cannot find such a thing, then is nxml-mode useful to me anyway, assuming I deal strictly with W3C XML Schema and not with Relax-NG? Related: Schema-aware editing in VIM Just use XSD to RNG converter, like this I tried this with a fairly simplistic XSD schema - one that

XML Schema Validation with RelaxNG

ⅰ亾dé卋堺 提交于 2019-12-03 01:51:08
Which XML validation tools can you recommend for both performance and accuracy, each of which is a critical issue on our system? We have the following requirements: It is not xmllint (see below) Supports RelaxNG Can easily integrate with Perl (this is optional, but it would be nice) Why not xmllint? (This is background and you can skip it if you like) We have a large Perl system which uses RelaxNG to validate our XML. We use the compact RelaxNG format and trang to convert it to the standard RelaxNG format. Then we do the actual validation via xmllint . That's when the problems kick in. xmllint

command line validator supporting relax ng Schemas with embedded iso Schematron

∥☆過路亽.° 提交于 2019-12-02 02:57:12
Are there any command line-validators that can cope with relax ng-Schemas with embedded iso schematron? I've got a couple of relax ng-schemas with embedded iso-schematron rules which I have to be able to validate on the command line. As it seems, jing, our usual validator, only works with schematron 1.5. Surfing the web, I haven't been able to find any validator supporting embedded iso schematron but I use oXygen as an xml editor and I can validate just fine from there. Rintze Zelle You can use Jing, as long as you first extract the Schematron rules, and then run a separate validation against

Interleave In RNC

有些话、适合烂在心里 提交于 2019-12-01 14:17:45
I have source with three p with different attribute values, I tried to make arbitrary order of elements along with one mandatory element p class='paragraph1'. That is any number of paragraph1, paragraph2 and pharagraph3 in any order but there must be at least one paragraph1. Below I tried the interleave option in RNC, but I failed with an error "the element "p" can occur in more than one operand of "interleave"" This is because the same element declared more than one time. But is this possible in RelaxNG using any other method? Source <body> <h1 class="title">title</h1> <h2 class="subtitle"

Validating XHTML5 in PHP?

三世轮回 提交于 2019-12-01 09:35:52
问题 Background I have made the decision to serve my website as application/xhtml+xml to anyone who will accept it. I understand that there are consequences, which consequences I'm willing to accept. Problem I'm trying to validate XHTML5 in PHP. That way, I can serve the file as text/html if validation fails (hey, ain't nobody perfect). My question has merit even when taken outside of my situation, though. So how what are my options to validate XHTML5? What I've done: I'm already using PHP's

How do I validate XML document using compact RELAX NG schema in Python?

扶醉桌前 提交于 2019-12-01 04:16:58
How do I validate XML document via compact RELAX NG schema in Python? How about using lxml ? From the docs: >>> f = StringIO('''\ ... <element name="a" xmlns="http://relaxng.org/ns/structure/1.0"> ... <zeroOrMore> ... <element name="b"> ... <text /> ... </element> ... </zeroOrMore> ... </element> ... ''') >>> relaxng_doc = etree.parse(f) >>> relaxng = etree.RelaxNG(relaxng_doc) >>> valid = StringIO('<a><b></b></a>') >>> doc = etree.parse(valid) >>> relaxng.validate(doc) True >>> invalid = StringIO('<a><c></c></a>') >>> doc2 = etree.parse(invalid) >>> relaxng.validate(doc2) False If you want to