Aray wrote:
Quote:
In HTML, we offten see the following line:
>
<form enctype="multipart/form-data" >
>
the attribute enctype can be "multipart/form-data",
"application/x-www-form-urlencoded" or "text/plain"
>
I want use XML to describe the FORM tag of HTML, and I want to make sure the
enctype have valid value, so a DTD file with following line is needed:
>
<!ENTITY % Enctype
"(application/x-www-form-urlencoded|multipart/form-data|text/plain)">
|
Ah, OK. Sorry for the misunderstanding: I thought you were trying to
represent elements in a content model.
Unfortunately you can't do that in XML: the values in Token Lists must
be Names (see the XML Specification, production [5]). Name characters
do not include the slash.
Quote:
|
Then, I got the probelm, I can't put the character '/' in there.
|
Correct. You can work around this using a Notation:
<!NOTATION mime SYSTEM "http://www.iana.org/assignments/media-types/">
<!ENTITY urlenc SYSTEM "application/x-www-form-urlencoded" NDATA mime>
<!ENTITY formdata SYSTEM "multipart/form-data" NDATA mime>
<!ENTITY plain SYSTEM "text/plain" NDATA mime>
<!ELEMENT form (#PCDATA)>
<!ATTLIST form name CDATA #IMPLIED
action CDATA #REQUIRED
method (get|post) #REQUIRED
enctype ENTITY #IMPLIED>
This makes the valid values for enctype one of urlenc, formdata, and
plain (or whatever you choose to declare them as). An XSLT processor can
then use the XPath function unparsed-entity-uri() to return the string
value of the declared entities.
///Peter
--
XML FAQ:
http://xml.silmaril.ie/