I am doing an XML transformation and I have a DTD for the XML with a default value of "0" set for the "cost" attribute of the "expense" element:
However, when my xml has an "expense" element without a "cost" attribute, I have a problem with the XSL transformation (when I do a select on the cost attribute): IE displays the cost as zero, but Firefox and Chrome leave it blank (or NaN if I run a numeric function on the value). What can I do so that my transformation will show "expense" elements with no "cost" attribute as the correct default value?Code:<!ELEMENT expense EMPTY> <!ATTLIST expense recurrence (One-Time|Monthly|Annual) #IMPLIED> <!ATTLIST expense name CDATA #REQUIRED> <!ATTLIST expense cost CDATA "0">
Could it be a problem with the headers in my xml file? Here they are:
Code:<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="budget.xsl"?> <!DOCTYPE budgetlist SYSTEM "budget.dtd">




Reply With Quote