• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 552
  • Last Modified:

XML DTD

What would be the XML DTD for this xml

<product run_date="Oct 27, 2011 2:43:40" time="The products created 1 day(s) ago." >
<design  
ID="0"
DId="1"
user_id="45544"
creation_date="October 26, 2011"
first_name="Michel"
last_name="Douglas"
>
<prod_specs  Name="xxxxx"  FLOW="0.01"  Feature="M" />
<bom
 c_name="zzzz"
 c_bpn="xxxxxx" ></bom>
 </design>
</product>
0
gagangill
Asked:
gagangill
1 Solution
 
Geert BormansCommented:
many DTDs are possible depending on the requirement.
Here is one that works
<?xml encoding="UTF-8"?>

<!ELEMENT product (design)>
<!ATTLIST product
  run_date CDATA #REQUIRED
  time CDATA #REQUIRED>

<!ELEMENT design (prod_specs,bom)>
<!ATTLIST design
  DId CDATA #REQUIRED
  ID CDATA #REQUIRED
  creation_date CDATA #REQUIRED
  first_name NMTOKEN #REQUIRED
  last_name NMTOKEN #REQUIRED
  user_id CDATA #REQUIRED>

<!ELEMENT prod_specs EMPTY>
<!ATTLIST prod_specs
  FLOW CDATA #REQUIRED
  Feature NMTOKEN #REQUIRED
  Name NMTOKEN #REQUIRED>

<!ELEMENT bom EMPTY>
<!ATTLIST bom
  c_bpn NMTOKEN #REQUIRED
  c_name NMTOKEN #REQUIRED>

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now