无法让我的xml和dtd一起工作,内容中不允许使用doctype

时间:2019-04-12 06:46:29

标签: xml dtd internals xml-dtd

我无法链接XML和DTD,当我确认我不断收到有关问题的DOCTYPE错误时,也当我将其另存为xml并将其单击到浏览器中时,它只是空白。

我早些时候验证了XML,这很好(此后进行了一些更改),但是我无法理解为什么DTD无法使用XML。

Validating, trying new doctype commands, researching to find a solution.

header ("Content-Type:text/xml");


<!DOCTYPE   [
<!ELEMENT restaurantdetails (cuisine,name,logo,foodpicture,URL,address,location,takeaway,dinein,ph,openhours,delivery,description)
<!ATTLIST cuisine type CDATA #REQUIRED>
<!ELEMENT name (#PCDATA)>
<!ELEMENT logo (#PCDATA)>
<!ELEMENT foodpicture (#PCDATA)>
<!ELEMENT URL (#PCDATA)>
<!ELEMENT address (#PCDATA)>
<!ELEMENT location (#PCDATA)>
<!ELEMENT takeaway (#PCDATA)>
<!ELEMENT dinein (#PCDATA)>
<!ELEMENT ph (#PCDATA)>  
]>

<pre>
<restaurantdetails>
    <cuisines> 
        <Asian>
            <b>
            <name>Name: Wok N Roll</name>
            <logo>
                <img src="Graphics/woknroll.png" alt="Stalactites" width="300" height="300">
            </logo>
            <foodpicture>
                <img src="Graphics/wokfood.jpg" alt="Stalactites" width="600" height="400">
            </foodpicture>
            <URL>URL: https://www.stockland.com.au/shopping-centres/centres/stockland-green-hills/stores/wok-n-roll</URL>
            <address>Address: 1 Molly Morgan Drive, Stockland</address>
            <location>Location: East Maitland</location>
            <takeaway>Takeway: Yes</takeaway>
            <dinein>Dine-in: Yes</dinein>
            <ph>Phone: 49336589</ph>
            <openhours>Open Hours:</openhours>
                    <openhoursmonday>Monday=9am- 
530pm</openhoursmonday>
                    <openhourstuesday>Tuesday=9am-530pm</openhourstuesday>
                    <openhourswednesday>Wednesday=9am-530pm</openhourswednesday>
                    <openhoursthursday>Thursday=9am-9pm</openhoursthursday>
                    <openhoursfriday>Friday=9am-530pm</openhoursfriday>
                    <openhourssaturday>Saturday=9am-5pm</openhourssaturday>
                    <openhourssunday>Sunday=10am-4pm</openhourssunday>
            <openhours></openhours>
            <delivery>Delivery: Yes</delivery>
            <minimumspend>Minimum spend for delivery: $34</minimumspend>
            <deliveryfee>Delivery Fee: $10</deliveryfee>
            <description>Description: Wok N Roll offers authentic Chinese food prepared and cooked on site daily. Using the 
            freshest ingredients to create delicious meals available for takeaway or dining in. Served with your choice of 
            noodles or rice a meal from Wok N Roll is a delicious choice for lunch or dinner. Fresh handmade sushi is also          
            available.</description>
            </b>    
    </cuisines>
</restaurantdetails>
</pre>


To be able to open it as an XML and display what is written in the code instead of having to open it as a HTML.

0 个答案:

没有答案