将XML和XSL链接到HTML

时间:2016-05-21 17:10:56

标签: javascript jquery html xml xslt

我正在尝试创建移动网站应用程序。我的所有数据都在XML文件中,并且使用jQuery mobile将其格式化在XSL文件中。我只想知道如何将它们加载到HTML文件中?当您加载HTML文件时,应显示XSL的所有样式。你是怎么做到的?

Info.XML

rustc 1.10.0-nightly (d91f8ab0f 2016-05-07)

Transformation.xsl

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Transform.xsl"?>
<Attractions>
    <Attraction>
        <Name>Tower of London</Name>
        <Address>Tower Hill, London EC3</Address>
        <TelNo>0844 482 7777</TelNo>
        <Pictures>Images/1.jpg</Pictures>
        <Price> £22.50 </Price>
        <Rating>4</Rating>
        <ShortDescription>The Tower of London is one of the world’s most famous fortresses and has seen service as royal palace, prison, armoury and even a zoo. The ancient stones hold within them dark secrets, as fortified vaults shine with priceless jewels and historic uniformed Beefeaters stroll the grounds. Situated in Central London, just a stone’s throw from the River Thames, the Tower of London is one of the city's premier attractions.</ShortDescription>
        <LongDescription>The White Tower
One of the most famous keeps in the world, this Tower is so renowned that it was referred to by Shakespeare in many of his plays. It contains the impressive Royal Armouries collections and even an 11th century Romanesque chapel. You can take daily tours of the White Tower at 10:45, 12:45 and 14:15.
The Royal Mint
Explore the Coins and Kings exhibition which depicts the story of the Mint at the Tower between 1279 and 1812. Learn about what life was like on Mint Street through outdoor installations and interactive displays, even fun facts about Isaac Newton and his thief catching skills.
Crown Jewels
Take a walk through history and learn about some of the most important symbols of our culture and monarchy. Try and count the 23,578 gems that make up the Crown Jewels and marvel at the stories of how the collection was nearly destroyed through history. You can even see the crown Elizabeth II wore to her coronation!
Royal Beasts
For 600 years the Tower was kept as a menagerie of wild and exotic animals; gifts that the King and Queen were donated by their visitors and admirers. Everything from ostriches to elephants, lions and polar bears were kept in the confines of the Brick Tower.
Ravens
If the six resident ravens ever leave the court, legend has it that the court and the tower will fall. The ravens who inhabit the Tower are named and are replaced if they are badly behaved! Currently the Tower has seven ravens, in case one goes missing, and they are looked after by the Raven Master. A word of warning: don’t approach the ravens as they’re known to eat 170g of raw meat a day, as well as blood-soaked bird biscuits!</LongDescription>
        <OpeningTimes>09.00 - 17.30</OpeningTimes>
        <Category></Category>
    </Attraction>
<Attraction>
        <Name>Westminster Abbey</Name>  
        <Address>Westminster Abbey, London SW1P 3PA</Address>
        <TelNo>020 7222 5152</TelNo>
        <Pictures>Images/2.jpg</Pictures>
        <Price>£20</Price>
        <Rating>4</Rating>
        <ShortDescription>Just a short walk from the Thames, Westminster Abbey is a must-see and a significant structure in British history. This beautiful gothic church is a UNESCO World Heritage Site popular with many visitors to London. Complete with paintings, stained glass windows and other religious artefacts, Westminster Abbey owns the most important collection of monumental sculpture anywhere in Britain.</ShortDescription>
        <LongDescription>Sermons
The life of the abbey revolves around worship; Morning Prayer, Evensong and the Eucharist. The services are open to the public of any religious denomination.
Music
Westminster Abbey has been actively musical since the monks of the tenth century, to the daily choir singers of today, the Choir of Westminster Abbey. The earliest pair of organs were installed in 1304 in the Lady Chapel. Some of the most celebrated British musicians, organists, singers and composers have been linked to the Abbey throughout their careers.
Bell Ringing
Since the first established bell ringing group in 1255, the Brethren of the Guild of Westminster, the bell ringers of today are comprised of a volunteer group who ring on special occasions such as saint’s days, church festivals and Royal and Abbey anniversaries.
Flag Days
On top of the North Tower, constructed between 1722 and 1745, sits a flag pole which flies various flags throughout the year for different occasions. The flags consist of; the Commonwealth Nations, the Flag of St Peter, the Abbey Flag, the Union Flag, the Flags of the National Saints, the Royal Air Force Flag, and the Royal Standard.
</LongDescription>
        <OpeningTimes>09.30 – 15.30</OpeningTimes>
        <Category></Category>
    </Attraction>
<Attraction>
        <Name>Churchill War Rooms</Name>
        <Address>Clive Steps, King Charles Street, London SW1A 2AQ,</Address>
        <TelNo>020 7930 6961</TelNo>
        <Pictures>Images/3.jpg</Pictures>
        <Price>17</Price>
        <Rating>4</Rating>
        <ShortDescription>
Explore the secret headquarters of ‘the greatest Briton’, Sir Winston Churchill, and uncover the underground nucleus of Britain’s war effort. The first London museum of its kind, the Churchill War Rooms and Museum depicts all ninety years of Winston Churchill’s life, divided into five chapters starting from his childhood, through his early years as British Prime Minister and the period famously known as the ‘Gathering Storm’
</ShortDescription>
        <LongDescription>Churchill’s Bunker
Discover what it was really like in the bunkers of WWII, learn about the experiences of Churchill and his contemporaries through stories, documents and interviews from members of his closet staff, including his personal secretary Elizabeth Layton. Understand the conditions they lived under and the shared morale and camaraderie among the secrecy and fear of attack.
Churchill Museum
Learn about one of Britain’s most powerful men, the British Bulldog, Sir Winston Churchill through a series of interactive displays outlining his life and rise to power. Listen to extracts from his rousing speeches, read letter exchanges between him and his wife Clementine and discover objects from his childhood. One of Churchill’s earliest paintings is on display as well as film clips and photographs from his eventful ninety years.
Cabinet War Rooms
For six years, between 1939 and 1945, the Cabinet War Rooms were a series of secret rooms in the basement at the New Public Offices. As a secret shelter for the Prime Minister and the cabinet to control the plotting and planning of the war, they moved into the bunker a week before declaring war on Germany. Learn about the conversations between Churchill and Roosevelt in the Transatlantic Telephone room, and walk through the maze of secret passages that used to buzz with political activity.
</LongDescription>
        <OpeningTimes>09.30 - 18.00</OpeningTimes>
        <Category></Category>
    </Attraction>
<Attraction>
        <Name>Thames River Boat Cruise</Name>   
        <Address>Boats depart from Westminster Pier, London Eye Pier, Tower Hill Pier and Greenwich Pier</Address>
        <TelNo>020 77 400 400</TelNo>
        <Pictures>Images/4.jpg</Pictures>
        <Price>18</Price>
        <Rating>5</Rating>
        <ShortDescription>A Thames river cruise is without doubt one of the best ways to see London, meandering through the heart of the city and past so many of its most famous attractions. See and experience the sights and splendour of this great city from the relaxed comfort of City Cruises modern, all-weather boats with open upper decks and spacious lower saloons with panoramic windows.</ShortDescription>
        <LongDescription>Westminster Pier
If you’re after some of London’s most historic landmarks, Westminster Pier is a good option to explore the Houses of Parliament, Tate Britain, Churchill Museum, Westminster Abbey, Cabinet War Rooms, Buckingham Palace and Big Ben. It’s a short walk from the River Thames into the hustle and bustle of Central London, into Soho, Leicester Square and Covent Garden.
London Eye
Set along London’s famous Southbank area, you can immerse yourself in the “cultural heart” of the city. Stroll along the famous esplanade, past street performers and pop-up eateries to the more edifying landmarks such as The British Film Institute, National Theatre, Queen Elizabeth Hall and Royal Festival Hall. Further along the river, you can find Shakespeare’s Globe Theatre and the Tate Modern.
Tower Bridge
The river cruise’s most popular stop, it allows you to explore the Tower of London and Tower Bridge, two of London’s most famous landmarks. With close links to the financial city and historic centre of London, you have the Monument, HMS Belfast, the Great Fire memorial by Christopher Wren and the Design Museum all within easy reach.
Greenwich
Slightly removed from the busy Central London, this pier is popular for experiencing the expanse of palatial grounds and Greenwich Park, as well as the independent shops the area has to offer. The newly refurbished Cutty Sark is open to explore and learn about its nautical past. Not far is the National Maritime Museum, Greenwich Market as well as the Royal Observatory Greenwich.
</LongDescription>
        <OpeningTimes>From 10.00</OpeningTimes>
        <Category></Category>
    </Attraction>
<Attraction>
        <Name>Tower Bridge Exhibition</Name>
        <Address>The Tower Bridge Exhibition, London SE1 2UP,</Address>
        <TelNo>020 7403 3761</TelNo>
        <Pictures>Images/5.jpg</Pictures>
        <Price>9</Price>
        <Rating>5</Rating>
        <ShortDescription>Tower Bridge is one of the most impressive structures and sites in the capital and has stood over the River Thames since 1894. As well as being one of the most recognizable landmarks in the world, it is one of the most visited attractions in London and continues to be a working bridge to this day.
The Tower Bridge Exhibition lets you discover the history of the Bridge and how it was built, through interactive displays and videos about the landmark its place in the history of the River Thames
</ShortDescription>
        <LongDescription>Glass Walkway
The Tower Bridge Exhibition has just launched it's most significant development since 1982 - the glass walkway. Housed in the West Walkway, visitors can admire Tower Bridge from a unique perspective and look down on passing boats and pedestrians underfoot and even catch the bascules rising if you time it right. From 42m above the river, the glass walkway is a must-see - if you need any more convincing, the glass is made up of five thick layers and can hold the equivalent weight of an elephant and two taxis. So you're pretty safe!
Victorian Engine Rooms
The Victorian Engine Rooms hold the coal driven steam engines that were once used to power the bridges. Interactive information panels help visitors discover the development of technology used over the years to keep the bridge in motion, complete with sounds and smells that take you back through time. You can also experience a virtual Bridge lift illustrating how the bascules are raised.
East Walkway
Experience the breath-taking views from the high-level walkway, East Walkway, and observe the wealth of museums and historic buildings that surround the Thames, including HMS Belfast and the Tower Of London. The East Walkway also houses the exhibition ‘Great Bridges of the World’ showcasing over 20 bridges of inspiring engineering
</LongDescription>
        <OpeningTimes>10.00 - 18.00</OpeningTimes>
        <Category></Category>
    </Attraction>
</Attractions>

0 个答案:

没有答案