简体   繁体   中英

API Output Styling

I hate to ask but I've searched all over the internet trying to figure this out.

So I get the API to pull info from Education.com site. I got all the school info, location info, etc. But how do I style it?!

I want to make a nice looking table, the output is like this:

<params>
 <param>
  <value>
   <array>
   <data>
<value>
 <struct>
  <member>
   <name>school</name>
   <value>
    <struct>
     <member>
      <name>schoolid</name>
      <value>
       <string>17914</string>
      </value>
     </member>
     <member>
      <name>schoolname</name>
      <value>
       <string>Fair Oaks Community High School</string>
      </value>
     </member>

Would I just use CSS or am I forgetting a step? I'm sorry for my ignorance.

Sincerely, Carl

Although you can certainly write your own XML parser to build an HTML table the way you like it, this is one of the many things that XSLT is good for. Some examples:

This is a perfect use for XSLT. You can iterate over the elements in that XML and output it right into HTML.

This article details the needed steps pretty well. http://www.tonymarston.net/php-mysql/xsl.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM