0

它开始打印所有内容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;  }
4

2 回答 2

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.
于 2012-11-01T06:00:41.670 回答
1

除了 manishie 已经提到的格式正确错误之外,您还需要更正格式错误的文档类型声明:对于

<?DOCTYPE ... >

<!DOCTYPE ... >

当我修复该错误以及 WF 错误时,页面显示正常,并且 CSS 样式似乎可以按预期使用。

使用错误的 DOCTYPE 声明,解析器会识别——从而吞下您的 xml-stylesheet 指令。不过,我不知道您为什么看到文档的第一部分而不是整个文档。

于 2012-12-10T23:51:43.777 回答