I'm currently taking a class covering a wide variety of languages and the current assignment is xml/xslt. I have never worked with either before and I had to write a DTD for the XML file, then use an XSL sheet to convert to HTML5. I wrote the whole DTD and begun work on the XML file and looked at a couple of examples. I realized I put almost everything as attributes instead of using child elements and wondered if this would be a cause for concern later in the assignment when doing the XSLT sheet. Here is a little bit of my DTD so you see what I mean -
<!ELEMENT employ_history (#PCDATA)>
<!ATTLIST employ_history
employer_name CDATA #REQUIRED
employer_address CDATA #REQUIRED
job_title CDATA #REQUIRED
begin_date CDATA #REQUIRED
end_date CDATA #REQUIRED
duties CDATA #REQUIRED>
Should I just form the attributes as child elements or is it going to matter? I'd rather not have to rewrite the whole DTD if unnecessary, I just realize my XML sheet might be a bit ugly. I emailed my professor but sometimes he takes awhile to get back and assignment is due in a couple of days. Thank you for any help.
No comments:
Post a Comment