DTD / xmerl_scan:file help !!!!! {invalid_nmtoken,"*) #RE"

Sanjaya Vitharana sanjaya@REDACTED
Wed Jul 13 08:46:25 CEST 2005


Reverting to my below question,

<!ATTLIST key
      no CDATA #REQUIRED>

is working well, but it allows all the rage of CDATA to appear with the attribute "no".

But I want something like below to strict the valid keys to some specific.

<!ATTLIST key
      no (1|2|3|4|5|6|7|8|9|z|r|c|*) #REQUIRED>    ---Note the * (astric in the end) --- and of course NOT WORKING.

Hope you can understand.

Are there any way to do this ...????

Regards,

Sanjaya Vitharana

----- Original Message ----- 
From: Sanjaya Vitharana 
To: erlang-questions@REDACTED 
Sent: Wednesday, July 13, 2005 11:30 AM
Subject: DTD / xmerl_scan:file help !!!!! {invalid_nmtoken,"*) #RE"


Hi....!!!

I get the below error when adding * (astric) to attribute list of my "key" element. As below

<!ATTLIST key
      no (1|2|3|4|5|6|7|8|9|z|r|c|*) #REQUIRED>    ---Note the * (astric in the end)

Error I got is.

1> {ParsResult2,Misc2}=xmerl_scan:file('ivr.xml',[{validation,true
}]).
2798- fatal: {invalid_nmtoken,"*) #RE"}
** exited: {fatal,{{invalid_nmtoken,"*) #RE"},
                   {file,"./ivr.dtd"},
                   {line,21},
                   {col,47}}} **

Seems to be * (astric) is invalid in DTD (or may be xmerl_scan validation problem).

But i want to use * (astric) in my XML file as below. So there must be a way to define it in DTD ..... can any DTD expert help me in this case.

--------------- XML File I use -------------------------
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE IVR SYSTEM "ivr.dtd">
<IVR>
.........
<key no="*">http://localhost/greeting_lite/select_song_greeting.php</key>  ------------------- Note the attribute *
.........

</IVR>

-------- This DTD is working without any problem ----------
<?xml version="1.0" encoding="utf-8" ?>
<!ELEMENT IVR (........, key*, ..........)>    
<!ELEMENT key (#PCDATA)>
<!ATTLIST key
      no (1|2|3|4|5|6|7|8|9|z|r|c) #REQUIRED>
------------------------------------------------------------------------------------

NOTE: ......... (doted line) means there are some other fields

Waiting quick reply.

Regards.

Sanjaya Vitharana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20050713/6bc7cbf2/attachment.htm>


More information about the erlang-questions mailing list