Почему мой код не генерируется в веб-браузере? XML, DTD, CSS

Он начинает печатать все до 29d 18h 46m и тогда это останавливается. ИДК почему. Оо

Может кто-нибудь сказать мне, почему он печатает до этой точки, а затем останавливается?

<?xml version="1.0" encoding="utf-8"?>
<?DOCTYPE phones SYSTEM "http://userpages.umbc.edu/~v16/is448/hw4/hw4_phones.dtd">
<?xml-stylesheet type="text/css" href="http://userpages.umbc.edu/~v16/is448/hw4/hw4_phones.css" ?>

<phones>
    <phone>

        <title>Apple iPhone 4S - 16GB - White (Factory Unlocked) Smartphone</title>
        <gBay_id>Item: 160913150440</gBay_id>
        <user_id>Seller: milehighmobilellc</user_id>
        <category>Type: Smartphone</category>
        <condition>Condition: Used</condition>
        <brand>Brand: Apple</brand>
        <model>Model: iPhone 4s</model>
        <carrier>Carrier: Factory Unlocked</carrier>
        <color>Color: White</color>
        <OS>Operating System: Apple iOS</OS>
        <contract>Contract: Without Contract</contract>
        <style>Form Factor: Bar</style>
        <buying_format>Buy It Now</buying_format>
        <auction>
            <starting_price>N/A</starting_price>
            <duration>N/A</duration>
        </auction>
        <buy_it_now>
            <starting_price>$449.99</starting_price>
            <duration>29d 18h 46m</duration>
        </buy_it_now>
        <description>
            Just when you thought a smartphone couldn’t get any better, it just did — the
            iPhone 4S is sure to change the way you communicate. The Siri technology lets
            you talk to this Apple smartphone as you would talk to a person, turning the
            iPhone 4S into a personal assistant. The powerful dual-core A5 chip ensures that
            this Apple phone gives you a lightning-fast performance and life-like graphics.
            Shoot 1080p HD videos and click crystal-clear snaps with the 8 MP camera of this
            Apple smartphone. To make your life easier, this Apple phone runs on iOS 5 that
            lets you enjoy numerous features and an easy-to-use interface. That’s not all;
            with the iCloud feature of the iPhone 4S, you can stop worrying about managing
            your stuff, because your phone does it for you.
        </description>
        <shipping>
        <cost>$0.00</cost>
        <speed>Expedited Shipping</speed>
        <shipping>
        <payment>PayPal, Bill Me Later</payment>
    </phone>

    <phone>

        <title>HTC Droid Incredible - 8GB - Black (Verizon) Smartphone</title>
        <gBay_id>Item: 251173407738</gBay_id>
        <user_id>Seller: jpfredd710</user_id>
        <category>Type: Smartphone</category>
        <condition>Condition: Used</condition>
        <brand>Brand: HTC</brand>
        <model>Model: Droid Incredible</model>
        <carrier>Carrier: Verizon</carrier>
        <color>Color: Black</color>
        <OS>Operating System: Android 2.3.4</OS>
        <contract>Contract: Without Contract</contract>
        <style>Form Factor: Bar</style>
        <buying_format>Auction</buying_format>
        <auction>
            <starting_price price="$62.01"></starting_price>
            <duration time="50m 30s"></duration>
        </auction>
        <buy_it_now>
            <starting_price price="N/A"></starting_price>
            <duration time="N/A"></duration>
        </buy_it_now>
        <description>
            The HTC Droid Incredible lets you communicate effortlessly through its
            touchscreen interface. This HTC smartphone has a 3.7-inch, 480x800-pixels
            resolution AMOLED display. Shoot pictures and videos using the built-in
            8.0-megapixel camera. This HTC cell phone has a 1 GHz Snapdragon processor,
            and 512 MB RAM running Google’s Android 2.1 or 2.3.4 (Gingerbread) with HTC
            Sense UI. What’s more, this CDMA HTC smartphone is Wi-Fi-ready. This HTC
            mobile phone has 8 GB memory, and supports up to 32 GB microSD memory cards.
            The HTC Droid Incredible has built-in Bluetooth 2.1 with A2DP support, and
            a microUSB 2.0 port.
        </description>
        <shipping>
        <cost>$5.99</cost>
        <speed>Economy Shipping</speed>
        <shipping>
        <payment>PayPal, Bill Me Later</payment>
    </phone>

    <phone>

        <title>HTC 7 Pro - 16GB - Gray (U.S. Cellular) Smartphone</title>
        <gBay_id>Item: 181006815999</gBay_id>
        <user_id>Seller: st4mford</user_id>
        <category>Type: Smartphone</category>
        <condition>Condition: Used</condition>
        <brand>Brand: HTC</brand>
        <model>Model: 7 Pro</model>
        <carrier>Carrier: U.S. Cellular</carrier>
        <color>Color: Black</color>
        <OS>Operating System: Windows Phone 7</OS>
        <contract>Contract: Without Contract</contract>
        <style>Form Factor: Bar</style>
        <buying_format>Auction</buying_format>
        <auction>
            <starting_price price="$79.99"></starting_price>
            <duration time="1h 14m 29s"></duration>
        </auction>
        <buy_it_now>
            <starting_price price="$119.99"></starting_price>
            <duration time="1h 14m 29s"></duration>
        </buy_it_now>
        <description>
            View and edit the office docs on your phone. Quickly and easily cut through
            the clutter to see only the unread, urgent, or flagged messages in your
            Outlook inbox. And use SharePoint, when you need a little bit of help from
            your team to crack the project.The slide and tilt screen on the HTC 7 Pro
            angles perfectly to reveal a dedicated QWERTY keyboard. The keys are raised
            and nicely spaced for fast and comfortable typing. And because the screen
            tilts, the HTC 7 Pro is perfect for watching videos - hands free - when you
            have a brief moment to kick back and relax.
        </description>
        <shipping>
        <cost price="$3.99"></cost>
        <speed type="Economy Shipping"></speed>
        <shipping>
        <payment>PayPal, Bill Me Later</payment>
    </phone>

Стили:

phones  {   font-family:arial,calibri;  }
title   {   font-size:125%;     font-family:trebuchet ms, arial;    font-style:bold;    }
gBay_id     {   font-size:75%;  color: blue;    }
user_id     {   font-style:bold;    }
buying_format   {   background-color: #D8D8D8;  }
auction     {   background-color: #D8D8D8;  }
buy_it_now  {   background-color: #D8D8D8;  }

2 ответа

Ну, у вас есть несколько ошибок.

  • Вы неправильно закрыли свои метки доставки. Они должны быть:
<shipping>
    <cost>$0.00</cost>
    <speed>Expedited Shipping</speed> 
</shipping>
  • Вы пропустили последний закрывающий тег:
</phones>
  • Я считаю, что Chrome дает очень полезные сообщения об ошибках, чтобы помочь исправить ошибки XML. Например, прежде чем я исправил закрывающий тег </phones>, сообщение об ошибке в Chrome показало:
This page contains the following errors:

error on line 129 at column 10: Extra content at the end of the document
Below is a rendering of the page up to the first error.

В дополнение к ошибкам корректности, уже упомянутым manishie, необходимо исправить некорректное объявление типа документа:

<?DOCTYPE ... >

читать

<!DOCTYPE ... >

Когда я исправляю это, а также ошибки WF, страница отображается нормально, и стиль CSS, кажется, используется, как и следовало ожидать.

При плохом объявлении DOCTYPE анализатор идентифицирует - таким образом проглатывая вашу инструкцию xml-stylesheet. Я понятия не имею, почему вы видели первую часть документа, а не весь документ.

Другие вопросы по тегам