DTD question about ATTLIS
Posted: Wed Jan 19, 2005 7:11 am
Hi,
Sample of a DTD file for an XML.
<!ELEMENT SEGMENT ( SEG1 | SEG2 | SEG3 )>
<!ATTLIST SEGMENT
ACTION (ACTION1 | ACTION2)
TYPE = XYZ
>
Now if I use this dtd, then the attribute “TYPE†of the element “SEGMENT†will have the value “XYZ†for all the possible elements in the XML (i.e SEG1 or SEG2 or SEG3)
Is there any way by which I can check some condition (say for example, whether the “SEGMENT†is “SEG1†or “SEG2†or “SEG3â€) and then decide the value of the attribute “TYPE†(something like if .. else) ?
Can anyone please help me ?
Thanks,
Rahul
Sample of a DTD file for an XML.
<!ELEMENT SEGMENT ( SEG1 | SEG2 | SEG3 )>
<!ATTLIST SEGMENT
ACTION (ACTION1 | ACTION2)
TYPE = XYZ
>
Now if I use this dtd, then the attribute “TYPE†of the element “SEGMENT†will have the value “XYZ†for all the possible elements in the XML (i.e SEG1 or SEG2 or SEG3)
Is there any way by which I can check some condition (say for example, whether the “SEGMENT†is “SEG1†or “SEG2†or “SEG3â€) and then decide the value of the attribute “TYPE†(something like if .. else) ?
Can anyone please help me ?
Thanks,
Rahul