-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hassan,

On 11/30/12 5:04 PM, Hassan Schroeder wrote:
> On Fri, Nov 30, 2012 at 1:50 PM, Christopher Schultz 
> <ch...@christopherschultz.net> wrote:
> 
>> I'm unaware of a technique to allow partial structural validity
>> (say, element nesting) without also explicitly specifying which
>> attributes are allowed.
> 
> Wait, what? The OP's example isn't even well-formed XML, and any 
> decent text editor should flag that.
> 
> Attribute names and values aren't relevant to well-formed-ness.

OP never posted the whole XML, so we don't know that it's definitely
not well-formed.

Tomcat definitely bombs if the document isn't well-formed:

Nov 30, 2012 5:08:28 PM org.apache.tomcat.util.digester.Digester
endElement
WARNING:   No rules found matching 'Server/Service/Engine/Host/Host'.
Nov 30, 2012 5:08:28 PM org.apache.tomcat.util.digester.Digester
fatalError
SEVERE: Parse Fatal Error at line 152 column 7: The element type
"Host" must be terminated by the matching end-tag "</Host>".
org.xml.sax.SAXParseException; systemId:
file:/CATALINA_BASE/conf/server.xml; lineNumber: 152; columnNumber: 7;
The element type "Host" must be terminated by the matching end-tag
"</Host>".
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(ErrorHandlerWrapper.java:198)
  [....]

If the OP was using an XML editor (again, without any Schema or DTD),
it might have let him (or even auto-fixed the structure to) do this:

<Service>
 <Engine>
  <Host>
   <Host>
   </Host>
  </Host>
 </Engine>
</Service>

This message would have showed up in catalina.out:

Nov 30, 2012 5:11:47 PM org.apache.tomcat.util.digester.Digester
endElement
WARNING:   No rules found matching 'Server/Service/Engine/Host/Host'.

...but such a thing is easy to miss.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlC5L2sACgkQ9CaO5/Lv0PD/1wCgpJIRrwYORoDhSZaxYOx2cG2Z
/VgAoLd0WLVjOwohYT+gC1z+AEIq2mTT
=kDgf
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to