Benson, It's a default value that's biting you. processContent="strict" [1] when you don't specify it. Your document would only be valid if your schema contained a global attribute declaration for "blather" but you haven't declared one.
Try <xs:anyAttribute processContents="lax"/> or <xs:anyAttribute processContents="skip"/> if you're not expecting or requiring the attributes in your instance document to be declared. Thanks. [1] http://www.w3.org/TR/xmlschema-1/#element-anyAttribute Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: mrgla...@ca.ibm.com E-mail: mrgla...@apache.org Benson Margulies <bimargul...@gmail.com> wrote on 03/16/2011 07:34:41 PM: > Oops, I sent the wrong version of the schema below. Remove the > <xs:attribute name='blather'/> of course. > > On Wed, Mar 16, 2011 at 7:33 PM, Benson Margulies > <bimargul...@gmail.com> wrote: > > Xerces 2.9.1, and everything else I've tried, rejects an attribute > > that I'm trying to permit with xs:anyAttribute. it seems just about as > > simple of an application as possible, so I imagine that I'm missing > > something pretty silly. > > > > A very simple schema: > > > > <?xml version="1.0" encoding="UTF-8"?> > > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > > xmlns:xml="http://w ww.w3.org/XML/1998/namespace" > > xmlns:bt="http://www.basistech.com/2010/btml/" > > targetNamespace="http://www.basistech.com/2010/btml/"> > > <xs:element name="html-attributes"> > > <xs:complexType> > > <xs:attribute name="blather" type="xs:string"/> > > <xs:anyAttribute/> > > </xs:complexType> > > </xs:element> > > </xs:schema> > > > > A very simple document: > > > > <?xml version="1.0"?> > > <html-attributes xmlns="http://www.basistech.com/2010/btml/" > > xmlns:q="http:/q/" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://www.basistech.com/2010/btml/ > huh.xsd" > > blather="Blither" > > /> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org > For additional commands, e-mail: j-users-h...@xerces.apache.org