[xsd-users] namespace mapping

Rizzuto, Raymond Raymond.Rizzuto at sig.com
Tue Jun 24 12:31:03 EDT 2008


Hi!

I am using XSD version 3.1.0 on Windows with VisualStudio 2005.  I get an exception when I serialize an object with this namespace map:

        xml_schema::NamespaceInfomap map;
        map[""].name = "";
        map[""].schema = "SDMP-1.1.XSD";
        message(std::cout, m, map);

The exception is:

First-chance exception at 0x7c812a5b in SDMPTest.exe: Microsoft C++ exception: xsd::cxx::xml::dom::mapping<char> at memory location 0x0012eee8..
First-chance exception at 0x7c812a5b in SDMPTest.exe: Microsoft C++ exception: xsd::cxx::tree::no_namespace_mapping<char> at memory location 0x0012f714..

According to the cxx-tree-guide, section 6.1, I was expecting the noNamespaceSchemaLocation attribute in the output with those settings.

The only way I can get the code to run without an exception is to set name to http://sig.com/sdmp/messages, which is the value contained in SDMP-1.1.xsd:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://sig.com/sdmp/messages" targetNamespace="http://sig.com/sdmp/messages" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">

Any other value seems to exhibit the exception.

Unfortunately, the schema is actually not located at that location, which is why I wanted to get the noNamespaceSchemaLocation attribute generated.

Ray




________________________________
Ray Rizzuto
raymond.rizzuto at sig.com
Susquehanna International Group
(610)747-2336 (W)
(215)776-3780 (C)



________________________________
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.



More information about the xsd-users mailing list