Model, validate, transform, and exchange structured data. Learn XML schemas, XPath, XSLT, DOM vs SAX, serialization, namespaces, and integration patterns for configuration, messaging, and document workflows across platforms.
276 posts160 contributors
How can we sanitize an XML or SVG file when it is 10 GB in size and uploaded through TUS multipart with multiple concurrent users? The file must be uploaded to S3
Hello, i want to validate by xsd an attribute can contain a float type or a word "exist". after search in the net i found this solution(w3schools.com/xml/schema_facets.asp) but it does not worked when i add this pattern: <xs:restriction base="xs:Double"> <xs:pattern value="[0-9]| 'exist'"/> </xs:restriction> how to fix that ?
I have been using the code example here for creating-excel-file-using-openxml this is simple enough code and it does work nicely i can send my data and save it as an .xlsx file. However when i open the file it is corrupted and needs to be opend as repaired. when i do open it all the data is there the formatting/styles are nissing but all the data is there. looking at the log file i see this <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <recoveryLog xmlns="------schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error290880_01.xml</logFileName><summary>Errors were detected in file 'D:\M36_Results_22_04_2024 2_46_34 PM.xlsx'</summary><repairedRecords><repairedRecord>Repaired Records: Format from /xl/styles.xml part (Styles)</repairedRecord><repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet1.xml part</repairedRecord></repairedRecords></recoveryLog> any help appreciated. i am new to openXML
hi, i have been using jquery to get data from database using controllers and then use looping or if then else of javascript and css. to transform the html. need to know where practically xslt can help?( basically i do not want to add extra technologies) yours sincerly
Someone can help me, I had in a XMLDocument variable the following: <autorizaciones><autorizacion><estado>aaa</estado><numeroAutorizacion>2011202</numeroAutorizacion><fechaAutorizacion>2023-11-20T10:30:14-05:00</fechaAutorizacion><ambiente>prueba</ambiente><comprobante><?xml version="1.0" encoding="UTF-8"?> <factura id="comprobante" version="1.0.0"> <infoTributaria> <ambiente>2</ambiente> <tipoEmision>1</tipoEmision> <razonSocial>EMPRESA</razonSocial> <nombreComercial>EMPRESA</nombreComercial> <ruc>0993222011001</ruc> <claveAcceso>2011202</claveAcceso> <codDoc>01</codDoc> <estab>001</estab> <ptoEmi>002</ptoEmi> <secuencial>000107272</secuencial> <dirMatriz>AV 25 DE Y 8 VO CLLJN</dirMatriz> </infoTributaria></comprobante><mensajes /></autorizacion></autorizaciones> I want to save to a file in the following format: <autorizaciones><autorizacion><estado>aaa</estado><numeroAutorizacion>2011202</numeroAutorizacion><fechaAutorizacion>2023-11-20T10:30:14-05:00</fechaAutorizacion><ambiente>prueba</ambiente><comprobante><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <factura id="comprobante" version="1.0.0"> <infoTributaria> <ambiente&g
I want fill dependent dropdown by XML file which be create(data by sql server) on session intialization.
Hi, I am have below input xml, I want to remove special characters from all nodes through xslt, please help me <?xml version="1.0" encoding="UTF-8"?> <data> <row id="tE9BC880F01DC4A7CA1B261A3BF04DBE8"> <Title>Notice</Title> <Name>Abhi</Name> <Address>Janpath-Building 1 & 2, near Western Court, Janpath, New Delhi, Delhi-110001</Address> <Phone>98765-43210</Phone> </row> <row id="tE9BC880F01DC4A7CA1B261A3BF04DBE8"> <Title>CancellationNotice</Title> <Name>O'Niel</Name> <Address>C-56, G Block BKC, Bandra Kurla Complex, Bandra East, Mumbai, Maharashtra 400098</Address> <Phone>98765-11221</Phone> </row> </data>
Hi I have an issue while convert data table into XML Error: Cannot serialize the DataTable. DataTable name is not set. What I have tried : Public Function ConvertDatatableToXML(ByVal dt As DataTable) As String Dim str As MemoryStream = New MemoryStream() dt.WriteXml(str, True) str.Seek(0, SeekOrigin.Begin) Dim sr As StreamReader = New StreamReader(str) Dim xmlstr As String xmlstr = sr.ReadToEnd() Return (xmlstr) End Function Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click Dim dt As DataTable = New DataTable() dt = GetData() Dim XMLstring As String = clsAPI.ConvertDatatableToXML(dt) Me.txtComments.Text = XMLstring End Sub Public Function GetData() As DataTable Dim dt As New DataTable Dim adp As New SqlDataAdapter("usp_TR_Data", conn) adp.SelectCommand.CommandType = CommandType.StoredProcedure adp.SelectCommand.CommandTimeout = 150 With adp.SelectCommand.Parameters .Clear() .Add("@Action", SqlDbType.NVarChar).Value = "CONVERT-XML" .Add("@SONo", SqlDbType.NVarChar).Value = Me.txtSONo.Text End With adp.Fil
Firstly, im vrey very new to xml and schemas, so apologies if this question is brutally basic. I have created a schema, and am importing another schema that contains a complex type. I am getting the error "type http://myNamespace2.com/songSchema is not declared" I have followed a number of tutorials and cant see where i have gone wrong. can anyone advise? Here is the main schema. The second schema is the one i am importing. Thanks all. <?xml version="1.0" encoding="utf-8"?> <xs:schema id="XMLSchema1" targetNamespace="http://myNamespace1.com/XMLSchema1" elementFormDefault="qualified" xmlns="http://myNamespace1.com/XMLSchema1" xmlns:mstns="http://myNamespace1.com/XMLSchema1" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sn="http://myNamespace2.com/songSchema"> <xs:import namespace="http://myNamespace2.com/songSchema" schemaLocation="C:\Development_Projects\XMLReaderWriter\XMLReaderWriter\XMLReaderWriter\songSchema.xsd"/> <xs:element name="Record"> <xs:complexType> <xs:sequence> <xs:element name="RecordType" type="xs:string"/> <xs:element name="Artist" type ="xs:string"/> <xs:element name="NumSongs" type ="xs:int"/> <xs:element name="SongDetails" type="sn:Song"/> <!--ERROR OCCURS HERE--> </xs:sequence> </xs:complexType>
Hello! in C# - how can i use a variable in this SelectSingleNode statement? assuming fieldId is a var or string. XmlElement elt = xml.SelectSingleNode(String.Format("responses/response/fieldset/field[@id={0}']", fieldId)) as XmlElement; thanks!