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

Re: interpreting the DTD

Subject: Re: interpreting the DTD
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 16 Jan 2001 11:20:59 +0000
interpreting 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


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.