[xsd-users] Custom namespace_infomap binding

Forstner Michael Michael.Forstner at cpg.de
Tue Oct 30 10:51:32 EDT 2007


Hi all,

following scenario:
1 XSD which imports 2 another XSDs.
If I want to serialize an object to std::ostream, I have to provide a namespace_infomap
with 3 entries. Another way would be if I could bind the namespace map to the specific tags
but I don't know how this could be done.

Today I get this output:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<SCLSCT:BBkICFBlkCdtTrf xmlns:SCLSCT="urn:BBkICF:xsd:$BBkICFBlkCdtTrf"
xmlns:sw8="urn:iso:std:iso:20022:tech:xsd:sct:pacs.008.001.01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:BBkICF:xsd:$BBkICFBlkCdtTrf BBkICFBlkCdtTrf.xsd">
  <SCLSCT:SndgInst>SCRUDE51AXX</SCLSCT:SndgInst>
  <SCLSCT:RcvgInst>MARKDEFF</SCLSCT:RcvgInst>
  <SCLSCT:FileRef>XX20070920000074</SCLSCT:FileRef>
  <SCLSCT:SrvcID>SCT</SCLSCT:SrvcID>
  <SCLSCT:TstCode>P</SCLSCT:TstCode>
  <SCLSCT:FType>ICF</SCLSCT:FType>
  <SCLSCT:FDtTm>2007-09-20T16:20:07</SCLSCT:FDtTm>
  <SCLSCT:NumCTBlk>1</SCLSCT:NumCTBlk>
  <SCLSCT:NumRFRBlk>0</SCLSCT:NumRFRBlk>
  <SCLSCT:pacs.008.001.01>
    <sw8:GrpHdr>
      <sw8:MsgId>CPG-2007-09-20.22</sw8:MsgId>
      <sw8:CreDtTm>2007-09-20T16:20:07</sw8:CreDtTm>
      ...

But I'd like to have following syntax:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<SCLSCT:BBkICFBlkCdtTrf xmlns:SCLSCT="urn:BBkICF:xsd:$BBkICFBlkCdtTrf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:BBkICF:xsd:$BBkICFBlkCdtTrf BBkICFBlkCdtTrf.xsd">
  <SCLSCT:SndgInst>SCRUDE51AXX</SCLSCT:SndgInst>
  <SCLSCT:RcvgInst>MARKDEFF</SCLSCT:RcvgInst>
  <SCLSCT:FileRef>XX20070920000074</SCLSCT:FileRef>
  <SCLSCT:SrvcID>SCT</SCLSCT:SrvcID>
  <SCLSCT:TstCode>P</SCLSCT:TstCode>
  <SCLSCT:FType>ICF</SCLSCT:FType>
  <SCLSCT:FDtTm>2007-09-20T16:20:07</SCLSCT:FDtTm>
  <SCLSCT:NumCTBlk>1</SCLSCT:NumCTBlk>
  <SCLSCT:NumRFRBlk>0</SCLSCT:NumRFRBlk>
  <SCLSCT:pacs.008.001.01 xmlns="urn:iso:std:iso:20022:tech:xsd:sct:pacs.008.001.01">   <!-- NAMESPACE is declared here -->
    <GrpHdr>                                                                            <!-- No Prefix needed for sub-tags -->
      <MsgId>CPG-2007-09-20.22</MsgId>
      <CreDtTm>2007-09-20T16:20:07</CreDtTm>
      ...

Thanks for any help,
Michael Forstner




More information about the xsd-users mailing list