RE: XSLT, XHTML, and default attribute values [somewha
> Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx> writes: > > >>>>>> "Joseph" == Joseph Dane <jdane@xxxxxxxxxx> writes: > > > > Joseph> A consequence of this is that default attribute > values get > > Joseph> added to the tree before my processor has a > chance operate > > Joseph> on it. > > > > Only if your XML parser reads the DTD. If you can configure > it not to > > do so (and most have such a configuration option), then this won't > > happen. > > that's true. but then why not just remove the DTD > altogether? then you don't have to support obscure and/or > parser dependant configuration options. I'm not sure it is true. If a DTD is specified in the xml the parser *must* attempt to read it to ensure any defaulted values are present in the XML, regardless of configuration. Turning off validation (I think) simply suppresses validation errors. The only way I know of to parse an xml file with a DTD specified (without access to the DTD itself) is to implement a custom entity resolver. Of course, you can edit the XML file prior to transforming to remove the doctype, but regex'ing over xml markup just feels wrong. I don't understand the benefits of using defaulted values, as anyone studying the xml also needs to study the dtd to ensure they get the full picture. Seems crazy, really. cheers andrew.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format