From dawhite32 at gmail.com Tue Oct 14 00:09:55 2025 From: dawhite32 at gmail.com (David White) Date: Tue Oct 14 00:10:28 2025 Subject: [xsd-users] Validation of XML files using a cached schema with xsd parser Message-ID: Hi Boris, Does the C++/Parser support validation of xml files using a cached (or hard-coded) schema (rather than pointing to an external schema via xsi:noNamespaceSchemaLocation="schema.xsd"), as suggested by you for C++/Tree [1]? If so, could you please provide a basic example? Many thanks. Kind regards, David. [1] https://codesynthesis.com/pipermail/xsd-users/2006-September/000535.html From boris at codesynthesis.com Tue Oct 14 10:37:59 2025 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Oct 14 10:38:10 2025 Subject: [xsd-users] Validation of XML files using a cached schema with xsd parser In-Reply-To: References: Message-ID: David White writes: > Does the C++/Parser support validation of xml files using a cached (or > hard-coded) schema (rather than pointing to an external schema via > xsi:noNamespaceSchemaLocation="schema.xsd"), as suggested by you for > C++/Tree [1]? If so, could you please provide a basic example? Assuming you are using Xerces-C++ as the underlying parser, then yes. I don't have an example handy, but the following section from the documentation should give you some hints (in particular, look at no_namespace_schema_location() in properties): https://codesynthesis.com/projects/xsd/documentation/cxx/parser/guide/#7.1 From stefan at konink.de Tue Oct 14 11:12:00 2025 From: stefan at konink.de (Stefan de Konink) Date: Tue Oct 14 11:12:19 2025 Subject: [xsd-users] Validation of XML files using a cached schema with xsd parser In-Reply-To: References: Message-ID: <80f6666c-eb41-4d5d-8220-98d869e0119f@konink.de> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature.asc Type: application/pgp-signature Size: 840 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20251014/c6cb4eba/OpenPGP_signature.pgp From dawhite32 at gmail.com Thu Oct 30 20:40:06 2025 From: dawhite32 at gmail.com (David White) Date: Thu Oct 30 20:40:38 2025 Subject: [xsd-users] Validation of XML files using a cached schema with xsd parser In-Reply-To: <80f6666c-eb41-4d5d-8220-98d869e0119f@konink.de> References: <80f6666c-eb41-4d5d-8220-98d869e0119f@konink.de> Message-ID: Thanks Boris and Stefan for your respective replies. To clarify, I would like to be able to parse XML files using xsd C++/Parser (via xerces-c++) without having to ship and parse an external XML schema file. Thus, I am hoping to hard code (or cache) the XML schema within the source code, either as plain text or in binary form, so that XML files can be parsed without resorting to an external XML schema file. The reference I provided showed it is possible for C++/Tree - see the following messages in the thread: https://codesynthesis.com/pipermail/xsd-users/2006-September/000536.html https://codesynthesis.com/pipermail/xsd-users/2006-September/000540.html Is it possible for C++/Parser and if so, how? Kind regards, David. On Wed, Oct 15, 2025 at 2:18?AM Stefan de Konink wrote: > Op 14-10-2025 om 4:37 p.m. schreef Boris Kolpackov: > > David White writes: > > > >> Does the C++/Parser support validation of xml files using a cached (or > >> hard-coded) schema (rather than pointing to an external schema via > >> xsi:noNamespaceSchemaLocation="schema.xsd"), as suggested by you for > >> C++/Tree [1]? If so, could you please provide a basic example? > > > > Assuming you are using Xerces-C++ as the underlying parser, then yes. > > I don't have an example handy, but the following section from the > > documentation should give you some hints (in particular, look at > > no_namespace_schema_location() in properties): > > > > > https://codesynthesis.com/projects/xsd/documentation/cxx/parser/guide/#7.1 > > My understanding of the question was: can a C++ code tree be generated, > that would be a custom validator for this specific schema, without the > need to ship the original XML Schema or to parse it. > > -- > Stefan >