Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
Web Services, XML
Generare xsd da un file xml
venerdì 18 settembre 2009 - 10.13
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
sirousblack
Profilo
| Newbie
1
messaggi | Data Invio:
ven 18 set 2009 - 10:13
Buongiorno ragazzi, sono nuovo all'uso dell'xml ed ho la necessità di creare un ssis su visual studio 2005 che mi permetta innanzitutto di importare un file xml tramite un flusso dati la cui fonte sara' ovviamente un "origine xml". E qui subito si presenta il problema perche' io ho a disposizione solamente il file xml mentre nelle proprieta' dell'l'origine xml viene richiesto il percorso del file xml e va bene, poi se e' un file xml con struttura inline sarei a posto ma non lo e', quindi sono obbligato a specificare anche il percorso del file struttura xsd che non ho. Ho provato a ricavarlo dal file xml ma senza successo perche' poi quando provo ad usarlo mi ritorna svariati errori di formattazione. QUesto e' un esempio di file xml che devo importare:
<?xml version="1.0" ?>
- <OrderResponse>
- <OrderResponseHead>
- <Schema>
<Version>3.04</Version>
</Schema>
- <Parameters>
<Language>en-GB</Language>
<DecimalSeparator>.</DecimalSeparator>
<Precision>20.2</Precision>
</Parameters>
<OrderResponseType Code="ACK">Full Acknowledgement</OrderResponseType>
- <OrderCurrency>
<Currency Code="EUR">Euros</Currency>
</OrderCurrency>
<Checksum />
</OrderResponseHead>
- <OrderResponseReferences>
<BuyersOrderNumber Preserve="true">A_2000 000001</BuyersOrderNumber>
<SuppliersOrderReference Preserve="true">3500000</SuppliersOrderReference>
<CrossReference>029</CrossReference>
</OrderResponseReferences>
- <BOSS:AdditionalOrderResponseReferences xmlns:BOSS="urn:schemas-bossfed-co-uk:OP-OrderResponse-v1">
- <BOSS:OrderResponseReference ReferenceType="OTP" ReferenceDesc="Order Type">
<BOSS:Reference>D</BOSS:Reference>
</BOSS:OrderResponseReference>
</BOSS:AdditionalOrderResponseReferences>
<OrderResponseDate>2009-01-01</OrderResponseDate>
<OriginalOrderDate>2009-01-01</OriginalOrderDate>
- <Supplier>
- <SupplierReferences>
<BuyersCodeForSupplier>.</BuyersCodeForSupplier>
</SupplierReferences>
<Party>.</Party>
</Supplier>
- <Buyer>
- <BuyerReferences>
<SuppliersCodeForBuyer>IT5000000IT</SuppliersCodeForBuyer>
</BuyerReferences>
<Party>Azienda Srl</Party>
- <Address>
<AddressLine>VIA Industriale 7</AddressLine>
<AddressLine>.</AddressLine>
<AddressLine>FI</AddressLine>
<AddressLine>FIRENZE</AddressLine>
<PostCode>50100</PostCode>
</Address>
</Buyer>
- <Delivery>
- <DeliverTo>
<Party>Azienda Srl</Party>
- <Address>
<AddressLine>VIA Industriale 8</AddressLine>
<AddressLine>.</AddressLine>
<AddressLine>FI</AddressLine>
<AddressLine>Firenze</AddressLine>
<PostCode>50100</PostCode>
</Address>
</DeliverTo>
- <DeliverFrom>
- <DeliverFromReferences>
<SuppliersCodeForLocation>P00</SuppliersCodeForLocation>
</DeliverFromReferences>
<Party>.</Party>
</DeliverFrom>
<SpecialInstructions>OP=N</SpecialInstructions>
</Delivery>
- <OrderResponseLine>
<LineNumber>1</LineNumber>
- <Product>
<SuppliersProductCode>600000</SuppliersProductCode>
</Product>
- <Quantity>
<Amount>1</Amount>
</Quantity>
<LineTotal>10.10</LineTotal>
- <Delivery>
- <Quantity>
<Amount>1</Amount>
</Quantity>
<DeliveryInformation>LS</DeliveryInformation>
</Delivery>
- <Delivery>
- <Quantity>
<Amount>0</Amount>
</Quantity>
<DeliveryInformation>LB</DeliveryInformation>
</Delivery>
<Narrative />
</OrderResponseLine>
- <OrderResponseLine>
<LineNumber>2</LineNumber>
- <Product>
<SuppliersProductCode>090000</SuppliersProductCode>
</Product>
- <Quantity>
<Amount>5</Amount>
</Quantity>
<LineTotal>50.10</LineTotal>
- <Delivery>
- <Quantity>
<Amount>5</Amount>
</Quantity>
<DeliveryInformation>LS</DeliveryInformation>
</Delivery>
- <Delivery>
- <Quantity>
<Amount>0</Amount>
</Quantity>
<DeliveryInformation>LB</DeliveryInformation>
</Delivery>
<Narrative />
</OrderResponseLine>
- <OrderResponseLine>
<LineNumber>3</LineNumber>
- <Product>
<SuppliersProductCode>370000</SuppliersProductCode>
</Product>
- <Quantity>
<Amount>24</Amount>
</Quantity>
<LineTotal>40.40</LineTotal>
- <Delivery>
- <Quantity>
<Amount>24</Amount>
</Quantity>
<DeliveryInformation>LS</DeliveryInformation>
</Delivery>
- <Delivery>
- <Quantity>
<Amount>0</Amount>
</Quantity>
<DeliveryInformation>LB</DeliveryInformation>
</Delivery>
<Narrative />
</OrderResponseLine>
- <OrderResponseTotal>
<FreightCharges>0.00</FreightCharges>
<MiscCharges>0.00</MiscCharges>
</OrderResponseTotal>
</OrderResponse>
Datemi una dritta perche' sono nel buio totale.
alx_81
Profilo
| Guru
8.814
messaggi | Data Invio:
dom 20 set 2009 - 18:34
>Buongiorno ragazzi
Ciao
>Datemi una dritta perche' sono nel buio totale.
Il file xsd lo puoi creare da Visual Studio. Carica il file XML e poi nella voce XML, appunto, clicka su Generate XSD Schema.. o qualcosa di simile
Questo crea da un XML well formed il suo xsd o meglio, il più vicino, che tu puoi dettagliare ulteriormente, se ritieni necessario.
--
Alessandro Alpi | SQL Server MVP
http://www.alessandroalpi.net
http://blogs.dotnethell.it/suxstellino
http://mvp.support.microsoft.com/profile/Alessandro.Alpi
http://italy.mvps.org
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !