What are the steps to resolving the '1' issue in my restaurant.dtd.xml document?

Having trouble with XML

Can anyone explain why this specific file is causing an error?

file: restaurant.xml


<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="restaurant.css"?>
<!DOCTYPE Items SYSTEM "restaurant.dtd">
<Items>
  <Item Number="1">
  <Food>Hamburger</Food>
  <Price currency="USD">5.75</Price>
</Item>
  <Item Number="2">
  <Food>HotDog</Food>
  <Price currency="USD">3.50</Price>
</Item>
  <Item Number="3">
  <Food>Cola Drink</Food>
  <Price currency="USD">2.25</Price>
</Item>
</Items>

restaurant.dtd

<!ELEMENT Items (Item+)>
<!ELEMENT Item (Food, Price)>
<!ATTLIST Item Number CDATA #REQUIRED>
<!ELEMENT Food (#PCDATA)>
<!ELEMENT Price (#PCDATA)>
<!ATTLIST Price currency (USD|INR) CDATA "USD">

The line causing trouble is <!DOCTYPE Items SYSTEM "restaurant.dtd">, showing '1' error in 'restaurant.dtd'.xml

Answer №1

The issue at hand is specifically identified as the "XML Production Error: Character 'C' does not satisfy production "AttValue".

However, by altering your "Price currency" ATTLIST and eliminating the CDATA, the problem should be resolved.

In essence:

<!ATTLIST Price currency (USD|INR) "USD">

Instead of

<!ATTLIST Price currency (USD|INR) CDATA "USD">

In this scenario, CDATA isn't necessary since neither "USD" nor "INR" contain any content that could be seen as part of the XML structure.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with grid breakpoints for medium-sized columns and grid rows not functioning as expected

I'm working on building a grid layout from scratch in Vue.js and have created my own component for it. In my gridCol.vue component, I have defined several props that are passed in App.vue. I'm struggling to set up breakpoints for different screen ...

When scrolling, a new page loads seamlessly

Recently, I came across a website that has an interesting feature where new content is loaded automatically while scrolling, seamlessly appending to the existing page. What's more fascinating is that not only does the content change, but the URL also ...

Unresolved styles in React component linked to styles.css file

As I dive into creating a registration page in ReactJS, I encounter a frustrating issue with my styles not applying correctly from the styles.css file. Let's take a look at my RegisterPage.jsx component: export default function RegisterPage() { ret ...

Hide the scrollbar in the div depending on the specified condition

I'm having trouble with this particular process and haven't been successful so far... I currently have a customized scrollbar within a div element, and what I am attempting to do is remove the scrollbar when the height of the div is less than 19 ...

Performing Jquery functions on several elements at once

Looking at the code snippet below, there are two buttons and an input in each container. The input calculates and adds up the number of clicks on the 2 buttons within the same container. However, it currently only works for the first container. How can thi ...

HTML table designed to work in both Internet Explorer and Firefox, with a header and footer that remain fixed while allowing vertical and

I am in need of a highly functional HTML super-table. I am open to using jQuery or any other JavaScript library, regardless of potential drawbacks, as long as it meets the following requirements. It must support: Compatibility with at least IE8 and the ...

Position a span within a container div and ensure that it remains centered even in cases of overflow

I need assistance with centering text horizontally next to an image inside a container div that is 40px x 40px. The anchor tag contains the image with matching dimensions, and below it is a span with text. I've tried using text-align: center, adjustin ...

Ways to Resolve Issues with WordPress Update and Publish Failures

It has been quite some time since Gutenberg was introduced to us, and it seems like we all have a complicated relationship with it. Navigating the Block editor to create a post or page can be challenging, especially when it used to be so simple. But what& ...

Determine the height of a UIWebView within a UITableViewCell when embedding a tweet from Twitter

When I load an HTML file into a webview, it may contain embedded links to Twitter, Vimeo, YouTube, or simple HTML content. For testing purposes, I created a simple view to calculate the height of the webview accurately. A table view depends on this calcul ...

Combining a standard JSS class with Material-UI's class overrides using the classnames library

I am exploring the method of assigning multiple classes to an element in React by utilizing the classnames package from JedWatson, along with Material-UI's "overriding with classes" technique. For reference, you can see an instance in MUI's docu ...

Unable to override the Bootstrap theme

Despite trying multiple methods, I've found it challenging to override the CSS of Bootstrap specifically for this paragraph element P.fs-5.text-muted. Interestingly, all other CSS elements are easily modifiable. Here's an example that works: H1. ...

Php: Form data vanishes upon refreshing the page

Hey there! I'm a beginner in the world of PHP and currently working on developing a multi-page form. However, I am facing an issue where the entered data disappears as soon as the page is refreshed. Below is the code snippet that I have been trying to ...

javascript various backgrounds on click

I have implemented a list to allow users to select their top 3 choices, and I am using JavaScript to track these selections and change the background color accordingly. 1st selection -> Green background 2nd selection -> Yellow background 3rd sel ...

Step-by-step guide to automatically submitting a form after obtaining geolocation without the need for manual button-clicking

I am looking for a way to automatically call a page to get geolocation data, and then submit the form to my PHP page with the values of getlat and getlon without the need to click a submit button. I have tried implementing the code below, however, despit ...

What is the best way to align a GIF and two rows of text within a container div?

Check out my JSFiddle below: In this fiddle, there is an image sized 32 by 32 on the left side and two lines of text on the right. I need help aligning the center of the gif and the text with the middle of the enclosing frame. I've tried adjusting t ...

Display the title of an image beneath the image using CSS

Since upgrading my CMS, I've encountered an issue where the captions of images are not showing below the image for thousands of articles. For example: <img src="123.jpg" alt="Texttext" class="caption" style="disp ...

objects continue to escape the confines of the container

While working on this dashboard design, I've encountered an issue where the content items jump out of their designated container. I'm using Bootstrap and have tried various solutions like setting the class to container-fluid, changing tags from & ...

The animation on my jQuery script seems to be malfunctioning

I'm encountering an issue with a div element that is partially off the screen and should move out when a button is clicked. I've shared my script here, but it seems to not work as intended when the button is pressed. The visualization in jsfiddle ...

I can spot the JavaScript dynamic dropdown feature displayed in the button as well

I am in the process of dynamically creating start and end time drop-down fields within my application. I have also incorporated a remove link for these fields. However, when navigating using the 'tab' key, I notice that the drop-down is appearing ...

Align both the image and text in the center with no space between

How can I center two blocks containing both images and text vertically and horizontally while using flexbox? I notice that when the text is longer, padding appears between the image and the text. How can I remove this padding?1 .product-teaser { width ...