Return-Path: Delivered-To: apmail-xml-general-archive@www.apache.org Received: (qmail 78870 invoked from network); 6 Oct 2004 01:07:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Oct 2004 01:07:16 -0000 Received: (qmail 19433 invoked by uid 500); 6 Oct 2004 01:07:11 -0000 Delivered-To: apmail-xml-general-archive@xml.apache.org Received: (qmail 19363 invoked by uid 500); 6 Oct 2004 01:07:11 -0000 Mailing-List: contact general-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: general@xml.apache.org Delivered-To: mailing list general@xml.apache.org Received: (qmail 19347 invoked by uid 99); 6 Oct 2004 01:07:11 -0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=DNS_FROM_RFC_POST X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [167.206.5.42] (HELO mta9.srv.hcvlny.cv.net) (167.206.5.42) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 05 Oct 2004 18:07:10 -0700 Received: from [192.168.0.24] (ool-43532b7b.dyn.optonline.net [67.83.43.123]) by mta9.srv.hcvlny.cv.net (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTP id <0I5500KE21RWXG@mta9.srv.hcvlny.cv.net> for general@xml.apache.org; Tue, 05 Oct 2004 21:07:08 -0400 (EDT) Date: Tue, 05 Oct 2004 21:07:07 -0400 From: bsdfsse Subject: How do I populate an XSD instance programmatically? To: general@xml.apache.org Message-id: <4163453B.6060007@optonline.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, I am trying to use Xerces C++ to create XML file's that abide by an XSD Schema. Please forgive me if this is the wrong place to ask this question. I am hoping to find out if Xerces is the tool to do this, or if I should be looking at some other tool for creating the XML files. From what I have seen, Xerces seems aimed at testing the validity of XML files and perhaps tweaking existing ones in memory, but not for populating empty schema instances that are naturally valid. Here is a question I posed to the comp.text.xml newsgroup, but have yet to receive a response. Thanks! ====================================================================== I need to create valid XML data. This data will need to be able to be validated against an XSD schema. The tool I am trying to use is Xerces C++. Being new to both C++ and XML, I am a little stumped at how to begin. http://xml.apache.org/xerces-c/ I was given XSD schemas that my raw data needs to be converted to. My initial approach has been to create an "empty" instance of the DOM structure defined by the XSD file, and then "plug-in" my data in to the proper nodes. This is apparently not the right way to do this, as I can not find any examples of this on the net. If I understand what I've been reading correctly, I need to create a root node, then manually add all the nodes required to place my raw data in the proper locations of the hierarchy. It would seem there should be an easier way to do this, since the DOM structure is already defined in the XSD file. Also, is it true that the DOM object cannot be verified in RAM, but must be saved then reloaded as part of a "conformance" test? Again, it would seem there should be an easier way to do this. Most of the examples I have found on the net use XML schema instance examples that have been contrived by hand. Or they load an existing instance, tweak it in memory, and then save it. There are many examples that show how to programmatically create simple XML data that does not need to conform to an XSD. Are there examples of how to populate an empty XSD instance? I feel like I am missing something basic here. Thanks! --------------------------------------------------------------------- To unsubscribe, e-mail: general-unsubscribe@xml.apache.org For additional commands, e-mail: general-help@xml.apache.org