[xsd-users] Generated XML does not have full schema qualifiers

Wesley Peters Wesley.Peters at tachyon.com
Fri Sep 28 16:30:34 EDT 2012


I actually figured this out in the shower this morning.  It's nice to know that it's in the FAQ, too.  My "fix" looks nearly identical to the linked FAQ entry, so I think I got it right.

I have a follow-on question, though.  Since the xsd has pretty much the same information encoded, i.e.:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:p="http://schema.tachyon.com/modemCommand"
            targetNamespace="http://schema.tachyon.com/modemCommand">


Does this information get dumped into the generated C++ object?  I guess grep would answer that question for me.  Since it's in the XSD, I'd rather be able to retrieve it "from" the XSD, rather than having to code it in two places.  I should probably learn how to make this an actual standalone schema instead, right?

On 9/28/12 4:05 AM, "Boris Kolpackov" <boris at codesynthesis.com> wrote:

Hi Wesley,

Wesley Peters <Wesley.Peters at tachyon.com> writes:

> As expected, the namespaceURI is "http://schema.tachyon.com/modemCommand"
> and the qualifiedName is "p:RegisterCondition".  My question is, how do I
> add the additional namespace URIs to the document?

Those are not namespace URIs (well, only one of them is). What's missing
in your case is the xsi:schemaLocation attribute (and the xsi prefix
mapping). The second code example for the "How do I create an empty
Xerces-C++ DOM document?" entry in the C++/Tree Mapping shows how to
add them:

http://wiki.codesynthesis.com/Tree/FAQ#How_do_I_create_an_empty_Xerces-C.2B.2B_DOM_document.3F

Boris


________________________________

Confidentiality Notice: The information contained in this electronic e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and is confidential and/or privileged. If you and we have a confidentiality agreement or other non-disclosure obligations between us, this Notice shall be deemed to mark and identify the content of this email and any attachments as confidential and proprietary. If any reader of this communication is not the intended recipient, unauthorized use, disclosure or copying is strictly prohibited, and may be unlawful. If you have received this communication in error, please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you.

IRS Circular 230 Disclosure: To ensure compliance with requirements imposed by the IRS, please be advised that any U.S. federal tax advice contained in this communication (including any attachments) is not intended or written to be used or relied upon, and cannot be used or relied upon, for the purpose of (i) avoiding penalties under the Internal Revenue Code, or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein.

E-mail is susceptible to data corruption, interception, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.



More information about the xsd-users mailing list