Yes, I would have thought that that would work. If not, then it would seem
that you could never have a DOCTYPE in a document when namespaces are
enabled.

----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]



"Brett McLaughlin" <[EMAIL PROTECTED]> on 03/06/2000 11:40:45
AM

Please respond to [EMAIL PROTECTED]

To:   <[EMAIL PROTECTED]>
cc:
Subject:  Re: Strange Namespaces bug in SAX



<snip />

> >
> >So I guess my question is how do I do what I suggested (have a
> >namespace-enabled document validated by a DTD)?
> >
>
> Well, to be technical about it, you never validate a namespace enabled
> document with a DTD. You validate the lexical representation of that
> document, but the actual 'namespaceized' version of the document cannot
be
> validated by a DTD. So though the lexical token "foo:bar" really
represents
> {http://wwwfoobar.com/something}bar, all that the DTD can do is make sure
> that something called literally "foo:bar" is there.
>
> Given that the DTD process is completely lexical in terms of names, it
> makes sense to me that the testing of the root element against the
element
> in the DOCTYPE line should be purely lexical as well. Particularly, given
> than most people writing namespace oriented documents would want to have
> the root element in a non-global namespace, it makes even more sense.

According to that, then wouldn't this work:

<?xml version="1.0"?>
<!DOCTYPE validation SYSTEM "validation.dtd">

<validation xmlns:nxbirpas="http://www.nextel.com"; module="authentication">

  <nxbirpas:screen name="LoginScreen">

    <nxbirpas:field name="username">
      <nxbirpas:rule name="nonNull">true</nxbirpas:rule>
      <nxbirpas:rule name="minLength">
        <nxbirpas:ruleValue>4</nxbirpas:ruleValue>
      </nxbirpas:rule>
      <nxbirpas:rule name="maxLength">
        <nxbirpas:ruleValue>12</nxbirpas:ruleValue>
      </nxbirpas:rule>
    </nxbirpas:field>

  </nxbirpas:screen>

  <nxbirpas:screen name="WelcomeScreen">
  </nxbirpas:screen>

  <nxbirpas:screen name="BackupScreen">
  </nxbirpas:screen>

</validation>

The root element is non-prefixed, as it is in the DOCTYPE declaration.
However, I get the same error about the element validation in DOCTYPE not
matching the root element.  Am I misunderstanding you?

Thanks again for the help on this one.

-Brett

>
> ----------------------------------------
> Dean Roddey
> Software Weenie
> IBM Center for Java Technology - Silicon Valley
> [EMAIL PROTECTED]
>
>
>




Reply via email to