SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 XML ans SQL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

thampl
Starting Member

2 Posts

Posted - 06/01/2010 :  14:42:18  Show Profile  Reply with Quote
where I'm wrong ?

--CODE :

WITH XMLNAMESPACES (
'urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2' as cec,
'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2' as inv,
'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2' as cbc,
'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2' as cac
)

select ((
select
(select 'ID' = 'IDTEXT' ,
'InvoiceIssuePlaceData' as 'Name',
'xx' as 'ExtensionAgencyID',
'yy' as 'ExtensionAgencyName',
'urn:invoice:hr:issueplace' as 'ExtensionAgencyURI',
'xxxxx' as 'ExtensionAgencyURI',
'MandatoryField' as 'ExtensionReasonCode',
'text' as 'ExtensionReason',
'yyyyy' as 'ExtensionContent'
for xml raw('UBLExtension'), root ('UBLExtensions'), elements, type),

(select '2.0'
for xml raw (''), root('UBLVersionID'), elements, type),

(select 'urn:invoice.hr:ubl-2.0-customizations:SimpleInvoice'
for xml raw (''), root('CustomizationID'), elements, type)
for xml raw (''), root ('Invoice'), elements, type
) ) as sxml

/*
I GOT:

<Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:inv="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cec="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
<UBLExtensions xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:inv="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cec="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
<UBLExtension>
<ID>IDTEXT</ID>
<Name>InvoiceIssuePlaceData</Name>
<ExtensionAgencyID>xx</ExtensionAgencyID>
<ExtensionAgencyName>yy</ExtensionAgencyName>
<ExtensionAgencyURI>urn:invoice:hr:issueplace</ExtensionAgencyURI>
<ExtensionAgencyURI>xxxxx</ExtensionAgencyURI>
<ExtensionReasonCode>MandatoryField</ExtensionReasonCode>
<ExtensionReason>text</ExtensionReason>
<ExtensionContent>yyyyy</ExtensionContent>
</UBLExtension>
</UBLExtensions>
<UBLVersionID xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:inv="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cec="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">2.0</UBLVersionID>
<CustomizationID xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:inv="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cec="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">urn:invoice.hr:ubl-2.0-customizations:SimpleInvoice</CustomizationID>
</Invoice>

I NEED :

<inv:Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns:inv="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns:cec="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">

<cec:UBLExtensions>
<cec:UBLExtension>
<cbc:ID>IDTEXT</cbc:ID>
<cbc:Name>InvoiceIssuePlaceData</cbc:Name>
<cec:ExtensionAgencyID>xx</cec:ExtensionAgencyID>
<cec:ExtensionAgencyName>yy</cec:ExtensionAgencyName>
<cec:ExtensionAgencyURI>zz</cec:ExtensionAgencyURI>
<cec:ExtensionURI>urn:invoice:hr:issueplace</cec:ExtensionURI>
<cec:ExtensionReasonCode>MandatoryField</cec:ExtensionReasonCode>
<cec:ExtensionReason>text</cec:ExtensionReason>
<cec:ExtensionContent>
<ihi:IssuePlace xmlns:ihi="urn:invoice:hr:issueplace">Varadin</ihi:IssuePlace>
</cec:ExtensionContent>
</cec:UBLExtension>
</cec:UBLExtensions>
<cbc:UBLVersionID>2.0</cbc:UBLVersionID>
<cbc:CustomizationID>urn:invoice.hr:ubl-2.0-customizations:SimpleInvoice</cbc:CustomizationID>
</Invoice>


*/
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000