[xsd-users] Serialize a xml whitout the attributes xmlns, xmlns:xsi and xsi:schemaLocation

Cláudio Margulhano cmargulhano at gmail.com
Mon Oct 23 09:04:58 EDT 2006


Hi Boris,

I really appreciate this powerfull tool.
Thank you again!

Best regards,
Cláudio

2006/10/23, Boris Kolpackov <boris at codesynthesis.com>:
>
> Hi Cláudio,
>
> Cláudio Margulhano <cmargulhano at gmail.com> writes:
>
> > Is there one way to serialize a xml whitout the attributes xmlns,
> xmlns:xsi
> > and xsi:schemaLocation?
> >
> > ...
> >
> > <message xmlns="http://www.example.org/logevents" xmlns:xsi="
> > http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
> > http://www.example.org/logevents logger.xsd">
>
> You can get rid of xmlns:xsi and xsi:schemaLocation by not providing
> schema
> location in the namespace infomap. E.g., change the following code:
>
>
> xml_schema::namespace_infomap map;
>
> map[""].name = "http://www.example.org/logevents";
> map[""].schema = "logger.xsd";
>
> message (..., map);
>
>
> to read:
>
>
> xml_schema::namespace_infomap map;
>
> map[""].name = "http://www.example.org/logevents";
>
> message (..., map);
>
>
> You cannot get rid of xmlns="http://www.example.org/logevents" if your
> schema uses XML namespaces (e.g., has targetNamespace attribute in the
> xsd:schema root). So you will have to change your schema fist and then
> you can use the empty namespace infomap:
>
>
> xml_schema::namespace_infomap map;
>
> message (..., map);
>
>
> hth,
> -boris
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.5 (GNU/Linux)
>
> iQGVAwUBRTy4esiAKQuuCE8dAQJNfQwA081Io68VP2bo6vvAddd27ZpPt1POC34R
> 8GvPRRU70GbDOoUyN2RFuYg2vQL3YBuBRApcvCPb/a09BGgp91ZmTAGF+lx8EG/G
> tG4x2h0S7zSQwAHp54NvAm+cx3CJNPTwfrWZXTip7YkynHywfV2030vb1rOr9/mR
> SAhGlJQMAgDw+y2L1V1/8SXlqDZj3fMkqUejkOGWVqF9PJIvbNCHB0ifm22nsFsK
> cKRfqxXdTLMn/NKLRNmpJhSbuxWFXeMyuAPUn3qst9dpr1VEHgBYojgfx0bYUrHS
> Ua+bO8dcBd0D0pqVFdpfoV5WeMPFoDVkNbPlBwmz3OtL2K6uLlWUZii3P/wIAck0
> JkLAIIVvLRWoIanQvdPd7WkF8SReg2mzDypg1eBwQ8iRH07e1CPhyqv6SZo+z+fY
> xGO56/pHb8bUHzT68MLhNhpVlmp89jQS6oIHwCP2Sd35I7CgAlSEBgJLz/GUoa8j
> 5s9g2rZGLjr8M2IwaujCv642evYzXsQ7
> =67xe
> -----END PGP SIGNATURE-----
>
>
>



More information about the xsd-users mailing list