|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Accessing attribute from DTD
/ Amit Rekhi <amitr@xxxxxxxxxxxxx> was heard to say:
| I can access the attribute value of a target element in XSL using
|
| target-element.getAttribute("attribute-name");
|
| In such a case, the attribute value for the target-element is picked from
| the XML file.
|
| But what if the attribute value is specified in the DTD rather than the XML?
|
| What API do I use to access the attribute value (of a target element)
| specified in the DTD??
There's no specific API for doing this, though there may be an
API eventually that will let you look at the structure of the
DTD for the source instance.
If your XSL processor processes the DTD for the instance,
default attribute values should be propagated onto the actual
target-elements. (In other words, you shouldn't have to look at
the DTD for attribute values, attributes occur on elements.) If
your XSL processor ignores the DTD (and the element declarations
in the internal subset, if there are any), then you're stuck.
You'll have to normalize the instance before you apply style
with XSL.
This means that you may get dramatically different results with
different XSL processors if you rely on attribute values
defaulted in the DTD and some (but not all! ;-) XSL processors
ignore the DTD. This is not a good thing.
--norm
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








