Re: XSL:USE ?

Subject: Re: XSL:USE ?
From: Tyler Baker <tyler@xxxxxxxxxxx>
Date: Mon, 28 Sep 1998 09:50:09 -0400
James Clark wrote:

> Tyler Baker wrote:
> >
> > "The xsl:define-attribute-set element defines a named set of attributes.
> > The name attribute specifies the name of the attribute set. The content
> > of the xsl:define-attribute-set element is an xsl:attribute-set element
> > that specifies the attributes. A literal result element or an
> > xsl:attribute-set element can specify an attribute set name as the value
> > of the xsl:use attribute."
> >
> > OK this is all pretty clear to me, but the problem I have is that I am
> > confused by the XSL DTD Attlist declaration for an attribute set which
> > says that it has one attribute named xsl:use.
> >
> > <!ELEMENT xsl:attribute-set EMPTY>
> >
> > <!ATTLIST xsl:attribute-set
> >   xsl:use NMTOKENS #IMPLIED
> > >
> >
> > In the following example from the spec itself, you will notice that the
> > xsl:attribute-set has two attributes: font-size and font-weight.  Is
> > this an error?
>
> The beginning of Appendix A says:
>
>  The following entity can be used to construct a DTD for XSL
> stylesheets  that create instances of a particular result DTD.
>  Before referencing the entity, the stylesheet DTD must define a
> result-elements parameter entity listing the allowed
>  result element types. For example:
>
>  <!ENTITY % result-elements "
>    | fo:sequence
>    | fo:block
>  ">
>
>  The stylesheet DTD may also need to define additional attributes for
> xsl:attribute-set.

I understand the result-elements stuff more or less.  For example, what I use
right now in the DTD I have is the following:

<!ENTITY % result-elements "ANY">

I do this for now for very obvious reasons.  I currently just want to deal
with HTML output and not mess around with formatting objects at the moment.

Nonetheless, by your statement I take it you can have multiple attribute-set
types.  In other words:

<!ELEMENT xsl:attribute-set1 EMPTY>
<!ATTLIST xsl:attribute-set1
  foo CDATA "Bar"
>

<!ELEMENT xsl:attribute-set2 EMPTY>
<!ATTLIST xsl:attribute-set2
  bar CDATA "Foo"
>

Basically my understanding is you can redefine the XSL DTD to do whatever you
want.  My initial understanding is that only the result-elements entity was
allowed to be mutated.

If you can mutate the XSL DTD to do anything, how can anyone write a standard
XSL Processor?  I mean, you would have an XSL Processor for spitting out HTML,
and XSL Processor for formatting objects, etc.

I am sorry if these questions seem elementary, but the current spec is not
totally clear on how application developers would develop with XSL.  Should
each stylsheet have its own DTD?

Tyler


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread