Hello there I am new to XML and I am having a problem with xmlns="" showing up in my elements when I trying to produce a report in XML from VB6.
Code Example
The header part of this produced using a method called Load Header
This part is fine but the following part where an element is produced on the report is giving me a problem:
This part is produced in a method called loadDetails
Also later on the report I am getting an output like
How is this extra bit appearing in the FAMILY element and this is created in the same way as <POSTAL_ADDRESS>
Also other elements are producing output like
I sureif I can understand where this extra bit of info comes from and how to get rid of it in one i should be able to do the same for the rest but at the moment I so totally confused where all this extra output in the ELEMENT NAMES are coming from.
Hopefully someone can help me.
Thanks
Code Example
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<MESSAGE xmlns="http://tempuri.org/XMLSchema.xsd" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tempuri.org/XMLSchema.xsd C:\projects\report\EDU-KIT\Docs\report_osad_edu.xsd">
Code:
Set pi = oXMLDoc.createProcessingInstruction("xml", "version=""1.0"" encoding=""ISO-8859-1""")
Set eMessage = oXMLDoc.createElement("MESSAGE")
oXMLDoc.appendChild eMessage
Set aXmlns = oXMLDoc.createAttribute("xmlns")
eMessage.setAttribute "xmlns", "http://tempuri.org/XMLSchema.xsd"
Set aXmlns_Data = oXMLDoc.createAttribute("xmlns:msdata")
eMessage.setAttribute "xmlns:msdata", "urn:schemas-microsoft-com:xml-msdata"
Set aXmlns_Xsi = oXMLDoc.createAttribute("xmlns:xsi")
eMessage.setAttribute "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"
Set xsiSchema = oXMLDoc.createAttribute("xsiSchema")
eMessage.setAttribute "xsi:schemaLocation", "http://tempuri.org/XMLSchema.xsd C:\projects\report\EDU-KIT\Docs\report_osad_edu.xsd"
Code:
<DETAILS xmlns="">
<FIRSTNAME>John</FIRSTNAME>
<SURNAME>Carpenter</SURNAME>
</DETAILS>
<POSTAL_ADDRESS xmlns="">
<ADDRESS1>12 EAST PARK</ADDRESS>
<ADDRESS2>NEW STREET</ADDRESS2>
</POSTAL_ADDRESS>
Code:
Set eDetails = oXMLDoc.createElement("DETAILS")
eMessage.appendChild eDetails
Set eFirstName = oXMLDoc.createElement("FIRSTNAME")
eDetails.appendChild eSchoolName
Set eSurname = oXMLDoc.createElement("SURNAME")
eDetails.appendChild eSchoolName
etc..
Also later on the report I am getting an output like
Code:
<FAMILY xmlns:dt="urn:schema-microsoft-com:datatypes" DT:dt="String">
Also other elements are producing output like
Code:
<SON>
<SON_FIRST_NAME dt:dt="String">Mark</SON_FIRST_NAME>.
I sureif I can understand where this extra bit of info comes from and how to get rid of it in one i should be able to do the same for the rest but at the moment I so totally confused where all this extra output in the ELEMENT NAMES are coming from.
Hopefully someone can help me.
Thanks
Last edited by a moderator: