I'm trying to write a schema for XML-RPC
(http://www.xml-rpc.com/). This protocol has been specified a long
time ago, at the dawn of XML and is described only in natural
language. An attempt have been made to "reverse specify" it with DTD
or XSD
(http://www.cafeconleche.org/books/xmljava/chapters/ch02s05.html). I
try with RelaxNG.
My main concern is with the <fault>. A fault has two components,
faultCode and faultString. They are not elements but values with
constraints :-(
I try to:
stringval = element string {text}
integer = element i4 {xsd:int} | element int {xsd:int}
fault = element fault {faultvalue}
faultvalue = element value {faultstruct}
faultstruct = element struct {faultcode & faultstring}
faultcode = element member {element name {"faultCode"} &
element value {integer}}
faultstring = element member {element name {"faultString"} &
element value {stringval | text}}
But (after translation by trang) this is refused by xsltproc:
schema.rng:157: element interleave: Relax-NG parser error : Element or text
conflicts in interleave
I have to change the definition of faultstruct to:
faultstruct = element struct {faultcode, faultstring}
to keep it happy. But now, I force faultCode to appear before
faultString, which is not in the specification.
Now, I understand that my schema is non-deterministic but isn't it
allowed by RelaxNG?
I've re-read chapter 16 "Determinism" of the Pheasant but without
results. I note that examples in chapter 7 "Constraining text values"
never use the interleave pattern, which may be on purpose but is
apparently not explained.
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/2U_rlB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/rng-users/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/