Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New user: Help creating XML from DTD

Status
Not open for further replies.

Andviv

Programmer
Aug 6, 2001
29
US
I have this in a DTD file:

<!ENTITY % STRTYPE &quot;(#PCDATA)&quot; >
<!ENTITY % BOOLTYPE &quot;(#PCDATA)&quot; >
<!ENTITY % DATETYPE &quot;(#PCDATA)&quot; >
<!ENTITY % DATETIMETYPE &quot;(#PCDATA)&quot; >
<!ENTITY % TIMEINTERVALTYPE &quot;(#PCDATA)&quot; >

<!ENTITY % CustomerListRefMacro &quot;(ListID? , FullName?)&quot; >
<!ENTITY % ListRefMacro &quot;(ListID? , FullName?)&quot; >
<!ENTITY % SimpleListRefMacro &quot;(ListID? , FullName?)&quot; >

<!ELEMENT EntityRef (%CustomerListRefMacro;)>
<!ELEMENT CustomerRef (%CustomerListRefMacro;)>
<!ELEMENT ItemServiceRef (%ListRefMacro;)>
<!ELEMENT ClassRef (%ListRefMacro;)>

<!ELEMENT IsBillable %BOOLTYPE;>
<!ELEMENT Duration %TIMEINTERVALTYPE;>
<!ELEMENT Initial %STRTYPE;>
<!ELEMENT TxnDate %DATETYPE;>
<!ELEMENT Rate %PRICETYPE;>
<!ELEMENT PayrollItemWageRef (%SimpleListRefMacro;)>
<!ELEMENT Notes %STRTYPE;>

<!ELEMENT TimeTrackingAdd (TxnDate , EntityRef , CustomerRef? , ItemServiceRef? , Rate? , Duration , ClassRef? , PayrollItemWageRef? , Notes? , IsBillable?)>

I need to create a XML file that can be validated with this DTD, but I have no clue how to do it.
Can you help me?

I only have so far this:

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<!DOCTYPE TimeTrackingAdd SYSTEM &quot;C:\Program Files\Intuit\QuickBooks Pro\qbxml.dtd&quot;>
<TimeTrackingAdd>
<TxnDate>2003-12-21</TxnDate>
</TimeTrackingAdd>

How can I fill the rest of the fields?
 
DTD needs something like
<!ENTITY % PRICETYPE &quot;(#PCDATA)&quot; >


Sample XML instance:

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<!DOCTYPE TimeTrackingAdd SYSTEM &quot;your.dtd&quot;>
<TimeTrackingAdd>
<TxnDate>Text</TxnDate>
<EntityRef>
<ListID/>
<FullName/>
</EntityRef>
<CustomerRef>
<ListID/>
<FullName/>
</CustomerRef>
<ItemServiceRef>
<ListID/>
<FullName/>
</ItemServiceRef>
<Rate>Text</Rate>
<Duration>Text</Duration>
<ClassRef>
<ListID/>
<FullName/>
</ClassRef>
<PayrollItemWageRef>
<ListID/>
<FullName/>
</PayrollItemWageRef>
<Notes>Text</Notes>
<IsBillable>Text</IsBillable>
</TimeTrackingAdd>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top