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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Sanjaya Vitharana-2
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
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.html>

Reply | Threaded
Open this post in threaded view
|

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

Helmut Enck-Radana-2
Hi,

in XML DTDs enumerated values have to be NMTOKENs, i.e. you can only use
strings which could be used as names. You have to use a different schema
language, if you need to to express the constraint you described. May be a
better solution is not to use the asterisc, but a symbol which conforms to
the NMTOKEN production instead.

-- Helmut

At 08:46 2005-07-13, you wrote:

>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



Reply | Threaded
Open this post in threaded view
|

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

Sanjaya Vitharana-2
got your point.

changing it to
<!ATTLIST key
       no (1|2|3|4|5|6|7|8|9|z|r|c|astric) #REQUIRED>
will sort the problem.

Since the mobile phone has the * (astric) key, it is interesting to know how
to express the constraint as we like.

Such as,
<!ATTLIST key
       no (1|2|3|4|5|6|7|8|9|z|r|c|*) #REQUIRED>

Could you please guide me to some reference materials or some better
examples to pick this quickly.
----------------------------------------------------------------------------
-----------------------
Further more,

is it not possile to define a datatype like below ???

<!ATTLIST fax
      no MyType #IMPLIED>

MyType::= #x9 | #xA | #xD

or some other way ..... ( this is NOT Working too )

Or using <!ENTITY like ...

<!ENTITY aa "&#xD;&#xA;">
<!ENTITY ss     "&#42;">

Hope it will possible.

As I never did it before, I don't know how this can be done.

Can anybody help me ....!!!!
----------------------------------------------------------------------------
-----------------------

Regards,

Sanjaya Vitharana

----- Original Message -----
From: "Helmut Enck-Radana" <her>
To: "Sanjaya Vitharana" <sanjaya>
Cc: <erlang-questions>
Sent: Wednesday, July 13, 2005 2:25 PM
Subject: Re: DTD / xmerl_scan:file help !!!!! {invalid_nmtoken,"*) #RE"


> Hi,
>
> in XML DTDs enumerated values have to be NMTOKENs, i.e. you can only use
> strings which could be used as names. You have to use a different schema
> language, if you need to to express the constraint you described. May be a
> better solution is not to use the asterisc, but a symbol which conforms to
> the NMTOKEN production instead.
>
> -- Helmut
>
> At 08:46 2005-07-13, you wrote:
> >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
>
>