首頁 後端開發 XML/RSS教程 用xml和xsl做網頁實例

用xml和xsl做網頁實例

Feb 15, 2017 pm 03:58 PM
xm xsl

          轉載請註明來源:用xml和xsl做網頁實例

用xml和xsl做網頁。直接大家儲存兩個檔案運行即可。

cdcatalog.xml 相當於html
cdcatalog.xsl 相當於css



cdcatalog.xml
 
[html] view plaincopy

 

[html] view plaincopy

<?xml version="1.0" encoding="ISO-8859-1"?> 
<?xml-stylesheet type="text/xsl" href="http://www.php1.cn/">
 
<catalog> 
  <cd> 
    <title>Empire Burlesque</title> 
    <artist>Bob Dylan</artist> 
    <country>USA</country> 
    <company>Columbia</company> 
    <price>10.90</price> 
    <year>1985</year> 
  </cd> 
 <cd> 
    <title>Empire Burlesqu2e</title> 
    <artist>Bob Dyla2n</artist> 
    <country>USA2</country> 
    <company>Columbia2</company> 
    <price>10.91</price> 
    <year>1983</year> 
  </cd> <cd> 
    <title>Empire Burlesqu2e</title> 
    <artist>Bob Dyla2n</artist> 
    <country>USA2</country> 
    <company>Columbia2</company> 
    <price>10.91</price> 
    <year>1983</year> 
  </cd> <cd> 
    <title>Empire Burlesqu2e</title> 
    <artist>Bob Dyla2n</artist> 
    <country>USA2</country> 
    <company>Columbia2</company> 
    <price>10.91</price> 
    <year>1983</year> 
  </cd> <cd> 
    <title>Empire Burlesqu2e</title> 
    <artist>Bob Dyla2n</artist> 
    <country>USA2</country> 
    <company>Columbia2</company> 
    <price>10.91</price> 
    <year>1983</year> 
  </cd> <cd> 
    <title>Empire Burlesqu2e</title> 
    <artist>Bob Dyla2n</artist> 
    <country>USA2</country> 
    <company>Columbia2</company> 
    <price>10.91</price> 
    <year>1983</year> 
  </cd> 
</catalog>

 
 
 

用瀏覽器開啟cdcatalog.xml看效果。大多數瀏覽器和程式語言都支援的。


效果:

My CD Collection

 

Title

Artist以上就是用xml和xsl做網頁實例的內容,更多相關內容請關注PHP中文網(m.sbmmt.com)!
Empire Burlesque Bob Dylan
Empire Burlesqu2e Bob Dyla2n
Empire Burlesqu2e Bob Dyla2n
Empire Burlesqu2e Bob Dyla2n
Empire Burlesqu2e Bob Dyla2n
Empire Burlesqu2e Bob Dyla2n
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

Rimworld Odyssey溫度指南和Gravtech
1 個月前 By Jack chen
初學者的Rimworld指南:奧德賽
1 個月前 By Jack chen
PHP變量範圍解釋了
3 週前 By 百草
撰寫PHP評論的提示
3 週前 By 百草
在PHP中評論代碼
3 週前 By 百草

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Laravel 教程
1603
29
PHP教程
1508
276
XML模式:PHP中的示例 XML模式:PHP中的示例 Jul 23, 2025 am 12:27 AM

xmlschemavalidationInphpisachsiveDomdocumentAndDomxPathClasseswithThelibxmlextension.1)loadThexmlfilewithdomDocument.2)使用ChemavalidateTeTeTeTaTeTaTeAtaTaTaTaTaTaTaTaTaTAnxSDSSDSSDSCHEMA

如何將外部RSS Feed集成到購物商店 如何將外部RSS Feed集成到購物商店 Jul 24, 2025 am 02:13 AM

TointegrateanexternalRSSfeedintoShopify,firstverifythefeed’svalidityandformatting.2.UsecustomJavaScriptwithaproxyAPIlikeRSS2JSONtofetchanddisplaythefeedinaLiquidtemplate,asShopifylacksnativesupport.3.Alternatively,useano-codeShopifyappsuchasBlog&

XML名稱空間:Web服務的最佳實踐 XML名稱空間:Web服務的最佳實踐 Jul 14, 2025 am 12:03 AM

ThebestpracticesforusingXMLnamespacesinwebservicesare:1)UsemeaningfulnamespaceURIs,2)Useshortanddescriptiveprefixes,3)Consistentlyapplynamespaces,4)Avoidoverusingnamespaces,5)Documentnamespaces,and6)Considerperformanceimplications.Thesepracticesensur

XML對開發人員的好處:簡單,靈活性和可移植性 XML對開發人員的好處:簡單,靈活性和可移植性 Jul 20, 2025 am 03:59 AM

Xmlbenefitsdeveloperswithitssimplicity,柔韌性和通用性。 1)Itshuman-RearableFormataidsIneasyDebugging.2)customizabletagsallowforadaptabledabledstrastures.3)平台獨立性依賴性experenceenceenceensemensemensemensemenseamemenseamemenseamemelessememsemlessemlessdataexchangeaChangeAcrosssystems。

XML性能:這是一個好決定嗎? XML性能:這是一個好決定嗎? Jul 15, 2025 am 01:07 AM

xml'ssuitabilityforporformance-Criticalapplicationsdeppecifications.1)Xml'sparsingoverheadCanbesbesigantificant

XML:如果我不驗證我的成型XML怎麼辦? XML:如果我不驗證我的成型XML怎麼辦? Jul 21, 2025 am 02:28 AM

Notvalidatingwell-formedXMLcanleadtoseriousissues.1)Dataintegrityerrorsoccurwithoutvalidation.2)InteroperabilityissuesariseassystemsmayinterpretXMLdifferently.3)SecurityrisksincreaseduetopotentialexploitationbymaliciousXML.Alwaysuseschemasandautomate

XML寫作規則:避免常見錯誤 XML寫作規則:避免常見錯誤 Jul 21, 2025 am 01:50 AM

CommonXMLerrorsincludemismatchedtags,impropernesting,unquotedattributevalues,casesensitivityissues,invalidcharacters,andmisuseddeclarations.Toavoidthese:1)UseXMLeditorswithsyntaxhighlightingandauto-completiontopreventmismatchedtags.2)Mentallystructur

XML模式:什麼時候需要使用它? XML模式:什麼時候需要使用它? Jul 14, 2025 am 12:25 AM

XMLSchema在需要定義和驗證XML文檔結構和內容時是必要的。它確保數據的一致性和準確性,並為開發者提供結構指南。使用時需注意:1.管理複雜度,可將Schema分解成模塊;2.優化性能,考慮流式處理;3.學習曲線,參考教程和工具。

See all articles