This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: interpreting the DTD


Hi Klaus,

> It was impossible for me to access the contents of the referenced
> DTD in a XML - Doc with MSXML 1.0

I think that's still the case, even through navigating the DOM,
although it seems you can get (XDR) schema definitions with relative
ease.

Anyway, you can't do it with XSLT 1.0 - there's no XPath access to the
DTD.  There are two possible workarounds.

The first will only work if all the possibly options are covered in
your document.  If they were, you could find the unique values for the
attribute in the document by defining a key:

<xsl:key name="attr-values" match="NODE" use="@ATTR" />

and then iterating over the NODEs that are first in the list returned
by the key for that particular @ATTR value:

  <SELECT ...>
     <xsl:for-each
         select="//NODE[count(.|key('attr-values', @ATTR)[1]) = 1]">
       <INPUT TYPE="option" VALUE="{@ATTR}" ... />
     </xsl:for-each>
  </SELECT>

The other thing that you could do is define a schema that holds
information about the options rather than a DTD.  Since the schema is
XML, you can access it from within the XSLT using the document()
function, and then gather the relevant values from it in the normal
way.
  
I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]