carlajasminelewis
asked on
How do I format XML returned by a WebService?
So, I wrote a complex little web service in .Net to hook into a PervasiveSQL database. I can call it using a simple POST request in a form on an HTML page. I get back XML data, which is exactly what I expect.
However, I wan't to be able to apply some type of formatting to this returned data and integrate it into my page. A clipping of the returned XML is below. Keep in mind the XML that is returned is the result of a query. Its dynamically generated.
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfIndividual xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://192.168.0.54:7171/employee/bdWeb">
<Individual>
<EmpNo>102</EmpNo>
<Name>Harris, Jill</Name>
<Address>1001 Sunset Boulevard</Address>
<City>Dallas</City>
<State>TX</State>
<Zip>75231</Zip>
<Phone>(214) 555-0121</Phone>
<SocialSecurity>422-05-569 7</SocialS ecurity>
<Sex>F</Sex>
<MaritalStatus>S</MaritalS tatus>
<FilingStatus>1</FilingSta tus>
<EarnedIncomeCredit>0</Ear nedIncomeC redit>
<FederalAllowances>1</Fede ralAllowan ces>
<FederalAdditionalWH>0</Fe deralAddit ionalWH>
<StateReportingState>61</S tateReport ingState>
<StateAllowances>0</StateA llowances>
<StateAdditionalWH>0</Stat eAdditiona lWH>
<DateBirth>19570303</DateB irth>
<DateHire>19900102</DateHi re>
<DateTermination>0</DateTe rmination>
<DateDrugTest>20010112</Da teDrugTest >
<PayDepartment>02</PayDepa rtment>
<PayTitle>Furniture Sales Rep.</PayTitle>
<PayFrequency>W</PayFreque ncy>
<PayType>H</PayType>
<PayAmount>9.75</PayAmount >
</Individual>
<Individual>
<EmpNo>108</EmpNo>
<Name>Nelson, Jay</Name>
<Address>5325 Richmond Avenue</Address>
<City>Dallas</City>
<State>TX</State>
<Zip>75264</Zip>
<Phone>(214) 555-6472</Phone>
<SocialSecurity>353-46-494 3</SocialS ecurity>
<Sex>M</Sex>
<MaritalStatus>S</MaritalS tatus>
<FilingStatus>1</FilingSta tus>
<EarnedIncomeCredit>0</Ear nedIncomeC redit>
<FederalAllowances>0</Fede ralAllowan ces>
<FederalAdditionalWH>0</Fe deralAddit ionalWH>
<StateReportingState>61</S tateReport ingState>
<StateAllowances>0</StateA llowances>
<StateAdditionalWH>0</Stat eAdditiona lWH>
<DateBirth>19500121</DateB irth>
<DateHire>19931015</DateHi re>
<DateTermination>0</DateTe rmination>
<DateDrugTest>20001015</Da teDrugTest >
<PayDepartment>06</PayDepa rtment>
<PayTitle>Driver</PayTitle >
<PayFrequency>W</PayFreque ncy>
<PayType>H</PayType>
<PayAmount>9.5</PayAmount>
</Individual>
</ArrayOfIndividual>
However, I wan't to be able to apply some type of formatting to this returned data and integrate it into my page. A clipping of the returned XML is below. Keep in mind the XML that is returned is the result of a query. Its dynamically generated.
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfIndividual xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://192.168.0.54:7171/employee/bdWeb">
<Individual>
<EmpNo>102</EmpNo>
<Name>Harris, Jill</Name>
<Address>1001 Sunset Boulevard</Address>
<City>Dallas</City>
<State>TX</State>
<Zip>75231</Zip>
<Phone>(214) 555-0121</Phone>
<SocialSecurity>422-05-569
<Sex>F</Sex>
<MaritalStatus>S</MaritalS
<FilingStatus>1</FilingSta
<EarnedIncomeCredit>0</Ear
<FederalAllowances>1</Fede
<FederalAdditionalWH>0</Fe
<StateReportingState>61</S
<StateAllowances>0</StateA
<StateAdditionalWH>0</Stat
<DateBirth>19570303</DateB
<DateHire>19900102</DateHi
<DateTermination>0</DateTe
<DateDrugTest>20010112</Da
<PayDepartment>02</PayDepa
<PayTitle>Furniture Sales Rep.</PayTitle>
<PayFrequency>W</PayFreque
<PayType>H</PayType>
<PayAmount>9.75</PayAmount
</Individual>
<Individual>
<EmpNo>108</EmpNo>
<Name>Nelson, Jay</Name>
<Address>5325 Richmond Avenue</Address>
<City>Dallas</City>
<State>TX</State>
<Zip>75264</Zip>
<Phone>(214) 555-6472</Phone>
<SocialSecurity>353-46-494
<Sex>M</Sex>
<MaritalStatus>S</MaritalS
<FilingStatus>1</FilingSta
<EarnedIncomeCredit>0</Ear
<FederalAllowances>0</Fede
<FederalAdditionalWH>0</Fe
<StateReportingState>61</S
<StateAllowances>0</StateA
<StateAdditionalWH>0</Stat
<DateBirth>19500121</DateB
<DateHire>19931015</DateHi
<DateTermination>0</DateTe
<DateDrugTest>20001015</Da
<PayDepartment>06</PayDepa
<PayTitle>Driver</PayTitle
<PayFrequency>W</PayFreque
<PayType>H</PayType>
<PayAmount>9.5</PayAmount>
</Individual>
</ArrayOfIndividual>
ASKER
>can you be more precise, what do you want to achieve?
Why yes. I click the Submit button on my form. A new page opens that contains XML data. I don't want a page containing XML data. I want an HTML page containg the XML data formatted to a stylesheet. Now, don't get me wrong, I can format XML data right now, with plain CSS or an XSLT. However, that is only if the XML data is already saved as an existing document. Then I can hard code in the document path, blah, blah, blah.
I guess what I want to know is if I send the server a POST query, it send me back what you see above. I can't insert a style reference into the XML document because I don't create it, the server does. I'm kind of lost in knowing what to ask, but here's the options that I see.
I send the query to the server and try to capture the returned XML in an object variable and parse it with java, or php, or perl (of which I have no idea on how to start that either), or what. Is there some other way?
I was tasked with developing a intranet dashboard. I was easily able to write several webservice functions using VisualBasic.Net. I can request the info using a SOAP query(which I have't bothered to figure out how) or an HTTP POST or GET. I opted for the POST. I have several display areas on this intranet dashboard all wanting to display information retrieved by sending queries to this webservice. However, I just don't know how to get the data that is returned back into my page.
Further, I'm not developing the page in VisualStudio.Net for the web interface, I'm using Dreamweaver on a Mac.
Why yes. I click the Submit button on my form. A new page opens that contains XML data. I don't want a page containing XML data. I want an HTML page containg the XML data formatted to a stylesheet. Now, don't get me wrong, I can format XML data right now, with plain CSS or an XSLT. However, that is only if the XML data is already saved as an existing document. Then I can hard code in the document path, blah, blah, blah.
I guess what I want to know is if I send the server a POST query, it send me back what you see above. I can't insert a style reference into the XML document because I don't create it, the server does. I'm kind of lost in knowing what to ask, but here's the options that I see.
I send the query to the server and try to capture the returned XML in an object variable and parse it with java, or php, or perl (of which I have no idea on how to start that either), or what. Is there some other way?
I was tasked with developing a intranet dashboard. I was easily able to write several webservice functions using VisualBasic.Net. I can request the info using a SOAP query(which I have't bothered to figure out how) or an HTTP POST or GET. I opted for the POST. I have several display areas on this intranet dashboard all wanting to display information retrieved by sending queries to this webservice. However, I just don't know how to get the data that is returned back into my page.
Further, I'm not developing the page in VisualStudio.Net for the web interface, I'm using Dreamweaver on a Mac.
as i understand you need to gather data from some different sources?
and to display them in the dashboard?
in this case you need some server-side logic to query data and then use XSLT for transformation of it. If you tied to Microsoft platform you can do all this stuff, usgin ASP.NET for instance.
and to display them in the dashboard?
in this case you need some server-side logic to query data and then use XSLT for transformation of it. If you tied to Microsoft platform you can do all this stuff, usgin ASP.NET for instance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i doesn't see any question :)
you can apply XSLT transformation to your data.
can you be more precise, what do you want to achieve?