Spurious elements generated ---------------------------- Key: TUSCANY-963 URL: http://issues.apache.org/jira/browse/TUSCANY-963 Project: Tuscany Issue Type: Bug Components: C++ SDO Affects Versions: Cpp-current Reporter: Caroline Maynard Priority: Critical
I have a schema like so: <?xml version="1.0" encoding="utf-8" ?> <xs:schema targetNamespace="http://www.w3.org/2005/Atom" xmlns="http://www.w3.org/2005/Atom" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd" /> <xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="xhtml1-strict.xsd" /> <xs:element name="content" type="contentType" minOccurs="0" /> <xs:complexType name="contentType" mixed="true" > <xs:sequence> <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="type" type="xs:string" default="text" /> <xs:attribute name="src" type="xs:string" /> <!-- uriType --> <xs:attributeGroup ref="commonAttributes"/> </xs:complexType> <xs:attributeGroup name="commonAttributes"> <xs:attribute ref="xml:base" /> <xs:attribute ref="xml:lang" /> <xs:anyAttribute/> </xs:attributeGroup> </xs:schema> and a document like so: <?xml version="1.0" encoding="UTF-8"?> <content xmlns="http://www.w3.org/2005/Atom" xmlns:tns="http://www.w3.org/2005/Atom" xml:base="blah" xml:lang="blah2" /> I load the schema with XSDHelper::defineFile(), and then load the document with XMLHelper::loadFile(). Then I do a save() of the document. The output is: <?xml version="1.0" encoding="UTF-8"?> <content xmlns="http://www.w3.org/2005/Atom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.w3.org/2005/Atom" base="blah" lang="blah2"> <base>blah</base> <lang>blah2</lang> </content> So not only do I have the lang and base attributes on <content>, I get some elements thrown in for free, too. You'll notice that id is both sequenced and open. I'll find out if both these conditions are necessary. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]