[xsde-users] Serializing questions: Illegal namespace error & 'g1' namespace/prefix

O'Laughlin, Terry Terry.O'Laughlin at ipc.com
Tue Nov 30 16:07:26 EST 2010


New user questions ... <g>


1.       Why do I get this error, illegal namespace, when I try to serialize an element from my schema?

I see where someone else had this problem and found a line of code in the genx.c file.
I make the changed as described in the link below.
The error goes away.
Is this a bug in Genx?  Is there something that I'm doing wrong?  Is this a valid 'fix'?  I did not see a response to this message.
http://codesynthesis.com/pipermail/xsd-users/2010-August/002970.html

I see that there is another message in this thread.  I will say that I don't have the XML background at this time to understand the question and the answer.
http://codesynthesis.com/pipermail/xsd-users/2010-August/002973.html
I do have some complex types in my schema, which I think is part of the crux of this message exchange.
The message (root element) I was trying to serialize is a complex element type.

            <!-- 1) Connect Request Message -->
            <xs:element name="ConnectRequest">
                        <xs:complexType>
                                    <xs:sequence>
                                                <xs:element name="Header" type="MessageHeader"/>
                                                <xs:element name="ProtocolVersion" type="xs:int"/>
                                                <xs:element name="HeartBeatTimeOut" type="xs:int"/>
                                                <xs:element name="ConnectionTimeout" type="xs:int"/>
                                    </xs:sequence>
                        </xs:complexType>
            </xs:element>



2.       Why do I get the prefix/namespace 'g1:' added as an attribute to my root element?  (Here is my serialized output, with "crs" added for readability)

<g1:ConnectRequest
xmlns:g1=""
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="messages.xsd">

<Header>
<Type>ConnectRequest</Type>
<Trid>0</Trid><SiteId>99</SiteId>
<TimeStampSeconds>2</TimeStampSeconds>
<TimeStampMicroseconds>2</TimeStampMicroseconds>
<TicSessionId>0</TicSessionId>
<RecorderSessionId>0</RecorderSessionId>
</Header>
<ProtocolVersion>3</ProtocolVersion>
<HeartBeatTimeOut>0</HeartBeatTimeOut>
<ConnectionTimeout>0</ConnectionTimeout>
</g1:ConnectRequest>


Why doesn't the 'hello' serialize example have this same 'g1' prefix/namespace? (Screen shot of 'hello' serializer example

C:\xsde_v3.2_win32_vc9>cd examples\cxx\serializer\hello
C:\xsde_v3.2_win32_vc9\examples\cxx\serializer\hello>driver
<hello
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="hello.xsd">
  <greeting>Hello</greeting>
  <name>sun</name>
  <name>moon</name>
  <name>world</name>
</hello>
C:\xsde_v3.2_win32_vc9\examples\cxx\serializer\hello>

Inquiring minds are inquiring.

Thanks for the help,

Cheers,

Terry O'


Terry O'Laughlin
Sr. Software Engineer
IPC
TS Engineering Alliance Sustaining Dept.
777 Commerce Drive
Fairfield, CT 06825
phone: 203-339-7987
fax: 203-339-7809
www.ipc.com<http://www.ipc.com/>
Terry.O'Laughlin at ipc.com<mailto:first.last at ipc.com>



________________________________
DISCLAIMER: This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unintended recipients are prohibited from taking action on the basis of information in this e-mail.E-mail messages may contain computer viruses or other defects, may not be accurately replicated on other systems, or may be intercepted, deleted or interfered with without the knowledge of the sender or the intended recipient. If you are not comfortable with the risks associated with e-mail messages, you may decide not to use e-mail to communicate with IPC. IPC reserves the right, to the extent and under circumstances permitted by applicable law, to retain, monitor and intercept e-mail messages to and from its systems.

[cid:green-logo1ff1.jpg]Please consider the environment before printing this email.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: green-logo1ff1.jpg
Type: image/jpeg
Size: 1268 bytes
Desc: green-logo1ff1.jpg
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20101130/2237c2ac/green-logo1ff1.jpg


More information about the xsde-users mailing list