3
使用傳統的ASP和MSXML2.DOMDocument,我試圖將此XML轉換爲HTML表格。任何人都可以將我指向正確的方向嗎?什麼是邏輯過程?將XML數據轉換爲HTML - 看起來很簡單,但我很努力
這是我要轉換的XML。
所需的輸出格式是在這裏 - http://ashleylangford.com/tableex.gif
<?xml version="1.0"?>
<inv-balance>
<item color-code="50" description="G200 ASH.GREY S" item-number="0620404A3" price="$2.60" size-code="3" special-expiry="06/30/12" specialPrice="$1.92" style-code="G200">
<transit-time days="0">386</transit-time>
<transit-time days="1">6602</transit-time>
<transit-time days="2">9090</transit-time>
<transit-time days="3">88755</transit-time>
<transit-time days="5">2394</transit-time>
<transit-time days="All">107227</transit-time>
</item>
<item color-code="50" description="G200 ASH.GREY M" item-number="0620404A4" price="$2.60" size-code="4" special-expiry="06/30/12" specialPrice="$1.92" style-code="G200">
<transit-time days="0">422</transit-time>
<transit-time days="1">9428</transit-time>
<transit-time days="2">12162</transit-time>
<transit-time days="3">86798</transit-time>
<transit-time days="5">3523</transit-time>
<transit-time days="All">112333</transit-time>
</item>
<item color-code="50" description="G200 ASH.GREY L" item-number="0620404A5" price="$2.60" size-code="5" special-expiry="06/30/12" specialPrice="$1.92" style-code="G200">
<transit-time days="0">548</transit-time>
<transit-time days="1">14810</transit-time>
<transit-time days="2">17335</transit-time>
<transit-time days="3">84832</transit-time>
<transit-time days="5">5611</transit-time>
<transit-time days="All">123136</transit-time>
</item>
<item color-code="50" description="G200 ASH.GREY XL" item-number="0620404A6" price="$2.60" size-code="6" special-expiry="06/30/12" specialPrice="$1.92" style-code="G200">
<transit-time days="0">644</transit-time>
<transit-time days="1">15040</transit-time>
<transit-time days="2">16954</transit-time>
<transit-time days="3">50635</transit-time>
<transit-time days="5">5995</transit-time>
<transit-time days="All">89268</transit-time>
</item>
<item color-code="50" description="G200 ASH.GREY 2XL" item-number="0620404A7" price="$4.19" size-code="7" special-expiry="06/30/12" specialPrice="$3.39" style-code="G200">
<transit-time days="0">343</transit-time>
<transit-time days="1">5374</transit-time>
<transit-time days="2">7016</transit-time>
<transit-time days="3">26033</transit-time>
<transit-time days="5">2592</transit-time>
<transit-time days="All">41358</transit-time>
</item>
<item color-code="50" description="G200 ASH.GREY 3XL" item-number="0620404A8" price="$4.33" size-code="8" special-expiry="06/30/12" specialPrice="$3.39" style-code="G200">
<transit-time days="0">153</transit-time>
<transit-time days="1">1242</transit-time>
<transit-time days="2">1896</transit-time>
<transit-time days="3">4699</transit-time>
<transit-time days="5">803</transit-time>
<transit-time days="All">8793</transit-time>
</item>
<item color-code="50" description="G200 ASH.GREY 4XL" item-number="0620404A9" price="$4.49" size-code="9" special-expiry="06/30/12" specialPrice="$3.39" style-code="G200">
<transit-time days="0">18</transit-time>
<transit-time days="1">78</transit-time>
<transit-time days="2">159</transit-time>
<transit-time days="3">237</transit-time>
<transit-time days="5">62</transit-time>
<transit-time days="All">554</transit-time>
</item>
<item color-code="50" description="G200 ASH.GREY 5XL" item-number="0620404AA" price="$4.63" size-code="0" special-expiry="06/30/12" specialPrice="$3.39" style-code="G200">
<transit-time days="0">16</transit-time>
<transit-time days="1">295</transit-time>
<transit-time days="2">215</transit-time>
<transit-time days="3">2127</transit-time>
<transit-time days="5">119</transit-time>
<transit-time days="All">2772</transit-time>
</item>
</inv-balance>
看起來像是探索XSLT的絕好機會。 XSLT是客戶端聲明式XML語言,允許您格式化XML數據!只是暗示你的方向:)。最好的事情是,每個瀏覽器都支持它:http://www.w3schools.com/xsl/xsl_browsers.asp – sinni800 2012-02-17 17:52:29