[xsd-users] please help me codesynthesis xsd team!
刘强
vieri122 at gmail.com
Tue Oct 12 07:32:52 EDT 2010
Thank you very much for your reply.I got it.
And there is anather mistake,about "xsi:type"
that is my code:
* auto_ptr<csMsgsReq> h =
csMsgsReq_("demo.xml",::xml_schema::flags::dont_validate);
xml_schema::namespace_infomap map;
map[""].name = "URN:cantronic-system-4";
csMsgsReq_(cout,*h,map);*
*
*the consle print:
*<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<csMsgsReq xmlns="URN:cantronic-system-4">
<csMsgReq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<authority xsi:type="cstypeAuthorityCommon"/>
<status cpu="1" disk="3" mem="2" net="4"/>
</csMsgReq>*
</csMsgsReq>
*
but the "demo.xml" actual is:*
*<?xml version="1.0" encoding="UTF-8"?>
<csMsgsReq xsi:schemaLocation="URN:cantronic-system-4
xmlns="URN:cantronic-system-4" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
<csMsgReq xsi:type="cstypeStatus">
<authority xsi:type="cstypeAuthorityCommon"/>
<status cpu="1" mem="2" disk="3" net="4"/>
</csMsgReq>
</csMsgsReq>*
where is the xsi:type="cstypeStatus"?
I used the --generate-polymorphic and the --polymorphic-type-all command.
please help me. thank you again.
2010/10/12 Boris Kolpackov <boris at codesynthesis.com>
>
> Hi,
>
> vieri122 at gmail.com writes:
>
> > Subject: please help me codesynthesis xsd team!
>
> Please see item #3 in the posting guidelines:
>
> http://www.codesynthesis.com/support/posting-guidelines.xhtml
>
>
> > <p1:csHostStatus xmlns:p1="URN:cantronic-system-4">
> >
> > [...]
> >
> > <csHostStatus xmlns="URN:cantronic-system-4">
> >
> > where is the "p1:" from?
>
> It is an automatically-assigned prefix for the "URN:cantronic-system-4"
> XML namespace. If you want to get the same output as the original
> document, try something like this:
>
> xml_schema::namespace_infomap map;
>
> map[""].name = "URN:cantronic-system-4";
>
> csHostStatus(cout,*h, map);
>
> For more information, see Section 6.1, "Namespace and Schema Information"
> in the C++/Tree Mapping Getting Started Guide:
>
>
http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#6.1
>
> Boris
--
Best wishes for you and your family
More information about the xsd-users
mailing list