From boris at codesynthesis.com Mon Jan 3 06:27:08 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jan 3 06:24:28 2022 Subject: [xsd-users] Problem to transform mathml2 for COLLADA to C++ In-Reply-To: References: Message-ID: Miao Wang writes: > I follow the thread > https://www.codesynthesis.com/pipermail/xsd-users/2009-July/002388.html > to transform COLLADA 1.5 and success. Because COLLADA need mathml2 to work, > I transform the xsd files in mathml2. When transform common/math.xsd using > the same parameters, the following error shows: > > common/math.xsd:36:47: error: group ' > http://www.w3.org/1998/Math/MathML:Presentation-token.class' not found > common/math.xsd:37:48: error: group ' > http://www.w3.org/1998/Math/MathML:Presentation-layout.class' not found > common/math.xsd:38:48: error: group ' > http://www.w3.org/1998/Math/MathML:Presentation-script.class' not found > common/math.xsd:39:47: error: group ' > http://www.w3.org/1998/Math/MathML:Presentation-table.class' not found > common/math.xsd:40:31: error: type ' > http://www.w3.org/1998/Math/MathML:mspace' not found > common/math.xsd:40:31: error: referenced element 'mspace' not found > .......more > > Has anyone successfully to transform mathml2 ? Based on my (internal) notes, COLLADA 1.5.0 can only be handled in the file-per-type mode[1] (probably because of the above errors). Here is the command line I used: xsd cxx-tree --output-dir out --file-per-type --options-file collada.options collada_schema_1_5.xsd Where collada.options contains: --generate-polymorphic --root-element COLLADA --namespace-map http://www.w3.org/1998/Math/MathML=mathML --location-map http://www.w3.org/Math/XMLSchema/mathml2/mathml2.xsd=mathml2/mathml2.xsd --location-map http://www.w3.org/2001/xml.xsd=xml/xml.xsd --generate-forward --anonymous-regex %.* .* (.+)/(.+)%$1_$2% # Flatten the include hierarchy. # #--include-regex %.*/(.+)%$1% --type-file-regex %http://.*/MathML (.+)%mathml-$1% [1] http://www.codesynthesis.com/~boris/blog/2008/02/13/codesynthesis-xsd-3-1-0-released/ From miaowang.tw at gmail.com Tue Jan 4 08:25:17 2022 From: miaowang.tw at gmail.com (Miao Wang) Date: Tue Jan 4 08:57:16 2022 Subject: [xsd-users] Problem to transform mathml2 for COLLADA to C++ In-Reply-To: References: Message-ID: Hello Boris, Thank you for your reply and I success to generate c++ code of COLLADA 1.5 by following your instructions. BTW, while I try to build a static library for all the codes, it occurs LNK1248 error. So I have to separate the codes in to two static libraries. Miao ?????www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> Boris Kolpackov ? 2022?1?3? ?? ??7:27??? > Miao Wang writes: > > > I follow the thread > > https://www.codesynthesis.com/pipermail/xsd-users/2009-July/002388.html > > to transform COLLADA 1.5 and success. Because COLLADA need mathml2 to > work, > > I transform the xsd files in mathml2. When transform common/math.xsd > using > > the same parameters, the following error shows: > > > > common/math.xsd:36:47: error: group ' > > http://www.w3.org/1998/Math/MathML:Presentation-token.class' not found > > common/math.xsd:37:48: error: group ' > > http://www.w3.org/1998/Math/MathML:Presentation-layout.class' not found > > common/math.xsd:38:48: error: group ' > > http://www.w3.org/1998/Math/MathML:Presentation-script.class' not found > > common/math.xsd:39:47: error: group ' > > http://www.w3.org/1998/Math/MathML:Presentation-table.class' not found > > common/math.xsd:40:31: error: type ' > > http://www.w3.org/1998/Math/MathML:mspace' not found > > common/math.xsd:40:31: error: referenced element 'mspace' not found > > .......more > > > > Has anyone successfully to transform mathml2 ? > > Based on my (internal) notes, COLLADA 1.5.0 can only be handled in the > file-per-type mode[1] (probably because of the above errors). Here is > the command line I used: > > xsd cxx-tree --output-dir out --file-per-type --options-file > collada.options collada_schema_1_5.xsd > > Where collada.options contains: > > > --generate-polymorphic > --root-element COLLADA > --namespace-map http://www.w3.org/1998/Math/MathML=mathML > --location-map > http://www.w3.org/Math/XMLSchema/mathml2/mathml2.xsd=mathml2/mathml2.xsd > --location-map > > http://www.w3.org/2001/xml.xsd=xml/xml.xsd > --generate-forward > --anonymous-regex %.* .* (.+)/(.+)%$1_$2% > # Flatten the include hierarchy. > # > #--include-regex %.*/(.+)%$1% > --type-file-regex %http://.*/MathML (.+)%mathml-$1% > > > [1] > http://www.codesynthesis.com/~boris/blog/2008/02/13/codesynthesis-xsd-3-1-0-released/ > From laasunde at hotmail.com Sat Jan 22 09:55:36 2022 From: laasunde at hotmail.com (Lars Sunde) Date: Sat Jan 22 09:52:53 2022 Subject: [xsd-users] Lazy loading Message-ID: Hello, Does XSD 4.0 support any form of lazy loading of nodes in an XML file? Xerces uses the term "defer-node-expansion". We are currently parsing an XML file that contain elements with String or integer or base64Binary data types. It is a runtime decision whether the application needs to parse the base64 data. It would improve performance if the base64 elements were loaded only when actually needed. Does XSD support such a solution? Kind regards, Lars From boris at codesynthesis.com Mon Jan 24 08:31:52 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jan 24 08:28:57 2022 Subject: [xsd-users] Lazy loading In-Reply-To: References: Message-ID: Lars Sunde writes: > Does XSD 4.0 support any form of lazy loading of nodes in an XML file? > Xerces uses the term "defer-node-expansion". Hm, never heard of this feature. A bit of web and source code searching suggest it's a Xerces-J only feature and not supported by Xerces-C++. > We are currently parsing an XML file that contain elements with > String or integer or base64Binary data types. It is a runtime > decision whether the application needs to parse the base64 data. > It would improve performance if the base64 elements were loaded > only when actually needed. Does XSD support such a solution? Not directly but you can probably arrange for something like this using the streaming parsing model. There is the `streaming` example that shows the approach. Quoting from its README: > This example shows how to perform stream-oriented, partially in-memory XML > processing using the C++/Tree mapping. With the partially in-memory parsing > and serialization only a part of the object model is in memory at any given > time. With this approach we can process parts of the document as they become > available as well as handle documents that are too large to fit into memory. So what your could do is parse each chunk of XML into DOM, if the base64 elements are not needed, reset them to empty values (or remove them if the schema allows them to be absent), and then parse the DOM fragment to C++ object.