From jrs at jmsutton.co.uk Thu Sep 6 08:12:51 2012 From: jrs at jmsutton.co.uk (James Sutton) Date: Thu Sep 6 08:32:51 2012 Subject: [xsde-users] Analyse warnings from LLVM v4 compiler Message-ID: FYI, I have run Analyse from the XCode project on xsde v. 3.2.0 and it reports 5 errors in 2 files: xmltok.c -- 1 Logic error (in unknown_toUtf8) genx.c -- 3 Memory errors + 1 Logic error (in genxDeclareNamespace, genxDeclareElement, declareAttribute, genxAddNamespace) (Incidently it is worth looking at the gorgeous graphical explanations of the logic for these in XCode - some are really complicated!) I have not experienced any run-time problems with these errors James Sutton From boris at codesynthesis.com Fri Sep 7 02:08:38 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Sep 7 01:50:29 2012 Subject: [xsde-users] Analyse warnings from LLVM v4 compiler In-Reply-To: References: Message-ID: Hi James, James Sutton writes: > I have run Analyse from the XCode project on xsde v. 3.2.0 and it > reports 5 errors in 2 files: Thanks, I will take a look next time I am testing it with XCode. Boris From dvjuorw+sqsv74 at guerrillamail.com Fri Sep 21 00:35:37 2012 From: dvjuorw+sqsv74 at guerrillamail.com (dvjuorw+sqsv74@guerrillamail.com) Date: Wed Sep 26 07:22:56 2012 Subject: [xsde-users] sequence and any element Message-ID: <3ead2598af310c259d3605cec3d74660897@guerrillamail.com> I am looking into xsde to see if I can use XML to configure my tiny linux box. It requires: 1. any defined element in schema cannot be removed but the xml file may not contain all defined element. 2. the xml file may contain elements that are not defined in the schema. I modified the wildcard example (email.xml, email.xds and driver.cxx) of xsde. I try to achieve: 1. if email.xml does not contain "from" element, will the parser skip the missing elements and validate next element? 2. if an unknown element "abc" is found in email.xml, will the parser ignore the unknown elements? The test code returns "expected element not encountered". It seems the test code expects a "from" element from email.xml. Do I break any XML rule or xsde does not support it? Regards, kk email.xsd email.xml Jane Doe <jane@doe.com> Surfing pictures 123 Hi Jane, Here are cool pictures of me surfing. Cheers, John YmFzZTY0IGJpbmFyeQ== YmFzZTY0IGJpbmFyeQ== driver.cxx - commented out the section that prints the content and generates a reply ... #if 0 // Print what we've got. // cerr << "To: " << msg->to () << endl << "From: " << msg->from () << endl << "Subject: " << msg->subject () << endl; .... message_s.pre (*reply); doc_s.serialize (cout, xml_schema::document_simpl::pretty_print); message_s.post (); #endif } catch (const xml_schema::parser_exception& e) { From boris at codesynthesis.com Thu Sep 27 08:01:44 2012 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Sep 27 07:40:06 2012 Subject: [xsde-users] sequence and any element In-Reply-To: <3ead2598af310c259d3605cec3d74660897@guerrillamail.com> References: <3ead2598af310c259d3605cec3d74660897@guerrillamail.com> Message-ID: Hi, dvjuorw+sqsv74@guerrillamail.com writes: > I am looking into xsde to see if I can use XML to configure my tiny > linux box. It requires: > > 1. any defined element in schema cannot be removed but the xml file > may not contain all defined element. > > 2. the xml file may contain elements that are not defined in the schema. XML Schema wildcards are quite limited and not really suitable for this kind of schema extensibility. It is better to use substitution groups with XSD/e extensions that allow you to ignore/pass-through unknown elements. Take a look at the examples in the examples/cxx/hybrid/evolution directory. Boris