Xml Parser baseret på DTD
Hey Experts!Er der nogen derude der kan lave en xml parser baseret på denne DTD:
<!DOCTYPE common-config [
<!ELEMENT common-config (description?, content-handler, content )>
<!ELEMENT description (#PCDATA)>
<!ELEMENT content-handler (#PCDATA)>
<!ELEMENT content (text-list*)>
<!ELEMENT text-list (text-entry*, field*)>
<!ATTLIST text-list
component CDATA #REQUIRED
default-lang CDATA #IMPLIED>
<!ELEMENT text-entry (text*)>
<!ATTLIST text-entry id CDATA #REQUIRED >
<!ELEMENT text (#PCDATA)>
<!ATTLIST text lang CDATA #REQUIRED >
<!ATTLIST field
text CDATA #REQUIRED
flyover CDATA #REQUIRED
>
<!ELEMENT field EMPTY>
]>
Dette skulle give noget xml der basalt ser således ud
<?xml version="1.0" encoding="iso-8859-1"?>
<common-config>
<description>File file.xml generated on 2006-02-13 12:26:27</description>
<content-handler>XmlHandler</content-handler>
<content>
<text-list component="common">
<text-entry id="FeltId">
<text lang="DA">Noget tekst</text>
<text lang="EN">Some Text</text>
</text-entry>
<field text="tekst" flyover="tekst"/>
<field text="noget tekst" flyover="noget tekst" help="hjælpetekst" />
</text-list>
</content>
</common-config>