<Claim_Input> <Case_Num>1</Case_Num> <Address> <Street>112 Test Road</Street> <City>New York</City> <State>NY</State> </Address> <SomethingElse>3</SomethingElse> </Claim_Input>I've configured my column names like:
Case_Num Address|Street Address|City Address|State SomethingElseI'm trying to devise a function which will parse the address field names into a structure which looks like the above. I'm totally flexible and can rewrite the query to return the column names differently, but this seemed like it would work.
If fields(n).Name = "Address|Street" Then Print #1, "<Address>" Print #1, " <Street>" & rs(fields(n).name) & "</Street> elseif fields(n).name = "Address|City" Then Print #1, " <City>" & rs(fields(n).name) & "</City> Elseif fields(n).name = "Adderss|State" Then Print #1, " <State>" & rs(fields(n).name) & "</State> Print #1, "<Address>" end ifBut I would like to be able to make this more generic so that if I pass a function the values:
Call WriteToXML("Case_Num", 1) Call WriteToXML("Address|Street", "113 Test Road") Call WriteToXML("Address|City", "New York") Call WriteToXML("Address|State", "NY") Call WriteToXML("SomethingElse", 3)it would write to the XML file similar to my code segment. I don't know enough about XML to write my own style sheet. BTW, there will be cases where the data is nested 3 deep.
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
An Experts Exchange subscription includes unlimited access to online courses.Get Started
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE