Ondra Žižka
Ondra Žižka

Reputation: 46884

Defining a XML entity without having the DTD "scheme"

I'd like to use XML entities to define text snippets shortcuts. But for that, I need to define DTD:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ruleset [
    <!ENTITY useCli SYSTEM "Define this setting using JBoss CLI or the web console.">
]>
<ruleset id="..."

But this doesn't work since XML tools complain about the ruleset element not being defined. So I tried

    <!ELEMENT ruleset ANY>

But then it wants the child elements, attributes etc.

Is there a way to define a XML entity without defining the whole DTD? (There is a XSD schema for that document.)

Upvotes: 1

Views: 1096

Answers (1)

Tea Curran
Tea Curran

Reputation: 2993

XSD is an alternative to DTD. If you have an XSD you shouldn't need a DTD.

See this answer for how to convert XSD to DTD: Free XSD to DTD conversion utility?

Upvotes: -1

Related Questions