xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett McLaughlin <bmcla...@algx.net>
Subject Re: Fw: schema question
Date Wed, 15 Dec 1999 16:46:43 GMT

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/structures.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