[xsd-users] CodeSynthesis - Namespaces and schemas

Andrew.King2 at barclayscapital.com Andrew.King2 at barclayscapital.com
Thu Feb 2 07:56:09 EST 2012


Hi Boris,

Sorry, that was a typo on my part - I certainly DO want ALL of the namespaces removed, so I didn't wish to see <fpml:... anywhere

I followed Lyndon's advice, and followed the examples on the links that he provided, but I was unsuccessful in removing the namespaces from the generated code. I tried many combinations of namespace_infomap settings, but the resulting code ALWAYS had a namespace of either fpml, or p1.

I shall continue seeing if I can fix the problem. Failing that, I will strip out the namespaces using a searchAndReplace function.

Thank you for your help.

Andrew


-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Thursday, February 02, 2012 12:54 PM
To: King, Andrew: IT (LDN)
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] CodeSynthesis - Namespaces and schemas

Hi Andrew,

Andrew.King2 at barclayscapital.com <Andrew.King2 at barclayscapital.com> writes:

> Ideally, I'd like the above XML to look like the following:
> 
> <fpml:requestConfirmation xmlns:fpml="http://www.fpml.org...
>   <isCorrection>false</isCorrection>
> [...]

As Lyndon pointed out in his reply, you need change:

> map["fpml"].name = "http://www.fpml.org/FpML-5/confirmation";
> map["fpml"].schema = "/xmls/OTC/fpml-main-5-1.xsd";

To read:

map[""].name = "http://www.fpml.org/FpML-5/confirmation";
map[""].schema = "/xmls/OTC/fpml-main-5-1.xsd";

Note, however, that this won't produce exactly the XML you have shows.
In particular, the root element won't have the fpml prefix since it
is in the default namespace. Rather, the output will look like this:

<requestConfirmation xmlns="http://www.fpml.org...
  <isCorrection>false</isCorrection>
  ...

Boris
_______________________________________________

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. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing.  Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP.  This email may relate to or be sent from other members of the Barclays Group.
_______________________________________________



More information about the xsd-users mailing list