Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

schema issue

Question posted by: TOUDIdel (Guest) on June 27th, 2008 07:07 PM
I define element wihout certaint type declaration (there aren't type
attribute, complex or simple type child):

e.g.
...
<xs:element name="invoice"/>
...

MSXML doesn't report any errors when that element contains some text
content.

I believe to MSXML but I cant find in specification why is it possible and
correct?

--
td


TOUDIdel's Avatar
TOUDIdel
Guest
n/a Posts
June 27th, 2008
07:07 PM
#2

Re: schema issue

Użytkownik "TOUDIdel" <toudidel@oDWA.plnapisał w wiadomości
news:%230ccn$5tIHA.4560@TK2MSFTNGP03.phx.gbl...
Quote:
>I define element wihout certaint type declaration (there aren't type
>attribute, complex or simple type child):
e.g.
<xs:element name="invoice"/>
MSXML doesn't report any errors when that element contains some text
content.
I believe to MSXML but I cant find in specification why is it possible and
correct?



http://www.w3.org/TR/xmlschema-1/#declare-element

"An <elementwith no referenced or included type definition will correspond
to an element declaration which has the same type definition as the head of
its substitution group if it identifies one, otherwise the .ur-type
definition.. This has the important consequence that the minimum valid
element declaration, that is, one with only a name attribute and no
contents, is also (nearly) the most general, validating any combination of
text and element content and allowing any attributes, and providing for
recursive validation where possible."

Does it explains an issue?
--
td



Joseph J. Kesselman's Avatar
Joseph J. Kesselman
Guest
n/a Posts
June 27th, 2008
07:07 PM
#3

Re: schema issue
You've just answered your own question, I think...

TOUDIdel's Avatar
TOUDIdel
Guest
n/a Posts
June 27th, 2008
07:07 PM
#4

Re: schema issue

Uzytkownik "Joseph J. Kesselman" <keshlam-nospam@comcast.netnapisal w
wiadomosci news:482e110a$1@kcnews01...
Quote:
You've just answered your own question, I think...


Thx for confirmation my supposition.
Don't you consider it is very interesting schema issue following many
different xml documents which every would be valid against the same schema.
That document may have e.g. 20 B or even 20 MB.
Example:

<xs:schema ...>
<xs:element name="rootElement"/>
</xs:schema>

rootElement hasn't data type reference so it can contains both empty string
or freely length string or even big document fragment. Result would be the
same: element's content won't be validated.

That phenomenon permits for "light" schema allowing any content data and
document always will be valid with schema. Of course better not to abuse
that fact :)

--
td



 
Not the answer you were looking for? Post your question . . .
189,798 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors