Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MY XML is not working

    Hi Team,

    This is my first post here and i am totally new to XML. I have written a sql syntax to create an XML. Here is the code
    Code:
    WITH XMLNAMESPACES ( 'urn:swift:saa:xsd:saa.2.0' AS Saa)    
    select
     '2.0.2' 'Saa:Revision',
     DbtrAcct_Id_IBAN 'Saa:Header/Saa:Message/Saa:SenderReference',
      1 'Saa:Header/Saa:Message/Saa:MessageIdentifier',
      'camt.056.001.01'  'Saa:Header/Saa:Message/saa:Format', 
      'cn=mx01,0='+DbtrAgt_FinInstnId_BIC+'o=swift'  'Saa:Header/Saa:Message/Saa:Sender/Saa:DN' ,
      'cn=mx99,0='+CdtrAgt_FinInstnId_BIC+'o=swift'  'Saa:Header/Saa:Message/Saa:Receiver/Saa:DN', 
      'swift.generic.fast!p'  'Saa:Header/Saa:Message/Saa:NetworkInfo/Saa:Service', 
      'Payment File from Bank BANKAABB'  'Saa:Header/Saa:Message/Saa:NetworkInfo/Saa:SWIFT:NetNetworkInfo/Saa:FileDescription',
      'Sent on 01/04/2009' 'Saa:Header/Saa:Message/Saa:NetworkInfo/Saa:SWIFT:NetNetworkInfo/Saa:FileInfo',
      'SHA=256' 'Saa:Header/Saa:Message/Saa:SecurityInfo/Saa:SWIFTNetSecurityInfo/Saa:SWIFTNetSecurityInfo',
      'pnRSc38nofZ3AF1pmWSnmoLpfprVb/pJXx5l+PhJC68=' 'Saa:Header/Saa:Message/Saa:SecurityInfo/Saa:SWIFTNetSecurityInfo/Saa:FileDigestValue',
      filename 'Saa:Header/Saa:Message/Saa:FileLogicalName',
      cast(dbo.FIM_GetXMLCamt056UDF(2,1) as xml) 'Saa:Body'   
      from FimBank_TransDetails ftd  where ftd.AutoId=2
      for XML path (''),
      root ('Saa:DataPDU'), ELEMENTS XSINIL
    I got an error "XML name space prefix 'saa' declaration is missing for FOR XML column name 'Saa:Header/Saa:Message/saa:Format'."

    Searched in google but no satisfactory answer I am getting.

    However I want to see the output like below

    Code:
    <Saa:DataPDU mins:Saa="urn:swift:saa:xsd:saa.2.0">
    	<Saa:Revision>2.0.2</Saa:Revision>
    	<Saa:Header>
    		<Saa:Message>
    			<Saa:SenderReference>File1</Saa:SenderReference>
    			<Saa:MessageIdentifier>Req001</Saa:MessageIdentifier>
    			<saa:Format>File</Saa:Format>
    			<Saa:Sender>
    				<Saa:DN>cn=mx01,0=bankaabb,o=swift</Saa:DN>
    			</Saa:Sender>
    			<Saa:Receiver>
    				<Saa:DN>cn=mx99,0=bankyyzz,o=swift</Saa:DN>
    			</Saa:Receiver>
    			<Saa:NetworkInfo>
    				<Saa:Service>Service.FileAct</Saa:Service>
    				<Saa:SWIFT:NetNetworkInfo>
    					<Saa:FileDescription>Payment File from Bank BANKAABB</Saa:FileDescription>
    					<Saa:FileInfo>Sent on 01/04/2009</Saa:FileInfo>
    				</Saa:SWIFT:NetNetworkInfo>
    			</Saa:NetworkInfo>
    			<Saa:SecurityInfo>
    				<Saa:SWIFTNetSecurityInfo>
    					<Saa:FileDigestAlgorithm>SHA=256</Saa:FileDigestAlgorithm>
    					<Saa:FileDigestValue>pnRSc38nofZ3AF1pmWSnmoLpfprVb/pJXx5l+PhJC68=</Saa:FileDigestValue>
    				</Saa:SWIFTNetSecurityInfo>
    			</Saa:SecurityInfo>
    			<Saa:FileLogicalName>Payments-Bank BANKAABB</Saa:FileLogicalName>
    		</Saa:Message>
    	</Saa:Header>
    	<Saa:Body>payments,fct</Saa:Body>
    </Saa:DataPDU>
    Could you please guide me? Please help

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    Where's your xmlns:Saa attribute? That might be what it's complaining about.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •