xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Buroff" <...@lucent.com>
Subject Re: Fw: schema question
Date Wed, 15 Dec 1999 17:02:59 GMT
Sorry about the bad mail format. I've never had the problem before.
I'm using Outlook Express with IE 5.01. What are you reading your
mail with?

Thanks for the information. I wasn't even sure that what I had done
was correct. I gather from your mail that it is correct but that xml4j
hasn't implemented it yet. Makes me feel better.

Thanks for the workaround. Unfortunately, it doesn't work for me. Are
you using xml4j 3.0.0 EA3? I've attached the modified schema file and
the xml file. Unfortunately, it gets the same error. Does it work for
you?

Steve

<?xml version="1.0" encoding="UTF-8"?>
<!-- <!DOCTYPE schema SYSTEM "structures.dtd"> -->
<!DOCTYPE schema PUBLIC "-//W3C/DTD XML Schema Version 1.0//EN"

"http://www.w3.org/XML/Group/1999/09/23-xmlschema/struct
ures/structures.dtd">
<schema>

<element name="MAIN">
        <archetype name="Main">
                <element ref="OTHER"/>
                <attribute name="xmlns"/>
        </archetype>
</element>

<element name="dummy1">
        <archetype name="Other" content="empty"/>
</element>

<element name="OTHER" type="Other"/>

</schema>


----- Original Message -----
From: Brett McLaughlin
To: general@xml.apache.org
Sent: Wednesday, December 15, 1999 11:46 AM
Subject: Re: Fw: schema question



Steve-

I don't know what kind of mail editor you are using... it really
screws
up my mail... can you try to turn off HTML sending and use only plain
text?  Thanks.

I tried your schema several different ways ... it seems that
Xerces/IBM
XML4J has a bug.  I can create the schema using implicit archetypes,
and
it always works fine.  I can also create explicit archetypes OK.  As
soon as I refer to the explicit archetype,though, it bombs.  In
leafing
through the examples, I notice that both IBM's DTD Visual Editor and
the
samples for IBM XML4J all use _only_ implicit archetypes.  Sounds like
they are still working on that.  So... bad deal in your case.

However, there is a hack ;-)  You can use an implicit archetype, but
give it a name (just what I told you not to do before - this is not
good
style, but it works).  Then other elements can refer to that archetype
as well.  So your XML Schema could look like:

<code>
<?xml version="1.0" encoding="UTF-8"?>

<!-- <!DOCTYPE schema SYSTEM "structures.dtd"> -->
<!DOCTYPE schema PUBLIC "-//W3C/DTD XML Schema Version 1.0//EN"

"http://www.w3.org/XML/Group/1999/09/23-xmlschema/structures/structure
s.dtd">
<schema>

  <element name="OTHER">
    <archetype name="EmptyElement" content="empty"/>
  </element>

  <element name="COMMENT" type="EmptyElement"/>

  <element name="MAIN">
    <archetype>
      <element ref="OTHER"/>
      <attribute name="xmlns"/>
    </archetype>
  </element>

</schema>
</code>

Notice that the COMMENT element refers to the EmptyElement archetype,
which is implicitly defined but explicitly named.  Bad karma, but it
works.  You're not using XML Schema in a production environment, are
you?

-Brett

Mime
View raw message