"Rohit Wason" <rohitw@futuresoftindia.com> wrote:
>
>"dumm" <pontolan@hotmail.com> wrote:
>>
>>Hi,
>>Need some hints on creating xml file in VB 6.
>>
>>Examples? Hints?

>XML can be created by any **** source - SQL, VB, ASP, C, C++ any thing you
>can imagine. XML is a "general" form text written in some hierarchical manner
>eg:
>
><Persons>
> <Person>
> <Name>Rohit</Name>
> <Age>23</Age>
> </Person>
> <Person>
> <Name>Shubo</Name>
> <Age>123</Age>
> </Person>
> <Person>
> <Name>dumm</Name>
> <Age>??</Age>
> </Person>
></Persons>
>
>The data above represents a few records of persons.
>This can be read from any source (SQL/Oracle or whatever) and written using
>VB/VC/ASP/ or whatever.
>
>In VB for instance, we can write:
>Print #1, "<Persons>" + vbCRLF & _
>" <Person>" + vbCRLF & _
>" <Name>Rohit</Name>" + vbCRLF & _
>" <Age>23</Age>" + vbCRLF & _
>" </Person>" + vbCRLF & _
>" <Person>" + vbCRLF & _
>" <Name>Shubo</Name>" + vbCRLF & _
>" <Age>123</Age>" + vbCRLF & _
>" </Person>" + vbCRLF & _
>" <Person>" + vbCRLF & _
>" <Name>dumm</Name>" + vbCRLF & _
>" <Age>??</Age>" + vbCRLF & _
>" </Person>" + vbCRLF & _
>"</Persons>"
>
>Okay?

--------------------
I know this way man! But the problem is that your code is not general. What
if we are taking data from a database and we don't really know the field
names(we are using field names as elements)?

Another thing is that your data may contain some special characters ("/",
"<", ">", "&", etc.) and in this case your output XML may not be well-formed!!!

I am writing VB code to export a finacial report in XML, please give me your
advice.

Thanks

~Cuong