G
Gus Gassmann
Hi all:
I've been working with XML schemas for about a year now, strictly
monkey-see-monkey-do so far. (For instance, I did not know about
namespaces until yesterday.) My access to the internet is also rather
intermittent at the moment, so please be gentle...
My question concerns the control elements in XML Schema, such as
<sequence>, <choice>, <type>, etc. I was given an XML reader that I
need to tweak to my own setup. The reader seems to assume that the
control elements all live in the default namespace (no prefixes),
while the XML schemas I have all use a declared namespace instead.
It's easy enough to change the reader, but I want to be sure that
this does not break anything else later on.
Hence the question: Are the control elements <choice>, <sequence>,
<type>, etc. reserved or is it possible/advisable/normal to redefine
them somehow and to use the redefined or renamed elements in place of
the original ones at http://www.w3.org/2001/XMLSchema.
Let's say I have something like:
<?xml version="1.0" encoding="US-ASCII"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:mine="foo"
targetNamespace="foo" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<complexType name="choice">
....
Is this legal?
Put another way: say, I am parsing an XML schema. When I find an
element <mine:choice> in a namespace other than "http://www.w3.org/
2001/XMLSchema", is it safe to assume that it does _not_ set up a
choice the way <choice> does in XML Schema?
Also, it appears to be legal for an <element> to have a name but no
type. (I was given an example that parses in my development system,
XMLSpy.) Is there such a thing as a default type? Is it safe to treat
<element name="foobar"/>
as a string?
Thanks very much for any feedback.
gus gassmann
I've been working with XML schemas for about a year now, strictly
monkey-see-monkey-do so far. (For instance, I did not know about
namespaces until yesterday.) My access to the internet is also rather
intermittent at the moment, so please be gentle...
My question concerns the control elements in XML Schema, such as
<sequence>, <choice>, <type>, etc. I was given an XML reader that I
need to tweak to my own setup. The reader seems to assume that the
control elements all live in the default namespace (no prefixes),
while the XML schemas I have all use a declared namespace instead.
It's easy enough to change the reader, but I want to be sure that
this does not break anything else later on.
Hence the question: Are the control elements <choice>, <sequence>,
<type>, etc. reserved or is it possible/advisable/normal to redefine
them somehow and to use the redefined or renamed elements in place of
the original ones at http://www.w3.org/2001/XMLSchema.
Let's say I have something like:
<?xml version="1.0" encoding="US-ASCII"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:mine="foo"
targetNamespace="foo" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<complexType name="choice">
....
Is this legal?
Put another way: say, I am parsing an XML schema. When I find an
element <mine:choice> in a namespace other than "http://www.w3.org/
2001/XMLSchema", is it safe to assume that it does _not_ set up a
choice the way <choice> does in XML Schema?
Also, it appears to be legal for an <element> to have a name but no
type. (I was given an example that parses in my development system,
XMLSpy.) Is there such a thing as a default type? Is it safe to treat
<element name="foobar"/>
as a string?
Thanks very much for any feedback.
gus gassmann