>Local msel as string >store '' to msel > > >Text to msel textmerge noshow pretext 7 > select ftstamp,fdata,nmdoc, fno from ft where ftstamp = ?ft.ftstamp >Endtext >u_sqlexec(msel,[Documento]) > > >Text to msel textmerge noshow pretext 7 > select fno,ref,design, qtt, epv > from fi where ftstamp = ?ft.ftstamp > Order by lordem asc >Endtext >u_sqlexec(msel,[Linhas]) > >Text to msel textmerge noshow pretext 7 > select fno, tabiva, iva > from fi where ftstamp = ?ft.ftstamp > and fi.fno = ?Linhas.fno > Order by lordem asc >Endtext >u_sqlexec(msel,[TaxasIVA]) > > > >SELECT LINHAS >INDEX ON fno TAG LINHAS >SELECT TaxasIVA >INDEX ON fno TAG TaxasIVA >select DOCUMENTO >SET RELATION TO fno INTO LINHAS >SET RELATION TO fno INTO TaxasIVA in 'LINHAS' ADDITIVE > > >LOCAL oAdapter as XMLAdapter >oAdapter = CREATEOBJECT('xmlAdapter') >oAdapter.RespectNesting = .t. >oAdapter.XMLName=STRCONV("VFPDATASET",12) && default "VFPDataSet" >oAdapter.AddTableSchema('Documento') >oAdapter.AddTableSchema('Linhas') >oAdapter.AddTableSchema('TaxasIVA') > > >lcXMLFileName = sys(2015)+'.xml' >lcXSDFileName = forceext(m.lcXMLFileName,'xsd') > >* Uncomment to write schema separately to an external file >oAdapter.XMLSchemaLocation = m.lcXSDFileName >oAdapter.ToXML(m.lcXMLFileName,'',.T.) && to file >*oAdapter.ToXML('cXMLSampleData','',.f.) && to memvar > >* Check what is generated >modi comm (m.lcXMLFileName) >modi comm (m.lcXSDFileName) >*erase (juststem(m.lcXMLFileName)+'.*') > >>
><?xml version = "1.0" encoding="Windows-1252" standalone="yes"?> ><VFPDATASET xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\PHC23\_5AI1D8LPP.xsd"> > <Documento> > <ftstamp>ADM18090382517,515788064</ftstamp> > <fdata>2018-09-03T00:00:00</fdata> > <nmdoc>Fatura Recibo</nmdoc> > <fno>11</fno> > <Linhas> > <fno>11</fno> && need to remove here > <ref>C001</ref> > <design>Caixa e tamboril</design> > <qtt>1.000</qtt> > <epv>100.000000</epv> > <lordem>10000</lordem> > <TaxasIVA> > <fno>11</fno> && need to remove here > <tabiva>4</tabiva> > <iva>.00</iva> > </TaxasIVA> > </Linhas> > <Linhas> > <fno>11</fno> && need to remove here > <ref>TAXFREE</ref> > <design>TAXFREE</design> > <qtt>1.000</qtt> > <epv>23.000000</epv> > <lordem>20000</lordem> > <TaxasIVA> > <fno>11</fno> && need to remove here > <tabiva>4</tabiva> > <iva>.00</iva> > </TaxasIVA> > </Linhas> > </Documento> ></VFPDATASET> >