This is currently going to be an XML sample I'm working on:
<smsq>
<sms>
<id>96</id>
<to>03333560511</to>
<msg> danial says: hahaha <space> nothing.
</msg>
</sms>
</smsq>
Now note that the tag may contain other tags (which should not be parsed), and I had to make dtd for this. Dtd was something like this:
<!DOCTYPE smsq [
<!ELEMENT sms (mID,to,msg,type)>
<!ELEMENT mID (#PCDATA)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT msg (CDATA)>
]>
But the problem is that the XML parser still goes in the tag and says that the tag should be closed by the tag. I just want to get the data as it is from XML, and I no longer want to parse the messages.
Help me solve the problem and tell me if this can be done using DTD.
Thank!
source
share