|
Hi there,
I have a one big prob.
I want to generate xml file with a specific format Like this syntax!:
<declarationrelevededuction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<identifiantfiscal>1088081
<annee>2016
<periode>8
<regime>1
<relevedeductions>
<rd>
<ord>1
<num>FF160400146
<des>PRESTATION
<mht>2400.00
<tva>480.00
<ttc>2880.00
<reff>
<if>52803595
<nom>LEADER SOFT
<ice>001540114000046
<tx>20.00
<mp>
<id>2
<dpai>2016-08-01
<dfac>2016-01-30
<rd>
<ord>2
<num>FF160400147
<des>PRESTATION
<mht>1500.00
<tva>300.00
<ttc>1800.00
<reff>
<if>52803595
<nom>LEADER SOFT
<ice>001540114000046
<tx>20.00
<mp>
So, I've created form with button to generate the xml files and I created this code for That:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim xmlsetting As New XmlWriterSettings
'xmlsetting.ConformanceLevel = ConformanceLevel.Document
'xmlsetting.OmitXmlDeclaration = True
Dim writxml As XmlWriter = XmlWriter.Create("mytest.xml", xmlsetting)
Try
With writxml
.WriteStartDocument()
.WriteStartElement("DeclarationReleveDeduction")
.WriteStartElement("identifiantFiscal")
.WriteString("111111")
.WriteEndElement()
.WriteStartElement("annee")
.WriteString("2016")
.WriteEndElement()
.WriteStartElement("periode")
.WriteString("8")
.WriteEndElement()
.WriteStartElement("regime")
.WriteString("1")
.WriteEndElement()
.WriteStartElement("Relvededution")
For i As Integer = 1 To 10
.WriteStartElement("Id")
.WriteString(i)
.WriteStartElement("Nom")
.WriteString("Nom " & i)
.WriteEndElement()
.WriteStartElement("prenom")
.WriteString("Prenom " & i)
.WriteEndElement()
.WriteStartElement("Adresse")
.WriteString("Adresse " & i)
.WriteEndElement()
.WriteEndElement()
Next
.WriteEndElement()
.WriteEndElement()
.WriteEndDocument()
.Close()
End With
MsgBox("fichier a été généré avec succès", vbInformation)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
when I generated the xml file I have got like this format:
<declarationrelevededuction><identifiantfiscal>111111<annee>2016<periode>8<regime>1<relvededution><id>1<nom>Nom 1<prenom>Prenom 1<adresse>Adresse 1<id>2<nom>Nom 2<prenom>Prenom 2<adresse>Adresse 2<id>3<nom>Nom 3<prenom>Prenom 3<adresse>Adresse 3<id>4<nom>Nom 4<prenom>Prenom 4<adresse>Adresse 4<id>5<nom>Nom 5<prenom>Prenom 5<adresse>Adresse 5<id>6<nom>Nom 6<prenom>Prenom 6<adresse>Adresse 6<id>7<nom>Nom 7<prenom>Prenom 7<adresse>Adresse 7<id>8<nom>Nom 8<prenom>Prenom 8<adresse>Adresse 8<id>9<nom>Nom 9<prenom>Prenom 9<adresse>Adresse 9<id>10<nom>Nom 10<prenom>Prenom 10<adresse>Adresse 10
Please help me I need to do that in this days of current month Cry | Confused |
|
|
|
|
|
|
<xsl:attribute name="name">Insured1BirthDate</xsl:attribute>
<xsl:if test="function-available('ExFunctions:FormatDate')">
<xsl:value-of select="ExFunctions:FormatDate(X-pathh,'mm/dd/yyyy')"/>
</xsl:if>
|
|
|
|
|
You forgot to ask a question.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Help me read value in note <Code>, <Message>, <Time>
string result = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>
<string xmlns=\"http://tempuri.org/\">
<AAA>
<Code>5</Code>
<Message>Send MT Error!.</Message>
<Time></Time>
</AAA>
</string>"
XmlReader xReader = XmlReader.Create(new StringReader(result));
while (xReader.Read())
{
??????????????
}
Thanks so much!
^_^_^
modified 26-Aug-17 0:24am.
|
|
|
|
|
|
|
I am getting this message when I try to validate my xml document: 13:2 The markup in the document following the root element must be well-formed. Every time when I try to fix line 13, I get the same error message.
="1.0"
<registration_form>
<name>Digestive and Endoscopy Medical Office MD</name>
<register>patient information</register>
<patient>Arijit Singh</patient>
<status>Single</status>
<birthdate>10/20/1987</birthdate>
<age>27</age>
<address>6216 GreatWater Dr, Windermer, FL 34786</address>
<home>(407)-987-2525</home>
<cell>(407)-288-9331</cell>
</registration_form>
<patient employment>
<employer <information>Orlando Home Team</employer>
<occupation>Real Estate Agent</occupation>
<address>1300 e Michigan St, Orlando, FL 32812</address>
<employer>(407)-885-3539</employer>
<patient employment>
<Insurance_Information>
<subscriber>Arijit Singh</subscriber>
<subscriber's S.S.>789-53-3407</subscriber's S.S.>
<group>DC2630</group>
<co-payment>$50</co-payment>
</Insurance_Information>
<In Case of Emergency>
<name>Zina Kaur</name>
<relationship>fiancee</relationship>
<authorization>Arijit Singh</authorization>
</In Case of Emergency>
|
|
|
|
|
See wikipedia: XML - Wikipedia, the free encyclopedia[^]
Quote: Tag names cannot contain any of the characters !"#$%&'()*+,/;<=>?@[\]^`{|}~, nor a space character, and cannot begin with "-", ".", or a numeric digit.
<patient employment> Contains a space.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I tried to write the code just like that <patient employment=""> and this <patient_employment> and <patientemployment> and I still get an error message.
|
|
|
|
|
I tried that but it did not work and I tried <patient_employment> and I tried <patientemployment> and I still got an error.
|
|
|
|
|
And did you take a good look at the line below that as well?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Yes I did. But I still did not find any solutions to the error.
|
|
|
|
|
And what did you see?
I'll give you a clue:
<employer <information>Orlando Home Team</employer>
What is that? Does it look well formed to you?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
no, that does not look correct. This is how I wrote the code
<employerinformation>Orlando Home Team></employerinfomation>
|
|
|
|
|
And that doesn't look right either...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
To this point I do not know what I am doing wrong. could you just please point out what I am doing wrong and how to fix it. I have been working on this for three days and I still could not figure it out.
|
|
|
|
|
Well, you could try:
="1.0"="utf-8"
<root>
<registration_form>
<name>Digestive and Endoscopy Medical Office MD</name>
<register>patient information</register>
<patient>Arijit Singh</patient>
<status>Single</status>
<birthdate>10/20/1987</birthdate>
<age>27</age>
<address>6216 GreatWater Dr, Windermer, FL 34786</address>
<home>(407)-987-2525</home>
<cell>(407)-288-9331</cell>
</registration_form>
<patient_employment>
<employer_information>Orlando Home Team</employer_information>
<occupation>Real Estate Agent</occupation>
<address>1300 e Michigan St, Orlando, FL 32812</address>
<employer>(407)-885-3539</employer>
<patient_employment>
<Insurance_Information>
<subscriber>Arijit Singh</subscriber>
<subscribers_SS>789-53-3407</subscribers_SS>
<group>DC2630</group>
<co-payment>$50</co-payment>
</Insurance_Information>
<In_Case_of_Emergency>
<name>Zina Kaur</name>
<relationship>fiancee</relationship>
<authorization>Arijit Singh</authorization>
</In_Case_of_Emergency>
</root>
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thank you so much, I will try it and see if it will work.
|
|
|
|
|
I tried it, but it did not validate it.
|
|
|
|
|
What are you using to validate it?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I am using a website called xmlvalidation.com
|
|
|
|
|
This passes for me:
="1.0"="utf-8"
<root>
<registration_form>
<name>Digestive and Endoscopy Medical Office MD</name>
<register>patient information</register>
<patient>Arijit Singh</patient>
<status>Single</status>
<birthdate>10/20/1987</birthdate>
<age>27</age>
<address>6216 GreatWater Dr, Windermer, FL 34786</address>
<home>(407)-987-2525</home>
<cell>(407)-288-9331</cell>
</registration_form>
<patient_employment>
<employer_information>Orlando Home Team</employer_information>
<occupation>Real Estate Agent</occupation>
<address>1300 e Michigan St, Orlando, FL 32812</address>
<employer>(407)-885-3539</employer>
</patient_employment>
<Insurance_Information>
<subscriber>Arijit Singh</subscriber>
<subscribers_SS>789-53-3407</subscribers_SS>
<group>DC2630</group>
<co-payment>$50</co-payment>
</Insurance_Information>
<In_Case_of_Emergency>
<name>Zina Kaur</name>
<relationship>fiancee</relationship>
<authorization>Arijit Singh</authorization>
</In_Case_of_Emergency>
</root>
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thank you, thank you, thank you so very very much. It finally worked. Oh my gosh I have been stressing out with this code for so many days. I am very grateful that you took the time out to help me in every way possible.
|
|
|
|
|
You're welcome!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|