Hi,
I have sample dtd file such as below, I want to add the dtd file as is in baseX.
Since the dtd file is not in xml format, there are currently two option I can thought about
1.
Use TEXT as input format
When I add it using baseX client UI, I got following output. Since we just need store the dtd file and later get it back as is. So I can not use doc function to retrieve it back as is.
<text>
<line><dtd></line>
<line><!--</line>
<line><?xml encoding="UTF-8"?></line>
<line/>
<line> <tmpComment>Sample rng file comments</tmpComment></line>
<line/>
<line><!ELEMENT first (#PCDATA)></line>
<line/>
<line><!ELEMENT last (#PCDATA)></line>
<line/>
<line><!ELEMENT user (first,last)></line>
<line><!ATTLIST user</line>
<line> xmlns:xsi CDATA #FIXED 'http://www.w3.org/2001/XMLSchema-instance'</line>
<line> xsi:schemaLocation CDATA #FIXED 'http://ariba.com.com/Core_after_xsd.xsd'></line>
<line>--></line>
</text>
2.
Format it to xml using <dtd> <!—original data --> </dtd> when add, and remove those dtd and comment tag when download using doc() function.
And there is extra handling required for nested xml comment.
Is there any other better approach for adding dtd file which can be retrieved as its original content?
Thanks
Yvonne
===========================================================================================================================
Sample.dtd
<?xml encoding="UTF-8"?>
<!-- Sample rng file comments -->
<!ELEMENT first (#PCDATA)>
<!ELEMENT last (#PCDATA)>
<!ELEMENT user (first,last)>
<!ATTLIST user
xmlns:xsi CDATA #FIXED 'http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation CDATA #FIXED 'http://ariba.com.com/Core_after_xsd.xsd'>