From 33a5d0760cfdfb20287c4972d09bc5cbd271b9a1 Mon Sep 17 00:00:00 2001 From: Hakan Kutluay Date: Sun, 19 Apr 2020 21:04:42 +0300 Subject: [PATCH 1/2] Update README.md Change for UblTrNamespaces --- README.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/README.md b/README.md index 31cce4c..981c8d3 100644 --- a/README.md +++ b/README.md @@ -20,21 +20,9 @@ invoice.ProfileID = new Common.ProfileIDType() { Value = "TEMELFATURA" }; invoice.ID = new Common.IDType() { Value = "INV20200000000001" }; invoice.CopyIndicator = new Common.CopyIndicatorType() { Value = false }; -var namespaces = new XmlSerializerNamespaces(); -namespaces.Add("cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"); -namespaces.Add("cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"); -namespaces.Add("ccts", "urn:un:unece:uncefact:documentation:2"); -namespaces.Add("ds", "http://www.w3.org/2000/09/xmldsig#"); -namespaces.Add("ext", "urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"); -namespaces.Add("ubltr", "urn:oasis:names:specification:ubl:schema:xsd:TurkishCustomizationExtensionComponents"); -namespaces.Add("qdt", "urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2"); -namespaces.Add("udt", "urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2"); -namespaces.Add("xades", "http://uri.etsi.org/01903/v1.3.2#"); -namespaces.Add("xsi", "http://www.w3.org/2001/XMLSchema-instance"); - XmlSerializer xmlSerializer = new XmlSerializer(typeof(InvoiceType)); TextWriter writer = new StreamWriter(@"C:\Temp\TestInvoice.xml"); //path to document -xmlSerializer.Serialize(writer, invoice, namespaces); +xmlSerializer.Serialize(writer, invoice, new UblTrNamespaces()); ``` From 92c0fc4814c319839d703d7eb3a867846afd2c88 Mon Sep 17 00:00:00 2001 From: Hakan Kutluay Date: Sun, 19 Apr 2020 21:09:13 +0300 Subject: [PATCH 2/2] Update README.md --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 981c8d3..6e624bf 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,15 @@ PM> Install-Package UblTr ## Serialize ```csharp -var invoice = new InvoiceType(); -invoice.UUID = new Common.UUIDType() { Value = Guid.NewGuid().ToString() }; -invoice.UBLVersionID = new Common.UBLVersionIDType() { Value = "2.1" }; -invoice.CustomizationID = new Common.CustomizationIDType() { Value = "TR1.2" }; -invoice.ProfileID = new Common.ProfileIDType() { Value = "TEMELFATURA" }; -invoice.ID = new Common.IDType() { Value = "INV20200000000001" }; -invoice.CopyIndicator = new Common.CopyIndicatorType() { Value = false }; +var invoice = new InvoiceType +{ + UUID = new Common.UUIDType() { Value = Guid.NewGuid().ToString() }, + UBLVersionID = new Common.UBLVersionIDType() { Value = "2.1" }, + CustomizationID = new Common.CustomizationIDType() { Value = "TR1.2" }, + ProfileID = new Common.ProfileIDType() { Value = "TEMELFATURA" }, + ID = new Common.IDType() { Value = "INV20200000000001" }, + CopyIndicator = new Common.CopyIndicatorType() { Value = false } +}; XmlSerializer xmlSerializer = new XmlSerializer(typeof(InvoiceType)); TextWriter writer = new StreamWriter(@"C:\Temp\TestInvoice.xml"); //path to document