[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT, XHTML, and default attribute values [somewha

Subject: Re: XSLT, XHTML, and default attribute values [somewhat OT]
From: Joseph Dane <jdane@xxxxxxxxxx>
Date: Tue, 14 Sep 2004 09:05:54 -1000
xslt attribute default value
Andrew Welch <ajwelch@xxxxxxxxxxxxxxx> writes:

>> Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx> writes:
>> 
>> > 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

I happened to be using SAX, so I had already turned off validation
using the standard SAX feature for this.  with validation disabled,
the DTD *was* still read, and default attribute values applied to the
model.  So you're correct there.

but there may be additional parser-dependent switches that further
restrict the behavior of the parser.  at least, I think there can.
the documentation for Xerces says that the feature:

  "http://apache.org/xml/features/nonvalidating/load-dtd-grammar"

can be used to control this, but even with that feature disabled I
was still getting the defaulted attribute values.  so perhaps
you're right.

> 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.

I can certainly see the value in some situations.  They make sense in
the "final" stage of document processing, when the doc is being read
by some application to control some behavior, e.g. what to render to
the screen. 

There seems to be a continuum of "levels of interest", from the basic
lexical structure, to the "infoset" explicit in the document, to the
type-annotated infoset, to the infoset augmented with default
values.  The problem is that there's no way to tell my tools what
level I'm interested in.

-- 

joe

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.