Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to scan each line from TAG Etiquetas
Message
From
29/09/2022 02:47:17
Antonio Lopes (Online)
BookMARC
Coimbra, Portugal
 
 
To
27/09/2022 07:20:15
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01684999
Message ID:
01685006
Views:
54
>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
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform