Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to scan each line from TAG Etiquetas
Message
De
29/09/2022 14:25:38
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
 
 
À
29/09/2022 02:47:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01684999
Message ID:
01685009
Vues:
39
>Hello community,
>
>I'm trying to import an XML file into a document, however I have a problem when I get to TAG tags because I can't create a line for each record in my XML file, which in practice is 6 Lines.
>The script imports the contents of the tags from line #1 6 times instead of inserting values for each line.
>
> [...]
>
>I attach my code and the small XML file so you can help me.
>

Luís,

Once you get each of the "Etiquetas" as ONODE in the ONODELIST collection, you use the ONODE to refer to its contents. Please also note that "tiporequisicao" should be treated as the other components of the "Etiquetas" object. As you wrote it, all "Etiquetas" will share the same "tiporequisicao", no matter what.
		m.tiporequisicao = m.OROOT.selectNodes("Documento/Linhas/Etiquetas/tiporequisicao").Item(0).Text

		** READ LIST OF ETIQUETAS
		m.ONODELIST = M.OROOT.selectNodes("Documento/Linhas/Etiquetas")

		For Each ONODE As 'MSXML2.IXMLDOMNode' In M.ONODELIST

			m.qttetiqueta = m.ONODE.selectNodes("quantidaderequerida").Item(0).Text
			If Val(m.qttetiqueta) <> 0

				m.qttetiqueta = m.ONODE.selectNodes("quantidaderequerida").Item(0).Text
				m.dedata  = m.ONODE.selectNodes("datarequeridainicial").Item(0).Text
				m.atedata  = m.ONODE.selectNodes("datarequeridafinal").Item(0).Text

                  *!* Date conversion
				m.dedata = Ctod(Substr(m.dedata,7,2)+'.'+Substr(m.dedata,5,2)+'.'+Substr(m.dedata,1,4))
				m.atedata = Ctod(Substr(m.atedata ,7,2)+'.'+Substr(m.atedata ,5,2)+'.'+Substr(m.atedata,1,4))

			Endif

			** Percorre a lista de OrderItems

			** note: but what about when Val(m.qttetiqueta) == 0 ?

			Select mbicursor
			Append Blank

			** [snip]

			Do u_bottdeb With 'mbicursor'

		Endfor
Hello António,

Many thanks for your reply and explanation.
In case where : ** note: but what about when Val(m.qttetiqueta) == 0 ? , will go to put and IF condition to not import the line.

Best Regards,
Luis Santos
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform