Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Script Library
 sql 2008 and XML

Author  Topic 

thampl
Starting Member

2 Posts

Posted - 2010-06-01 : 11:34:25
I just can not get the part that is commented.
Please help :)

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



/*

<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>


*/

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-06-01 : 14:48:28
Please do not cross post:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=145410
Go to Top of Page
   

- Advertisement -