2

I am an extreme XML n00b and just started my first project. But when I open the .xml file, It displays the elements as well as the text. How do I get it to just display the text?

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE dhml [ 
    <!ELEMENT dhml (header, body, footer)>
    <!ELEMENT header (#PCDATA)*>
    <!ELEMENT body (p+)>
    <!ELEMENT footer (#PCDATA)*>
    <!ELEMENT p (#PCDATA)*>
    ]>
    <dhml>
    <header>Hello</header>
    <body>
        <p>Greetings</p>
        <p>YOLO</p>
    </body>
    <footer>Goodbye</footer>
    </dhml>

1 Answer 1

2
  1. Serve it with a suitable Content-Type (application/xml for example)
  2. Associate a stylesheet with it.

Generally speaking though, if you want to write markup for rendering as a document in a web browser, write HTML instead of inventing your own language (or, at least, transform it to HTML before serving to the client).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.